When someone shares a link on Facebook, LinkedIn, Slack, or Twitter/X, a preview card appears with a title, description, and image. That card is not generated automatically from your page content. It's driven by Open Graph meta tags in your page's <head>. Without them, platforms fall back to guessing — pulling the page title from the <title> tag, picking a random image, and generating a description that may have nothing to do with what you actually want to say. With them, you control exactly what every share shows.
The OG Tag Generator on DevToolShack takes your title, description, URL, and image and outputs a complete set of Open Graph and Twitter Card meta tags ready to paste into your <head>. Here is what each tag does and how to get them right.
The Essential Open Graph Tags
The Open Graph protocol was introduced by Facebook and is now supported by virtually every platform that renders link previews. A minimal, correct implementation needs four tags:
<meta property="og:title" content="Your Page Title Here">
<meta property="og:description" content="A 2–3 sentence description of the page content.">
<meta property="og:image" content="https://example.com/images/og-image.jpg">
<meta property="og:url" content="https://example.com/this-page/">
These four cover the title, description, thumbnail, and canonical URL of the shared content. Adding the og:type tag (usually website or article) is also recommended:
<meta property="og:type" content="article">
Twitter Card Tags
Twitter/X uses its own card system, though it falls back to Open Graph tags when Twitter-specific tags are absent. Adding dedicated Twitter tags gives you control over the card style:
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Your Page Title Here">
<meta name="twitter:description" content="A 2–3 sentence description.">
<meta name="twitter:image" content="https://example.com/images/og-image.jpg">
The twitter:card value of summary_large_image produces the large image card format that fills the tweet's preview area. summary produces a smaller thumbnail alongside the text — appropriate for profile pages or pages where the image is decorative rather than content-carrying.
Getting the Image Right
The image is the most impactful element of a social share card and the most commonly misconfigured. A few rules that prevent common failures:
Use an absolute URL. The og:image value must be a full URL including the protocol and domain — https://example.com/image.jpg, not /image.jpg. Crawlers visit your page from their own servers and cannot resolve relative URLs.
Minimum size: 600×315px. Images smaller than this may not display at all on some platforms. Facebook recommends 1200×630px as the standard. At that size, the image looks crisp on retina displays and resizes cleanly on mobile.
1200×630 is the sweet spot. This is a 1.91:1 aspect ratio. For the math behind that ratio and how it relates to other common web image dimensions, see the post on aspect ratios in web design.
Keep file size under 8MB. Facebook's crawler will skip images over 8MB. For most purposes, a high-quality JPEG at 1200×630 should be well under 500KB.
Include og:image:width and og:image:height. These optional tags tell crawlers the image dimensions upfront, preventing layout shift in the preview card before the image fully loads:
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
OG Tags vs Standard Meta Tags
Open Graph tags are distinct from standard HTML meta tags. The <title> tag and <meta name="description"> control what appears in search engine results. Open Graph tags control what appears in social share previews. The two are different contexts and should be treated separately.
In practice, the OG title and description often match the SEO title and meta description closely — but not always. A page optimized for a long-tail search keyword might have a verbose SEO title that reads poorly in a social card. The OG title can be shorter and more share-friendly while the SEO title targets the search query. The post on meta tag generators and SEO covers the search-facing tags in detail; this post is specifically about the social-sharing layer.
You can also preview exactly how your OG tags will render before sharing using the Open Graph Preview Tool at TopWebPositions — plus access more than 20 free SEO tools in one place.
Article-Specific Open Graph Tags
When og:type is set to article, additional tags become available for specifying publication metadata:
<meta property="article:published_time" content="2026-10-21T09:00:00Z">
<meta property="article:modified_time" content="2026-10-21T09:00:00Z">
<meta property="article:author" content="https://example.com/about">
<meta property="article:section" content="Web Development">
<meta property="article:tag" content="open graph">
These tags don't affect the visual appearance of social share cards on most platforms, but they are read by some aggregators, news readers, and Google's structured data processor. Including them is low cost and can improve how your content is categorized and indexed. The broader context of how these tags relate to the complete meta tag picture is covered in the complete guide to Open Graph tags.
Using the OG Tag Generator
The OG Tag Generator on DevToolShack takes a form-based approach: fill in the title, description, URL, and image URL, choose the content type, and it outputs the complete tag set ready to copy into your <head>. This is faster than writing them from memory and eliminates typos in the property names. For the full set of standard HTML meta tags used for SEO, the Meta Tag Generator covers those alongside the OG tags in a single form.