Open Graph and Meta Tags: og:title, og:image and What Is Required

Last updated: · 8 min read

The card with a title and an image that appears when a link is shared is built from a handful of meta tags in the <head> of the page. The Open Graph protocol defines the names of those tags; the title and description of a search result come from the <title> element and the description meta tag. The Open Graph and Meta Tag Generator writes all of these as one block from the title, description, address and image you enter, counts characters and shows an approximate preview. It does not open the target page or ask any platform; it only produces code from what you type. This guide covers the properties the protocol requires, what each tag is for, common misconceptions about character counts and the limits of the tool. The code in the example is real output.

Formula

<title>Title</title>
<meta name="description" content="Description">
<meta property="og:type" content="website | article">
<meta property="og:title" content="Title">
<meta property="og:description" content="Description">
<meta property="og:url" content="Permanent address of the page">
<meta property="og:image" content="Full address of the image">
<meta property="og:site_name" content="Site name">
<meta name="twitter:card" content="summary_large_image | summary">
<meta name="twitter:title" …>  <meta name="twitter:description" …>
<meta name="twitter:image" …>  <meta name="twitter:site" content="@handle">

The Open Graph protocol requires four properties on every page: og:title, og:type, og:image and og:url. og:description and og:site_name are optional. Open Graph tags are written with the property attribute, while description and the twitter: tags use name; the tool takes care of that distinction. A field left empty produces no tag at all. The characters &, <, > and the double quote are escaped for HTML (& becomes &amp;), and line breaks and runs of spaces are collapsed into a single space. The tool writes the title and the description in three places each; if you want different wording per platform, edit the code afterwards.

What the inputs mean

Page title
Used for <title>, og:title and twitter:title. The counter below shows the number of characters and a status (short, within range, long) against “common guidance: about 50–60”. That range is not an official limit.
Description
Used for description, og:description and twitter:description. The counter reports against the common guidance of 120–160 characters; characters are counted as code points, so an emoji is one character.
Page URL
The og:url value. The protocol defines it as the canonical URL used as the permanent ID of the object; enter the full address without tracking parameters.
Image URL
The og:image and twitter:image value. It has to be a full address starting with http:// or https://; otherwise the tool warns and leaves it out of the preview. The image is loaded by your browser, for the preview only.
Site name and Content type (og:type)
The site name becomes og:site_name. The type is website or article: website for home pages and general pages, article for posts and news.
X (Twitter) card type and handle
The card type is summary_large_image (large image) or summary (small image). The handle keeps only letters, digits and underscores, is cut to 15 characters and gets a leading @; if it is empty, no twitter:site line is written.

Worked example: Tags for the page of a coffee shop

  1. Input: Page title = Coffee Lab & Roastery – Fresh Beans Delivered Every Week; Description = Small-batch coffee roasted on Mondays and shipped the same day. Compare our single-origin beans, read brewing guides and order online.; Page URL = https://example.com/coffee; Image URL = https://example.com/img/coffee-1200x630.jpg; Site name = Coffee Lab; Content type = website; card type = summary_large_image; handle = @coffee_lab.
  2. The counters read “56 characters · common guidance: about 50–60 · within range” for the title and “134 characters · common guidance: about 120–160 · within range” for the description.
  3. Generated code: <title>Coffee Lab &amp; Roastery – Fresh Beans Delivered Every Week</title> <meta name="description" content="Small-batch coffee roasted on Mondays and shipped the same day. Compare our single-origin beans, read brewing guides and order online."> <meta property="og:type" content="website"> <meta property="og:title" content="Coffee Lab &amp; Roastery – Fresh Beans Delivered Every Week"> <meta property="og:description" content="Small-batch coffee roasted on Mondays and shipped the same day. Compare our single-origin beans, read brewing guides and order online."> <meta property="og:url" content="https://example.com/coffee"> <meta property="og:image" content="https://example.com/img/coffee-1200x630.jpg"> <meta property="og:site_name" content="Coffee Lab"> <meta name="twitter:card" content="summary_large_image"> <meta name="twitter:title" content="Coffee Lab &amp; Roastery – Fresh Beans Delivered Every Week"> <meta name="twitter:description" content="Small-batch coffee roasted on Mondays and shipped the same day. Compare our single-origin beans, read brewing guides and order online."> <meta name="twitter:image" content="https://example.com/img/coffee-1200x630.jpg"> <meta name="twitter:site" content="@coffee_lab">
  4. The & in the title is written as &amp; in the code; browsers and platforms read it back as &. Other characters, such as the en dash (–), are left as they are.
  5. Preview: the search result preview shows the title and the description in full. The share card preview cuts the description at 125 characters and ends it with “…brewing guides and ord…”. That cut is the tool's own approximation; real platforms may cut elsewhere.
  6. Set the content type to article and the card type to summary, then clear the image URL and the handle. The code shrinks from 13 lines to 10: the og:image, twitter:image and twitter:site lines disappear and two lines change to <meta property="og:type" content="article"> and <meta name="twitter:card" content="summary">

Result: The 13-line block goes into the <head> of the page. The version without an image lacks og:image, which the protocol requires; the share card then has no image, or the platform may pick one from the page on its own.

🏷️ Open Graph and Meta Tag Generator

Free, no sign-up; your data stays in your browser.

Open the calculator →

How to read the result

The character counters are guidance, not rules. Google's own documentation says there is no limit on how long a <title> element or a meta description can be, and that the text is truncated in search results as needed, typically to fit the device width. Google also states that it may draw on sources other than <title>, such as og:title, when building a title link, and that it primarily generates the snippet from the page content; so there is no guarantee that your wording is shown as written. For the share image the protocol sets no dimensions; platforms publish their own recommendations, and a landscape image at roughly 1.91:1, such as 1200 × 630 pixels, is a widespread one. For exact figures consult the current documentation of the platform you are targeting. The tool does not output optional properties such as og:image:width, og:image:height, og:image:alt or og:locale; the protocol recommends that a page specifying og:image also specify og:image:alt, and you can add these by hand. After publishing, check the real appearance in the platform's own preview or debugging tool; platforms may keep a card cached for a while.

Common mistakes

  • Treating 50–60 and 120–160 characters as official limits. They are common guidance; a search engine truncates by displayed width rather than by character count and may rewrite the text.
  • Using a relative address for og:image. A path such as /img/cover.jpg cannot be resolved from outside the page; use the full address including the domain.
  • Putting the same title, description and image on every page. Each page's tags should describe that page, and og:url should be that page's own permanent address.
  • Writing Open Graph tags with name and twitter tags with property. The protocol defines og: tags with property; the tool picks the right attribute, so do not break it when editing by hand.
  • Placing the tags in <body> or adding them later with JavaScript. The crawlers that build share previews often read only the <head> of the HTML sent by the server.
  • Taking the preview for the platform's real rendering. The tool's preview is approximate and never opens the target page; it cannot see other tags on your live page.
  • Changing the image and expecting the share card to update at once. Platforms may keep the previous card for some time; use the platform's own tool to refresh it.

Frequently asked questions

Which Open Graph tags are required?

The protocol requires four properties: og:title, og:type, og:image and og:url. Others such as og:description, og:site_name and og:locale are optional.

How long should a meta title and description be?

There is no official character limit. Google says the title link and the snippet are truncated as needed, typically to fit the device width. 50–60 and 120–160 characters are common approximate values for text that shows uncut on most screens.

What size should an og:image be?

The Open Graph protocol does not specify a size. Platforms publish their own recommendations; a landscape image at about 1.91:1, such as 1200 × 630 pixels, is a common one. For exact values check the current documentation of the platform you share on.

Do og:title and <title> have to be the same?

No. <title> is used in the browser tab and in search results, og:title on the share card. The tool writes the same text to both; if you want a shorter title without the site name for sharing, change the og:title line by hand.

Are twitter: tags still needed?

twitter:card is X's own tag for choosing the card type and has no Open Graph counterpart, so you need it if you want the large-image card. For the other twitter: tags consult the platform's current documentation; the tool outputs all of them together.

How does the tool count characters?

By Unicode code point. “Café ☕ 👍” counts as 8 characters; an emoji is one. The width taken up on screen still varies from letter to letter, so the count is only an approximate measure.

Does the tool crawl my page and read existing tags?

No. The target page is never opened; the code is built only from what you type into the form. The image address you enter is loaded by your browser, for the preview only.

The result is not exact or binding and is for information only; it is not an official document and cannot be used in official procedures. Confirm it with the competent authority or a professional before acting; no liability is accepted for losses arising from its use.

Sources

Choose your cookie preference to continue

Records the site needs to work (theme, language, favourites) stay in your browser.

This site is free and funded by ads.

With your consent, Google Analytics cookies measure visits and Google AdSense cookies are used to show ads; the data is processed on Google servers abroad.

If you reject, the site works just the same.

Cookie Policy · KVKK notice