hackerdb

Home / Free tools / Open Graph and Twitter card generator

Open Graph and Twitter card tag generator with preview

Fill in the page details and copy a complete block of Open Graph and Twitter card meta tags, with a live preview and checks for the mistakes that break link previews.

How to use it

  1. Fill in the page facts. Use the page title, a one-sentence description and the canonical URL.
  2. Add an absolute https image. About 1200 by 630 pixels; add alt text.
  3. Copy the tags into your head. Paste them inside the page head element.
  4. Refresh the cache. Platforms cache previews; use their sharing debuggers after edits.

Why link previews break

When someone shares your URL in a chat or a feed, the app fetches the page and reads og:title, og:description and og:image. Most failures have a dull cause: the image path is relative, the image is served over http, the image is hosted behind a login or bot challenge, or the tags are injected by JavaScript after the page loads, which most preview fetchers do not run.

Image rules of thumb

Do Twitter card tags still matter?

Most platforms fall back to Open Graph if card tags are missing, but declaring twitter:card gives you control over the large-image layout. The generator outputs both. Paired with a clear title from the title and description checker, you cover search and social previews from one set of text.

Worked example

This is what the tool produces for the sample input, so you can see the result without running it.

Input

A five-step guide with photos.

Result

No usable image URL
bikes.example
How to fix a flat tyre
A five-step guide with photos.

Output

<meta property="og:type" content="article">
<meta property="og:site_name" content="Acme Bikes">
<meta property="og:title" content="How to fix a flat tyre">
<meta property="og:description" content="A five-step guide with photos.">
<meta property="og:url" content="http://bikes.example/guides/flat">
<meta property="og:image" content="/img/flat.jpg">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="How to fix a flat tyre">
<meta name="twitter:description" content="A five-step guide with photos.">
<meta name="twitter:image" content="/img/flat.jpg">

Frequently asked questions

Do I need both og: and twitter: tags?

Many platforms accept Open Graph alone, but twitter:card selects the large-image layout, so including both is safest.

Why does my old preview still show?

Platforms cache previews. Use each platform's sharing debugger to force a refresh.

What size should the image be?

About 1200 by 630 pixels in PNG or JPEG, hosted on https.

Does Open Graph affect search ranking?

Not directly. It controls link previews on social and chat platforms.

More free tools

All free tools