Open Graph Image: Size, Tags and Copy-Paste Example
November 11, 2026 · 11 min read
Open Graph Image: Size, Tags, and Examples for Link Previews
An open graph image is the picture a link card shows when someone shares your URL on Facebook, LinkedIn, X or a chat app. You set it with an og:image meta tag in the page head. Make it 1200 x 630 pixels, use an absolute HTTPS URL, add width, height and alt tags, then test it before you post.
What Is an Open Graph Image?
The Open Graph protocol defines og:image as an image URL that should represent your page. It's one of four properties the spec marks as required, next to the title, type and URL. Our Open Graph protocol guide covers the rest of that tag set, so this post sticks to the image.
The image never appears inside your article. It lives in a <meta> tag that crawlers read when a link gets pasted somewhere. That's different from a Markdown image, which renders in the page body for readers. If that's what you're after, see our guide to adding images in Markdown.
Here's the shortest valid version:
<meta property="og:image" content="https://example.com/og/launch-post.png" />
A crawler that fetches the page reads this tag, downloads the file and crops it into the card for that platform.
What Is the Recommended Open Graph Image Size?
Use 1200 x 630 pixels, an aspect ratio of about 1.91:1. That size meets Meta's high-resolution advice and clears LinkedIn's 1200 x 627 minimum. The protocol itself sets no size at all, so these numbers come from each platform's own documentation.
| Platform | Recommended | Minimum | Max file size | Source |
|---|---|---|---|---|
| Facebook and other Meta surfaces | At least 1200 x 630, ratio 1.91:1 | 200 x 200 (600 x 315 for the large card) | 8 MB | Meta image guide |
| At least 1200 x 627, ratio 1.91:1 | 1200 x 627 | 5 MB | LinkedIn help | |
| X | A wide image such as 1200 x 630 for the large card | Not stated in current docs | Under 5 MB in X's older card docs | X's card docs (now offline) |
A few details from those pages matter in practice. Meta says an image smaller than 600 x 315 still shows, but at a much smaller size. LinkedIn's help page notes that images under 401 pixels wide display as a thumbnail. X has moved its developer docs, and its old card pages now redirect to a general overview. Treat the X row as a starting point and check a real post.
We prefer one 1200 x 630 file for every network. Per-network variants add work, and the 1.91:1 shape already matches what Meta and LinkedIn ask for.
Designing the Card Image to Survive Cropping and Compression
Platforms don't always show the full frame. Chat apps and some feeds crop to their own card shape, and small screens shrink the image to a strip. Our advice, which isn't a spec: keep the headline and logo in the middle and leave a clear margin on every edge.
Text size matters more than you'd expect. A 1200-pixel card shrinks to a fraction of that width in a phone feed, so small subtitle text turns unreadable. Use one short headline in a heavy weight, and check it at phone size before you publish.
For formats, JPG and PNG are the safe choice. Meta's image guide doesn't list accepted formats, and X's older card reference ruled out SVG. If your artwork starts as an SVG, export it to PNG first.
Keep the file small, too. LinkedIn caps it at 5 MB and Meta at 8 MB, and a flat graphic with a few colors usually exports far below either limit as a PNG. A photo compresses better as a JPG.
The og:image Structured Properties: url, secure_url, type, width, height and alt
The spec gives og:image six optional sub-properties. They go directly after the og:image tag they describe.
| Property | What the spec says it holds | Do you need it? |
|---|---|---|
og:image:url | The same value as og:image | No, it's a duplicate |
og:image:secure_url | An alternate URL for pages that require HTTPS | Only if og:image uses plain HTTP |
og:image:type | The image's MIME type, such as image/png | Helpful, cheap to add |
og:image:width | Width in pixels | Yes |
og:image:height | Height in pixels | Yes |
og:image:alt | A description of what's in the image, not a caption | Yes |
Width and height do real work on Facebook. Meta's crawler has to see an image once before it can render it, so the first share of a new URL can appear without a picture. Supplying both dimensions lets the crawler render the image right away.
The spec is direct about alt text: if a page specifies an og:image, it should specify og:image:alt. Describe the picture itself ("Bar chart showing build time falling from 14 to 5 minutes"), not the article's topic. Our HTML image tag guide has more on writing alt text for in-page images.
You can list more than one image by repeating og:image. The spec says the first tag from the top wins during conflicts. Sub-properties attach to the most recent og:image above them, so a stray og:image:width placed after a second image describes that second one.
Open Graph Image Example: A Complete Head Block to Copy
This example covers Facebook, LinkedIn and X in one go. Swap in your own URLs and text.
<meta property="og:title" content="How We Cut Build Times" />
<meta property="og:url" content="https://example.com/blog/builds" />
<meta property="og:image" content="https://example.com/og/builds-v1.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="Bar chart of CI build time dropping from 14 to 5 minutes" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image:alt" content="Bar chart of CI build time dropping from 14 to 5 minutes" />
The first two lines are context so the block is realistic. Lines three to seven describe the image: an absolute HTTPS URL, its MIME type, its exact pixel size and its alt text. The twitter:card line asks X for the large image layout. Note that it uses name rather than property. Our meta tags guide covers the description, robots and viewport tags that share the head.
There's no twitter:image line on purpose. X's older card reference listed og:image as the fallback for twitter:image, and og:image:alt for twitter:image:alt. We still repeat the alt line, because it costs nothing if that fallback has changed. Add twitter:image only when you want X to show a different picture.
The -v1 in the file name is deliberate, too. It gives you a clean way to replace the image later, as the troubleshooting section explains.
Our meta tag generator writes the og:image, twitter:image and twitter:card tags from an image URL you type in. It runs in your browser and doesn't fetch or check the image, so add the width, height and alt lines yourself.
Open Graph Image Generator Options: Front Matter, Build-Time Files and Code Snapshots
Most sites don't hand-write these tags per page. The template reads a field from each post and prints the tag for you.
In Docusaurus, the blog plugin reads an image field from each post's front matter. A post might start like this:
---
title: How We Cut Build Times
image: /img/og/builds-v1.png
---
At build time, Docusaurus turns that field into the og:image and twitter:image tags in the head. It also prefixes a site-relative path with your site URL, so the tag ends up absolute. Our front matter guide covers the YAML syntax, and our Docusaurus Markdown post covers the rest of its features.
One limitation to know: our editor's preview doesn't render front matter or show anything from the page head. You can write the post body there, but check the built page for the image tags.
Next.js goes a step further with a build-time image generator. Its App Router docs describe an opengraph-image file convention. You drop a jpg, jpeg, png or gif file into a route folder, or add an opengraph-image.tsx file that draws one in code. Next.js then writes the og:image tags for that route, including type, width and height, plus og:image:alt when you supply alt text.
For developer posts, a code snippet makes a strong card. Our code to image tool turns a snippet into a PNG or SVG with syntax colors, a theme and a window frame. It offers fixed widths up to 1200 pixels but no 1200 x 630 card preset, and it doesn't host the file. Place the PNG on a 1200 x 630 canvas in any image editor and upload it to your own site.
Open Graph Image Checker: Preview the Card Before You Post
A checker fetches your public URL the way a crawler would and shows the card it builds. Run one before every launch, because what your browser shows and what a crawler receives can differ.
- Meta's Sharing Debugger previews how your content will look when shared to Facebook and reports problems with your tags. You need to log in to Facebook to use it. Running a URL through it also makes Meta's crawler fetch the page ahead of time, which Meta lists as a fix for the missing-picture first share.
- LinkedIn Post Inspector takes a URL and shows how LinkedIn reads the page, including which image it picked.
- A private channel in Slack or Discord gives you an honest open graph preview. Paste the link where only you can see it and look at the unfurled card.
For a raw check, request the page from the command line and look for the image tags:
curl -s https://example.com/blog/builds | grep 'og:image'
If this prints nothing, the tags aren't in the HTML the server sends, and no crawler will find them. Full validation of the other og: tags belongs in our Open Graph protocol guide.
Why Is My Open Graph Image Not Showing?
Work through these in order. The first three are the quickest to check and the most common culprits in our experience.
- The URL isn't absolute. A path like
/og/builds.pngmeans nothing to a crawler reading the tag on its own. Write the fullhttps://address. - The crawler can't reach the file. LinkedIn's help page says a valid image may still fail to appear. Your site may be blocking its crawler, or the image may sit in a protected directory. Check
robots.txt, login walls and hotlink protection on your image host. - The file is too small. Meta's minimum is 200 x 200 pixels, and LinkedIn wants at least 1200 x 627. Anything under 401 pixels wide shows as a small thumbnail on LinkedIn.
- The tags are added by JavaScript. Link crawlers typically read the HTML your server sends. If the curl check above finds nothing, render the tags on the server.
- The old image is cached. Meta caches images by URL. Its guide says to publish a new image at a new URL rather than overwrite the old file. Rename
builds-v1.pngtobuilds-v2.png, update the tag, and run the Sharing Debugger again.
That last fix applies to new shares. Meta notes that updating the image won't automatically refresh the preview on old shares, and it asks you not to delete old images those posts still reference.
og:image Questions People Ask
A good open graph image is a 1200 x 630 PNG or JPG at an absolute HTTPS URL, with width, height and alt tags beside it. Keep the key content away from the edges. Test it in the Sharing Debugger, give each new version a new file name, and your link cards stay sharp. When you're ready to write the tags, our meta tag generator builds them in your browser.