Generate Open Graph Tags in Seconds
Fill in your page details above and get the exact Open Graph meta tags you need to control how your link looks when someone shares it on Facebook, LinkedIn, Slack, or iMessage. No coding required, no sign-up, and nothing is sent to any server.
How to Use the Open Graph Generator
- Enter your page title, description, and URL in the fields above.
- Add your image URL (ideally 1200 × 630 px for best results on all platforms).
- Choose a type -
websitefor most pages,articlefor blog posts,productfor shop items. - Hit Generate. The tool outputs a ready-to-paste HTML block with both OG and Twitter Card tags.
- Copy the snippet and paste it inside the
<head>of your page.
What an Open Graph Block Looks Like
Here is a concrete example. You enter these details:
- Title: Best Running Shoes of 2025
- Description: We tested 40 pairs so you don't have to. Here are the top picks for every budget.
- URL: https://example.com/best-running-shoes
- Image: https://example.com/images/running-shoes-og.jpg
- Type: article
The generator produces this snippet - copy it straight into your <head>:
<!-- Open Graph -->
<meta property='og:title' content='Best Running Shoes of 2025' />
<meta property='og:description' content='We tested 40 pairs so you don't have to. Here are the top picks for every budget.' />
<meta property='og:url' content='https://example.com/best-running-shoes' />
<meta property='og:image' content='https://example.com/images/running-shoes-og.jpg' />
<meta property='og:type' content='article' />
<meta property='og:site_name' content='Example Site' />
<!-- Twitter Card -->
<meta name='twitter:card' content='summary_large_image' />
<meta name='twitter:title' content='Best Running Shoes of 2025' />
<meta name='twitter:description' content='We tested 40 pairs so you don't have to.' />
<meta name='twitter:image' content='https://example.com/images/running-shoes-og.jpg' />
Share that URL on any major platform and they will pull in the title, description, and a large preview image automatically.
Quick Reference: The Key Open Graph Tags
| Tag | What it controls | Tip |
|---|---|---|
og:title |
The bold headline in the link preview | Keep under 60 characters so it never gets cut off |
og:description |
The short summary beneath the title | Aim for 1-2 sentences, around 100-150 characters |
og:image |
The preview image shown in the card | 1200 × 630 px JPEG or PNG; keep it under 1 MB for fast loading |
og:url |
The canonical URL of the page | Use the full URL including https:// |
og:type |
The content category (website, article, product) |
Use website when unsure; platforms treat untyped content as website anyway |
twitter:card |
The X/Twitter preview layout | summary_large_image shows a big image; summary shows a thumbnail |
Paste these tags inside the <head> … </head> section of your HTML - before the closing </head> tag. If you use a CMS like WordPress, a plugin such as Yoast SEO or Rank Math will insert them for you, but you still control the values.
How to Add OG Tags in Code
If you manage your own templates, here is how to output the tags dynamically in two popular languages.
Python (Flask / Jinja2)
# In your Jinja2 template (e.g. base.html)
# Pass og_data dict from your Flask view
<meta property="og:title" content="{{ og_data.title }}">
<meta property="og:description" content="{{ og_data.description }}">
<meta property="og:image" content="{{ og_data.image }}">
<meta property="og:url" content="{{ request.url }}">
<meta property="og:type" content="{{ og_data.type | default('website') }}">
JavaScript (Next.js 14 App Router)
// app/blog/[slug]/page.js
export async function generateMetadata({ params }) {
const post = await getPost(params.slug);
return {
openGraph: {
title: post.title,
description: post.excerpt,
url: `https://example.com/blog/${params.slug}`,
images: [{ url: post.ogImage, width: 1200, height: 630 }],
type: 'article',
},
twitter: {
card: 'summary_large_image',
title: post.title,
description: post.excerpt,
images: [post.ogImage],
},
};
}
Next.js automatically renders these as <meta> tags in the <head> at build or request time.
How the Generator Works
Everything runs in your browser - no page data is sent to any server. When you click Generate, the tool takes your form inputs, wraps each value in the correct <meta> tag syntax defined by the Open Graph Protocol (ogp.me), and outputs the complete snippet. Twitter Card tags follow the separate X/Twitter Cards markup spec.
Social platforms like Facebook and LinkedIn send a small web crawler to your page URL when someone shares a link. That crawler reads the OG tags in your <head> and uses them to build the preview card - so the tags need to be in the server-rendered HTML, not injected by JavaScript after page load.
When to Use OG Tags - and When They Won't Help
Use Open Graph tags on: any public page you want to look good when shared - blog posts, product pages, landing pages, portfolio pieces, news articles.
You don't need them on: pages behind a login (crawlers can't reach them), internal admin dashboards, or pages blocked by robots.txt or a noindex directive.
OG tags vs. plain meta tags: the standard <meta name='description'> tag controls what search engines show. OG tags control what social platforms show. Both matter and they often carry different copy - your SEO description and your social teaser can be different lengths and tones.
Privacy: Your Data Stays in Your Browser
This tool runs entirely on your device. The page titles, descriptions, and image URLs you enter are never uploaded or stored anywhere. Close the tab and they are gone.
Good-looking social previews take about two minutes to set up - use the generator above, copy the output, and paste it into your page <head>.