Open Graph and X Card Meta Tag Generator – Free

This Open Graph meta tag generator writes the og: and twitter: tags that control how a link looks when it is shared. Enter a title, description, URL and optional image, then paste the tags into your page head.

How to use the Social meta tags tool

  1. Type the headline for the preview into Page title.
  2. Write one or two sentences in Description.
  3. Paste the address of the page into Canonical URL, including https://.
  4. Add the address of a cover image in Preview image URL if you have one.
  5. Select Generate meta tags, or select Example to see a full set.
  6. Select Copy and paste the tags inside the head of your page.

How Open Graph and X card tags create a link preview

When someone posts a link, the platform sends a crawler to fetch the page and reads the meta tags in its head. It builds the preview card from those tags, usually without running any JavaScript, so the tags have to be in the HTML that the server sends.

Open Graph is a protocol introduced by Facebook in 2010 and now read by most social and messaging apps. It names four basic properties for every page: og:title, og:type, og:image and og:url. Its tags use the property attribute. X has its own card tags, which use the name attribute. X falls back to the Open Graph title, description and image when the twitter: versions are missing.

A worked example

With all four fields filled in, the result has nine lines: five Open Graph tags and four card tags. Because an image is present, twitter:card is set to summary_large_image. Without an image the two image lines disappear, seven lines remain and the card type becomes summary.

Page title:         Base64Coding: Developer tools
Description:        Convert text and files in your browser.
Canonical URL:      https://example.com/
Preview image URL:  https://example.com/cover.png

Result:
<meta property="og:type" content="website">
<meta property="og:title" content="Base64Coding: Developer tools">
<meta property="og:description" content="Convert text and files in your browser.">
<meta property="og:url" content="https://example.com/">
<meta property="og:image" content="https://example.com/cover.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Base64Coding: Developer tools">
<meta name="twitter:description" content="Convert text and files in your browser.">
<meta name="twitter:image" content="https://example.com/cover.png">

Tags the Open Graph meta tag generator writes

The set is fixed, and the only branch is whether an image was given. Page title and Description are both required, and the URLs must be absolute http or https addresses.

  • og:type is always website.
  • og:title and og:description repeat your text exactly as typed.
  • og:url is the Canonical URL after normalization by the URL parser of the browser.
  • og:image and twitter:image appear only when Preview image URL is filled.
  • twitter:card is summary_large_image with an image and summary without one.
  • twitter:title and twitter:description copy the Open Graph values.
  • The characters &, <, >, double quote and apostrophe are written as HTML entities, which crawlers decode, so the content attribute stays valid.

What the tool leaves to you

Without an image the output has no og:image, although the protocol lists it as required, so supply one whenever you can. Several common tags are outside the scope of the form: og:site_name, og:locale, the image width, height and alt properties, and twitter:site. Add them by hand if you need them.

The image has to be reachable by crawlers at an absolute URL. A size of 1200 by 630 pixels, a ratio of about 1.91 to 1, is the usual choice for large cards. The tool does not download the image or the page, so it cannot check dimensions.

Frequently asked questions

Where do Open Graph tags go in the HTML?

Inside the head element of the page, next to the title and other meta tags. They must be part of the server response, because preview crawlers generally do not execute scripts that would insert them later.

What image size should I use for og:image?

1200 by 630 pixels works for the large card layout on the major platforms. Keep important content away from the edges, since some apps crop to a square. This generator accepts any http or https image address and does not inspect the file.

Do I need both og: and twitter: tags?

X can reuse the Open Graph title, description and image, but it needs twitter:card to know which layout to draw. This tool writes both sets, so the preview is defined explicitly for every platform.

Why is my link preview not updating after I change the tags?

Platforms store the preview the first time a URL is shared. Until that cache expires, the old card is shown. Most platforms offer a debugging or inspection page where you can request a fresh fetch of the URL.

Does the generator fetch my page or image?

No. It formats the text you enter and never contacts your site. Everything happens in your browser, which also means it cannot confirm that the URL or the image actually loads.

Related tools