By · Updated

Open Graph Generator

og:image and Twitter Card Tags for Rich Link Previews, With Size Checks

No ratings yet

OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.

How the Open Graph Tags Generator works

This Open Graph generator writes og: and twitter: tags. A link with the right Open Graph tags unfurls into a card with an image, title and description in Slack, iMessage, LinkedIn, Facebook, WhatsApp and most other places links get pasted. Without them the platform guesses, usually badly. Fill in the fields, pick the content type, and copy the tags into your page's <head>. Warnings flag the mistakes that break previews: relative image URLs, missing images, text that will be cut off.

Open Graph generator: the tags that matter

Open Graph is a small vocabulary of <meta property="og:..."> tags originally defined by Facebook and now read by almost every service that renders link previews. A handful of tags do most of the work; the rest depend on the type of thing the page represents.

The core four. og:title, og:type, og:image and og:url are required by the specification. Title should be the page's headline, not the site name — around 60 characters before platforms truncate. og:url is the canonical address and should match your <link rel="canonical">, so shares of tracking-parameter variants all count as one page. og:type is website for most pages and article for posts and news; the other values are rarely needed but change which extra properties platforms accept.

Description and site name. og:description is the one or two sentence summary under the title; keep it under 200 characters. og:site_name shows as a small label above or below the card on many platforms and helps readers place the link. og:locale uses the language_TERRITORY form such as en_GB or fr_CA.

Images. This is where previews most often fail. The image URL must be absolute — scrapers do not resolve relative paths against your page. The recommended size is 1200 by 630 pixels, a 1.91:1 ratio; the generator warns if your dimensions are far from that, because platforms crop towards it. Including og:image:width and og:image:height lets Facebook render the card correctly on the very first share instead of after its crawler has downloaded the image. og:image:alt provides the accessible description that screen readers announce in feeds.

Article properties. When the type is article, the generator emits article:published_time and article:modified_time in ISO 8601, plus author, section and one article:tag per comma-separated tag. LinkedIn and Facebook use these for the date shown on the card and for content classification.

Twitter cards. X reads Open Graph tags as a fallback but needs twitter:card to choose the layout: summary_large_image for a wide image above the text, summary for a small square thumbnail beside it. The site and creator handles attribute the card. Repeating the title, description and image as twitter: tags is optional; it only matters if you want X to show different text from other platforms, or if a third-party tool insists on them.

Deploying and debugging. Tags must be in the initial HTML — scrapers do not run JavaScript, so a client-rendered app needs server-side or pre-rendered tags. After deploying, run the URL through the Facebook Sharing Debugger, LinkedIn Post Inspector or X Card Validator; these also clear the platform's cache of the old preview. The Meta Tag & Open Graph Checker on this site audits the finished page.

FAQ

Why does my preview show no image?

Almost always because the image URL is relative, blocked by robots.txt, behind authentication, or larger than the platform's limit (Facebook caps at 8 MB). Use an absolute https:// URL to a publicly reachable file under 1 MB. If you changed the image recently, re-scrape in the platform's debugger to clear its cache.

Do I need both og: and twitter: tags?

You need twitter:card for X to pick a layout; the rest of the Twitter tags are optional because X falls back to the Open Graph values. Leave "Repeat as twitter: tags" off unless you want X to display different text from other platforms.

What size should the image be?

1200 by 630 pixels is the safe choice: it is the 1.91:1 ratio Facebook and LinkedIn crop to and large enough for the wide X card. Keep essential content away from the edges, since some apps crop to a square for small previews.

Should og:url match the canonical link?

Yes. Platforms aggregate share counts and cached previews by og:url, so it should be the one canonical address without tracking parameters — the same value as <link rel="canonical">. A mismatch splits engagement between variants.

Where do the tags go in a React or Vue app?

In the server-rendered HTML. Link scrapers fetch the page and read the initial markup without executing JavaScript, so tags injected on the client are invisible to them. Use server-side rendering, static generation or a pre-render step for any page that will be shared.

See also: all SEO tools, Dev Utilities, Formatters & Validators, Data & Encoding, Security & Identifiers, Accessibility, AI.

Related tools