Skip to main content

Open Graph Tag Generator

API reference

Generate Open Graph meta tags for any og:type — website, article, book, profile, music, video, product or business — with each type's own properties, a matching html prefix attribute, optional Twitter Card tags and checks for length, URLs and dates. Copy or download the HTML.

Input

The kind of object the page represents. Type-specific fields appear below.

Shown as the headline of the link preview. Aim for under 60 characters.

One or two sentences; previews often cut off around 155 characters.

Absolute URL. 1200 × 630 px works for Facebook, LinkedIn and X.

language_TERRITORY, e.g. en_US, fr_FR, pt_BR.

Twitter / X card

X reads og:title, og:description and og:image, so only the card type and handle are added.

Output

Open Graph tags
 
<html> prefix attribute
 
Checks
Was this helpful?

More ways to use this tool

REST API

curl -X POST https://api.iotools.cloud/v1/tool/open-graph-tag-generator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "ogType": "website",
    "title": "Example Coffee Co.",
    "description": "Small-batch coffee roasted every Monday and ship…",
    "url": "https://example.com/",
    "image": "https://example.com/og-image.jpg",
    "imageAlt": "Bags of freshly roasted coffee beans",
    "imageWidth": "1200",
    "imageHeight": "630",
    "siteName": "Example Coffee Co.",
    "locale": "en_US",
    "includeTwitter": "true",
    "twitterSite": "@examplecoffee"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `open-graph-tag-generator` tool (Open Graph Tag Generator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

Embed widget

<iframe
  src="https://iotools.cloud/embed/open-graph-tag-generator/"
  width="100%" height="520" frameborder="0" scrolling="no" loading="lazy"
  title="Open Graph Tag Generator — iotools.cloud"
  sandbox="allow-scripts allow-forms allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox"
  allow="clipboard-write"
  style="width:100%;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden"></iframe>
<script src="https://iotools.cloud/embed.js" async></script>

Drop this into your own page — free, no key required, just a link back.

Cost per API/MCP callFrom 5 credits
Need more credits?View pricing

Also available with

Guides

Open Graph tags are the <meta property="og:…"> lines that control how a link looks when it is shared on Facebook, LinkedIn, Slack, Discord, WhatsApp, iMessage or X. Most generators stop at title, description and image. This one supports all 14 standard og:types and adds each type's own properties: publish dates and authors for articles, ISBNs for books, durations and track numbers for music, cast and crew for video, prices for products, and an address for businesses.

How to use it

  1. Pick an og:type. Use website for home and landing pages and article for blog posts and news. The type-specific fields appear below the common ones.
  2. Fill in the basics: title, description, canonical URL and image. Give the image width, height and alt text if you can.
  3. Add the type-specific details. Fields that take several values (authors, tags, songs, actors) accept one per line or a comma-separated list. Each value becomes its own tag, as the spec requires.
  4. Read the Checks list. It flags titles that will be cut off, a missing description or image, relative URLs, malformed dates, en-US written where en_US is expected, and non-numeric durations or prices.
  5. Copy the tags into your page's <head>. Optionally add the generated prefix attribute to your <html> element.

What's different here

  • Type-aware fields. article:published_time, book:isbn, music:album:track, video:actor:role, product:price:amount, business:contact_data:* and the rest are emitted in the order the spec lists them, with blank fields skipped.
  • A matching prefix. The <html prefix="…"> value lists only the namespaces your tags actually use (og, plus article, music, product and so on).
  • Lean Twitter Card tags. X falls back to og:title, og:description and og:image, so the generator adds only twitter:card, your @handle and the image alt text, without duplicating every value.

Image size

Use a 1200 × 630 px image (1.91:1) for large previews. Square artwork such as album covers works too, but some platforms crop it. Always use an absolute https:// URL. Platforms fetch the image from their own servers, so a relative path never loads.

Testing your tags

Platforms cache previews, so after publishing, check the live page with the Open Graph Checker, or paste your tags into the Open Graph & Twitter Card Preview to see the card before you deploy. For search-engine tags such as the description, robots and canonical link, use the HTML Meta Tag Generator. To create the share image itself, try the Open Graph Image Generator.

Privacy

The tags are generated in your browser. Nothing you type is uploaded or stored.

og tagsog:typeog:imagefacebook meta tagslinkedin previewsocial share tagsogparticle:published_timetwitter card

Love the tools? Lose the ads.

One payment clears every ad from your account, for good. No subscription, no tracking.