Open graph meta generator

Generate open-graph and socials HTML meta tags for your website.

loading Open graph meta generator
About this tool

What are Open Graph and Twitter Card meta tags?

When someone pastes your link into Slack, WhatsApp, LinkedIn, Facebook, Discord or X, the app does not show the page. It downloads the HTML, looks for a few <meta> tags in the <head> and draws a preview card from them: a title, a short description and an image. Those tags are called Open Graph tags, after the protocol that Facebook published at ogp.me, and every other platform adopted them. X (formerly Twitter) has its own twitter: tags for its cards, but it falls back to the Open Graph ones when they are missing.

Without them, each app guesses: it may use the page title, the first image it finds or nothing at all, and the preview ends up looking broken. With them, you decide what appears when your page is shared, which is one of the cheapest ways to get more clicks from links that already exist. The tags do not change how Google ranks the page, but a clear preview improves the chance that people open it.

This generator builds the block of tags from a simple form and runs entirely in your browser; the addresses and texts you type are not sent anywhere. You fill in the fields, the tags appear in the output box as you type, and you copy them into the <head> of your page. Fields you leave empty are left out of the output, and every value is escaped so a quote or an ampersand cannot break the HTML.

How to generate the meta tags for your page

  1. Choose the Page type. website is right for a home page, a tool or a landing page; the type list also has article, book, profile, music and video types, which add extra fields of their own.
  2. Fill in the Title and Description: the text people see in the card. A short, specific title and a description of one or two sentences work best, because platforms cut long text.
  3. In Page URL, write the canonical address of the page, with the protocol (https://...).
  4. In the image group, add the Image URL with the full address, including https://. Fill in the Image alt text for accessibility, and the Width and Height in pixels if you know them, so platforms can reserve the right space.
  5. Under Twitter, pick the Card type: summary shows a small thumbnail beside the text and summary_large_image shows a wide image above it. You can also add the Site account and Creator account (such as @yourbrand).
  6. Copy the result from Your meta tags and paste it inside the <head> of the page. Your page type and card type are remembered for the next visit; the texts you typed are not stored.

Title, description, image and image alt text are copied into the matching twitter: tags automatically, so you do not have to type them twice.

Examples

The default page, as it opens

With the sample values the tool opens with, the output is:

<!-- og meta -->
<meta property="og:type" content="website" />
<meta property="og:title" content="My awesome page" />
<meta property="og:description" content="A short description of the page" />
<meta property="og:url" content="https://example.com" />

<!-- twitter meta -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="My awesome page" />
<meta name="twitter:description" content="A short description of the page" />

Notice that the twitter:title and twitter:description lines were added by the tool from the title and description.

A page with a sharing image

Add an image, an alt text, its size and a site account:

<!-- og meta -->
<meta property="og:type" content="website" />
<meta property="og:title" content="Online JSON formatter" />
<meta property="og:description" content="Format, validate and minify JSON in your browser." />
<meta property="og:url" content="https://example.com/json" />
<meta property="og:image" content="https://example.com/og/json.png" />
<meta property="og:image:alt" content="Screenshot of the JSON formatter" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />

<!-- twitter meta -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@example" />
<meta name="twitter:title" content="Online JSON formatter" />
<meta name="twitter:description" content="Format, validate and minify JSON in your browser." />
<meta name="twitter:image" content="https://example.com/og/json.png" />
<meta name="twitter:image:alt" content="Screenshot of the JSON formatter" />

The size of 1200 x 630 pixels, a proportion of about 1.91 to 1, is the usual choice for wide cards.

Quotes and ampersands in the title

A title typed as Tom & Jerry's "best of" is written safely for an HTML attribute:

<meta property="og:title" content="Tom &amp; Jerry's &quot;best of&quot;" />

If you write the tags by hand and forget this, the first quote ends the attribute and the rest of the title is lost. The same escaping is available in HTML entities.

A small card with only what you know

Leave the description and the image empty, choose summary, and the output has only the lines that have a value: type, title and URL, plus the card type and the copied title. Empty fields never produce an empty content="".

Common problems and how to fix them

  • The preview does not change after you edit the tags: platforms cache the card. Use the Facebook Sharing Debugger or the LinkedIn Post Inspector to force a refresh, and wait a little for X and messaging apps.
  • The image does not appear: the Image URL must be absolute (https://...), public and not behind a login. Relative paths such as /og/json.png are not resolved by most crawlers. Also check that the image is not too large for the platform to download.
  • The tags are in the page but the platform ignores them: they must be in the <head> of the HTML the server sends. If your app builds them with JavaScript after loading, crawlers that do not run scripts never see them.
  • The wrong page type was chosen: changing the page type clears the fields that belonged to the previous type, so check the extra fields again.
  • Compressed or very large images load slowly: reduce the file first with the image compressor before using it as the card image.

Frequently asked questions

Which Open Graph tags are required?

The protocol defines og:title, og:type, og:image and og:url as the basic set. In practice, add og:description too, and an og:image with absolute address, because it is what makes the card attractive.

Do I need separate tags for X (Twitter)?

Only twitter:card is worth setting, since it chooses the layout. For the title, description and image, X reads the Open Graph ones when the twitter: ones are missing, and this generator still writes both for you.

What is the best size for the sharing image?

A common recommendation is 1200 x 630 pixels. Keep important content away from the edges, because some apps crop the image, and use a PNG or JPEG instead of a format that old crawlers may not support.

Do meta tags improve my Google ranking?

Not directly. Open Graph tags control how a shared link looks, not how it ranks. The page <title> and the meta description in the same <head> are separate things; use word counter to check their length.

Report a problem