Xerobit

Open Graph Tag Generator for Social Sharing Previews

This open graph generator creates the HTML meta tags needed to control how your pages appear when shared on social networks. Fill in the fields, pick an object type, and copy the ready-to-paste markup. It runs entirely in your browser so nothing is uploaded anywhere.

Recommended under 200 characters.

Generated Meta Tags

<meta property="og:title" content="My Page Title" />
<meta property="og:type" content="website" />
<meta property="og:description" content="A short summary of the page content." />
<meta property="og:locale" content="en_US" />
<meta name="twitter:card" content="summary_large_image" />

The Open Graph protocol requires og:title, og:type, og:image and og:url. Still missing: og:image, og:url.

How to use the open graph tag generator

  1. Enter your page title, description, URL and image. These are the core properties every open graph generator needs.
  2. Select the object type: website, article, product or video. The author, section, price and duration fields are only used with the matching type.
  3. Fill in the optional Twitter Card settings if you want consistent previews on X (formerly Twitter).
  4. Copy the generated <meta> tags and paste them into the <head> of your HTML document.

What Are Open Graph Tags?

The Open Graph protocol was created by Facebook to let web pages become rich objects in a social graph. When you share a link on platforms like Facebook, LinkedIn, Slack or Discord, those services read specific <meta> tags from the page's HTML to build a preview card. An open graph tags generator automates writing these tags correctly.

The four required properties are og:title, og:type, og:image and og:url. Without them, social networks fall back to scraping whatever text and images they find, which often produces broken or misleading previews. A dedicated og tag generator escapes every value properly and tells you which of the four required properties you have not filled in yet.

Object Types and Their Extra Properties

The og:type property tells crawlers what kind of content the page holds. The default is website, which only needs the base properties. Other types unlock additional metadata:

TypeExtra PropertiesUse Case
websiteNone beyond the basicsHome pages, landing pages
articlearticle:author, article:sectionBlog posts, news stories
productproduct:price:amount, product:price:currencyE-commerce product pages
video.othervideo:duration (whole seconds, at least 1)Video hosting pages

This open graph protocol generator includes the most commonly used extra properties for each type. Other properties from ogp.me, such as article:published_time, og:video or og:image:alt, can be added by hand after copying the tags. Note that article:author should be the URL of an author profile page.

Twitter Cards Alongside Open Graph

Twitter (now X) uses its own set of meta tags called Twitter Cards. X reads og:title, og:description and og:image when no Twitter equivalents exist, but it needs twitter:card to choose the card layout. The two main card types are summary (a small square image) and summary_large_image (a wide rectangular image).

A good practice is to include both sets of tags. This tool acts as a combined open graph generator and Twitter Card builder, outputting everything in one block. The twitter:site property holds your account handle, and the tool adds the @ if you leave it out.

Common Mistakes to Avoid

Even when using an og tag generator, certain errors can prevent your previews from rendering:

  • Missing image dimensions: Social platforms prefer images that are at least 1200 by 630 pixels. Smaller images may be cropped or ignored.
  • Unescaped characters: Quotes, ampersands and angle brackets inside attribute values must be converted to HTML entities. This tool handles escaping automatically.
  • Relative URLs: Always use absolute URLs for og:image and og:url. Crawlers cannot resolve relative paths.
  • Title length: Keep titles near 60 characters and descriptions under about 200 characters, since platforms truncate differently. The tool prints a note when you go over.

You can use a character counter to verify your text lengths before generating the tags.

Where to Place the Generated Tags

Paste the output directly inside the <head> element of your HTML document, ideally near other meta tags like the charset declaration and viewport settings. If you use a framework like Next.js, Nuxt or Astro, place the tags in the layout component or use the framework's built-in head management API.

After publishing, test your page using the Facebook Sharing Debugger or the LinkedIn Post Inspector. These tools force the platform to re-scrape your page and show what preview users will see. X has retired its standalone card validator, so check X previews by composing a post. Because this open graph tags generator runs locally in your browser, you can iterate quickly without deploying changes just to check syntax.

Worked examples

ExampleInputResult
Basic websiteTitle (og:title): Xerobit Free Tools; Description (og:description): Free browser-based developer utilities.; Canonical URL (og:url): https://xerobit.dev; Image URL (og:image): https://xerobit.dev/og.png; Object Type (og:type): website; Site Name (og:site_name): Xerobit; Locale (og:locale): en_US; Twitter Card Type: summary_large_image; Twitter @site: @xerobit<meta property="og:title" content="Xerobit Free Tools" /> / <meta property="og:type" content="website" /> / <meta property="og:url" content="https://xerobit.dev" /> / <meta property="og:image" content="https://xerobit.dev/og.png" /> / <meta property="og:description" content="Free browser-based developer utilities." /> / <meta property="og:site_name" content="Xerobit" /> / <meta property="og:locale" content="en_US" /> / <meta name="twitter:card" content="summary_large_image" /> / <meta name="twitter:site" content="@xerobit" />
Blog articleTitle (og:title): How to Use Open Graph Tags; Description (og:description): A guide to controlling social media previews with OG tags.; Canonical URL (og:url): https://example.com/blog/og-tags; Image URL (og:image): https://example.com/img/og-guide.jpg; Object Type (og:type): article; Site Name (og:site_name): Dev Blog; Locale (og:locale): en_US; Twitter Card Type: summary_large_image; Article Author: Jane Doe; Article Section: Web Development<meta property="og:title" content="How to Use Open Graph Tags" /> / <meta property="og:type" content="article" /> / <meta property="og:url" content="https://example.com/blog/og-tags" /> / <meta property="og:image" content="https://example.com/img/og-guide.jpg" /> / <meta property="og:description" content="A guide to controlling social media previews with OG tags." /> / <meta property="og:site_name" content="Dev Blog" /> / <meta property="og:locale" content="en_US" /> / <meta property="article:author" content="Jane Doe" /> / <meta property="article:section" content="Web Development" /> / <meta name="twitter:card" content="summary_large_image" />
E-commerce productTitle (og:title): Wireless Keyboard; Description (og:description): Ergonomic wireless keyboard with backlight.; Canonical URL (og:url): https://shop.example.com/keyboard; Image URL (og:image): https://shop.example.com/img/kb.jpg; Object Type (og:type): product; Site Name (og:site_name): Tech Shop; Locale (og:locale): en_US; Twitter Card Type: summary; Product Price Amount: 49.99; Product Currency: USD<meta property="og:title" content="Wireless Keyboard" /> / <meta property="og:type" content="product" /> / <meta property="og:url" content="https://shop.example.com/keyboard" /> / <meta property="og:image" content="https://shop.example.com/img/kb.jpg" /> / <meta property="og:description" content="Ergonomic wireless keyboard with backlight." /> / <meta property="og:site_name" content="Tech Shop" /> / <meta property="og:locale" content="en_US" /> / <meta property="product:price:amount" content="49.99" /> / <meta property="product:price:currency" content="USD" /> / <meta name="twitter:card" content="summary" />

FAQ

What is an open graph generator?

An open graph generator is a tool that creates the HTML meta tags defined by the Open Graph protocol. These tags control how your page looks when shared on social media platforms.

Which og:type should I choose?

Use 'website' for general pages, 'article' for blog posts or news, 'product' for e-commerce items, and 'video.other' for video pages. The type determines which extra properties are valid.

Do I need both Open Graph and Twitter Card tags?

It is recommended. X falls back to Open Graph tags for the title, description and image, but it looks for its own twitter:card tag to decide between the summary and large image layouts, which is why this tool always writes it.

What size should my og:image be?

1200 by 630 pixels is the commonly recommended size. That 1.91:1 ratio displays well on Facebook, LinkedIn and X without unwanted cropping.

Why are my social previews not updating?

Social networks cache previews aggressively. After changing your tags, use the platform's debugger tool to force a fresh scrape of your page.

Does this open graph protocol generator upload my data?

No. All processing happens in your browser. Your page details never leave your device.

Can I use this og tag generator for any website?

Yes. The output is standard HTML meta markup that works on any site, whether it is static HTML, WordPress, Shopify or a custom application.