How to use the open graph tag generator
- Enter your page title, description, URL and image. These are the core properties every open graph generator needs.
- Select the object type: website, article, product or video. The author, section, price and duration fields are only used with the matching type.
- Fill in the optional Twitter Card settings if you want consistent previews on X (formerly Twitter).
- Copy the generated
<meta>tags and paste them into the<head>of your HTML document.
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:
| Type | Extra Properties | Use Case |
|---|---|---|
website | None beyond the basics | Home pages, landing pages |
article | article:author, article:section | Blog posts, news stories |
product | product:price:amount, product:price:currency | E-commerce product pages |
video.other | video: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:imageandog: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.
Worked examples
| Example | Input | Result |
|---|---|---|
| Basic website | Title (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 article | Title (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 product | Title (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.