Guide
OG Image Best Practices: Size, Safe Area, File Size and URLs That Hold on Every Platform
The rules for an Open Graph image that works everywhere: 1200 x 630, a safe area for the small card, file size and format limits per platform, absolute HTTPS URLs, alt text, one card per page type and how to change a card without it sticking.
What one image has to survive
An Open Graph image is drawn by many programs at many sizes, and you do not control any of them. One platform shows it as a wide card, another cuts it to a 120 pixel square, a chat app scales it to a bubble, and a few of them refuse it for a reason you will not be told. The rules below are the ones that hold across all of those. Each says why, and links the guide that shows the evidence for that platform.
Two things set the approach. First, platforms publish different limits, and some publish none. Where a number comes from a platform's own documentation, the linked guide says so and names the source. Where a platform documents nothing, this guide says that and gives the safest choice instead of a made-up rule. Second, the design rules (safe area, text size, contrast) are not platform facts. They follow from the sizes the platforms draw, and they are advice, labelled as such.
If you only have a minute, the whole guide reduces to this head:
<meta property="og:url" content="https://your-site.com/pricing" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Pricing for teams of any size" />
<meta property="og:description" content="What each plan includes, in one table." />
<meta property="og:image" content="https://your-site.com/og/pricing-v2.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="The word Pricing beside three plan names on a dark background" />
<meta name="twitter:card" content="summary_large_image" />
A 1200 x 630 PNG or JPEG, well under 500 KB, at an absolute HTTPS URL that is specific to the page and changes whenever the picture changes, declared with its size, type and alt text, with twitter:card set to summary_large_image. The sections below take each part in turn.
properOG's checker scores a page out of 100 on these things: the image's presence (25), its dimensions (30), file size (15), title (10), description (7), the Twitter card tag (5), image format (5) and og:type (3). The bands are A from 85, B from 65, C from 45 and D below. The site audit applies the same ideas across a sitemap. Where a rule here is one properOG measures, the section says which check or finding reports it.
Size and ratio: export at 1200 x 630
The rule
Export the card at 1200 x 630 pixels, a ratio of about 1.91:1, and declare those numbers in og:image:width and og:image:height.
Why
- Facebook documents a 200 x 200 minimum and renders images under 600 x 315 as a small square. It recommends at least 1200 x 630 and a ratio as close to 1.91:1 as possible. See the Facebook guide.
- LinkedIn says images under 401 pixels wide display as a thumbnail and gives 1200 x 627 as its minimum for the share. See the LinkedIn guide.
- X asks for 2:1 on the large card, with a 300 x 157 minimum, and 1:1 on the small
summarycard. 1200 x 630 is not exactly 2:1, and the documentation does not say how X handles the difference, so the X guide says to keep what matters away from the top and bottom edges. - WhatsApp documents an image at least 300 pixels wide with an aspect ratio of 4:1 or less. It names no larger recommendation. See the WhatsApp guide.
- Slack and Messages document no size or ratio. 1200 x 630 is simply the size the others ask for, so one file serves them too. See the Slack guide and the Messages guide.
A larger file does not help. The checker gives full marks to an image of at least 1200 x 630 and at most 2400 x 1260 whose ratio is within 0.1 of 1.91. At that size with a ratio that is off, the dimensions check gives 25 of 30. A correct ratio at a smaller size, down to 600 x 315, gives 20, and a wrong ratio at that smaller size 15. The tables for every platform are in OG image sizes.
Detected by
The checker's Dimensions check and its platform fit rows. The audit reports image_undersized (info) for a card under 1200 pixels wide. That threshold is properOG's. It is stricter than Facebook's small-card line, so a card can trigger the finding and still render large.
Safe area: design for the small card and the thumbnail
The rule
Treat the centre of the image as the only part that is certain to be seen. Put the headline, the logo and the one thing that identifies the page there, large and short, and keep a margin of roughly a tenth of the width on every side empty of anything you would mind losing.
Why
- The small X card crops to a square. The documentation the X guide read says the
summarycard's image "will be cropped to a square on all platforms". The checker's X summary row says the same in its own words: centre-crop, legible at 120 x 120. - Thumbnails exist on every platform. A card below a platform's large-card threshold, or a chat client that shows a small preview, draws a square or a strip in place of the wide image.
- Messaging apps scale the card down hard. properOG models a WhatsApp or Messages preview at about 300 x 157, a fourfold reduction of a 1200 pixel card, and warns that body text may be unreadable. That figure is properOG's estimate of a phone chat bubble, not a size either platform documents.
- Apple advises against text in the image. Apple's guidance for Messages says images "should not include text", because the same image is shown "all the way from Apple Watch to iPad Pro" and text does not scale across that range. The Messages guide quotes it. A headline card is the usual shape of a generated OG image, so decide deliberately: the headline also sits in the title line under the picture.
What to do
- One idea per card. A short headline, or a logo and a product shot, not a paragraph.
- Type that is still readable when you view the file at 300 pixels wide. Open the image at that size before you ship it.
- Nothing essential in the outer margin, or in a thin band along the top and bottom.
- Do not rely on a card's corners. Platforms round them, and one draws a coloured bar beside it.
The platform previews in the checker show approximations of these crops. They are models, not the platforms' renderers, and each guide says where to see the real thing.
Text size and contrast
No platform publishes a minimum type size or contrast ratio for an OG image, so none of this is documented fact. It follows from the sizes above.
- Headline height. At a quarter scale, 300 pixels wide, a headline set at 60 pixels in the 1200 pixel file is 15 pixels tall. That is a working floor, chosen here as advice and not a platform figure. Smaller type belongs in the page title and description, which every platform shows as text.
- Few words. A card of six words survives the reduction. A card of thirty does not, whatever its type size.
- Contrast between text and its background. Thin type on a photograph or a gradient loses its edges first when the image is scaled down and recompressed. Use a solid or near-solid area behind text, and a weight that is not light.
- Both colour schemes. Clients can draw a card on a dark or a light surface, and you cannot know which. A PNG with a transparent background, or edges close to white, can lose its outline on one of them. Give the image its own opaque background.
Look at the gallery for cards that do this well: a curated set, each with a note on what the card does.
File size and format
The rule
Ship a PNG or JPEG under 500 KB. A designed card with flat colour is often under 100 KB.
The limits platforms publish
| Platform | Documented limit | Guide |
|---|---|---|
| Under 600 KB, at least 300 px wide, 4:1 or flatter | ||
| Maximum 5 MB | ||
| X | Under 5 MB; JPG, PNG, WEBP, GIF; no SVG; first frame of a GIF | X |
Under 8 MB; og:image:type documented as JPEG, GIF or PNG | ||
| Messages | Icon, image and video together within 10 MB | Messages |
| Slack | No size or format limit documented | Slack |
Why 500 KB, when the limits are larger
The smallest documented limit that matters for a card is WhatsApp's 600 KB, and the others are a ceiling on what the crawler will download, not a target. A heavy file is also slower for every client, and a crawler that gives up after a few seconds sees no image. Facebook's documentation says its crawler has to read your content "within a few seconds". Under 500 KB meets WhatsApp's line with margin and costs nothing elsewhere.
Why PNG or JPEG
The checker scores format: WebP and AVIF earn full marks, PNG and JPEG earn partial marks, because they compress better. That is a statement about file size, not about whether a given platform can read the file. Facebook's documented og:image:type values are JPEG, GIF and PNG, WhatsApp lists no file types, and Apple lists none. X documents WebP but not AVIF. For a card that has to work everywhere, PNG or JPEG is the format nothing in the platform documentation contradicts, and a card that fails to load gives you a preview without a picture. Avoid SVG: X says it is not supported, and the checker warns that it may not render everywhere.
Detected by
The checker's File size check passes under 500 KB, warns up to 1 MB and fails above it. The audit reports image_oversized (warning) above 500 KB. The checker's Image format check is described above.
To measure a card the way a crawler receives it:
curl -s -o /dev/null -w '%{size_download} bytes, %{content_type}\n' \
https://your-site.com/og/pricing-v2.png
Absolute HTTPS URLs, in the served HTML
The rule
Every URL in a share tag is absolute, begins with https://, and appears in the HTML the server returns, not only after JavaScript runs.
Why
- The protocol asks for a URL. ogp.me describes
og:imageas "An image URL which should represent your object within the graph", and gives anog:image:secure_urlproperty for "an alternate url to use if the webpage requires HTTPS". A crawler has no page context to resolve a path against. - WhatsApp documents it. Its image URL must be absolute. A path such as
/og.pngis not one. See the WhatsApp guide. - Next.js enforces it. The Metadata API's own examples mark image fields "Must be an absolute URL". Setting
metadataBaselets you write a relative path in a field and have it composed into a full URL, and using a relative path with nometadataBaseis a build error, per the same page. Set it once at the root:
The Next.js guide covers the traps that follow.// app/layout.tsx export const metadata = { metadataBase: new URL("https://your-site.com"), }; - Crawlers do not run your scripts. Next.js says as much about metadata streaming: for bots that cannot execute JavaScript it names
facebookexternalhit, and it waits for the metadata before it starts the response, so the tags are in the head. A tag added by client-side code after load is not something to rely on. The WhatsApp documentation describes a crawl by HTTP GET and mark-up in the head, and says nothing about running scripts.
Keep the tags early in the document. Facebook says Open Graph properties after the first 1 MB of the page are cut off, and WhatsApp says the head holding them must appear within the first 300 KB. Put the meta tags at the top of the head, before inline scripts and styles.
The image must answer a bot
The URL has to return the image to a program with no cookies and no login: a 200, an image/* content type, no redirect to a sign-in page, and no hotlink rule that only allows your own domain. Check it:
curl -s -D - -o /dev/null https://your-site.com/og/pricing-v2.png
Detected by
The checker's "Image loads" check fails with the HTTP status when the image does not resolve. The audit reports image_broken (critical) for a declared card that does not load, image_missing (critical) for a page with no og:image, and image_unverified (warning) when the card could not be checked either way, as when a host refuses automated requests.
One card per page type, not one for the site
The rule
Give every template its own card, fed with that page's own data: its title, its product, its author, its number. Keep a site-wide fallback for pages that have nothing of their own, not as the default.
Why
A link preview is the only part of your page many people ever see. When every page shares one image, every shared link looks the same, whatever it points at. The audit calls this image_shared (warning): one image covering pages from more than one template. It is a warning and not an error because a brochure site with one page type may reasonably have one card.
The opposite mistake also exists. The audit's twitter_image_stale and twitter_image_shared findings catch a twitter:image that is one site-wide value over pages whose og:image differs, so X shows the wrong card while every other platform shows the right one. X reads twitter:image first and falls back to og:image, per the X guide, so the simplest arrangement is to declare og:image per page and leave twitter:image out.
How the card stays per page in a framework
Per-page cards are where frameworks bite. In Next.js, a segment that declares openGraph replaces the parent's object whole, because the metadata is merged shallowly and a repeated key is replaced. The documentation's own example shows a child page that sets openGraph.title and loses the parent's description. The same applies to the image. The Next.js guide reproduces five such traps with the audit finding that reports each. For content systems, see the guides for WordPress, Shopify, Webflow, Squarespace, Wix, Framer, Ghost and HubSpot.
Different formats for different pages
A product page, an article and a profile need different cards because they say different things: a product shot with a price, a headline with a date, a name with a role. Make a small set of templates, one per page type, and render each from the page's data. Do not hand-draw a card per URL. It will not survive the next redesign.
Alt text for the image
The rule
Add og:image:alt, and when you declare twitter:image, twitter:image:alt. Describe what the image shows. It is not a caption.
Why
ogp.me defines it as "A description of what is in the image (not a caption)", and adds: "If the page specifies an og:image it should specify og:image:alt." X's markup reference, as the X guide reads it, maps twitter:image:alt to og:image:alt and gives a limit of 420 characters for the Twitter tag. A card that is mostly text, such as a headline on a coloured background, is exactly the case where a person using a screen reader gets nothing from the picture, so put the words that are on it into the alt text and say what the picture is.
This is the one rule here that no platform guide promises a visible effect for. Which clients read the alt text and where they show it is not documented in the sources these guides use. It costs a line and the protocol asks for it.
Detected by
Nothing. Neither the checker nor the audit reports a missing og:image:alt, so look for it in your own template.
Caching: change a card by changing its URL
The rule
When the picture changes, publish it at a new URL, and keep the old file in place. Put a version or a content hash in the path: /og/pricing-v2.png.
Why
Every platform keeps what it fetched, and most key the image on its URL. Facebook documents it directly: "We cache all images referenced based on each image's URL", and a change reaches new shares only. Overwriting /og.png in place gives it no reason to look again. The Facebook guide sets out the 30 day automatic refresh, the Sharing Debugger and the Graph API call that re-scrapes a page.
The other platforms differ in what they document, and the guides say so:
- LinkedIn stores a preview and publishes no lifetime. Inspecting the URL in Post Inspector makes it read the page again. See the LinkedIn guide.
- X removed the Card Validator's preview, and the X guide covers what remains.
- WhatsApp and Messages document no cache lifetime and no way to refresh. A changed card on a new URL is the one step that does not depend on how either caches. See the WhatsApp and Messages guides.
- Slack has the Unfurl Debugger and its own behaviour for repeated links. See the Slack guide.
A message already sent keeps the card it was sent with. No change to your server reaches it.
Cache your own response, too
A card generated on each request, such as a serverless function that renders an image, can be slow on the one request that matters, the crawler's first. Send a cache header so a crawler is served from a cache. The Facebook guide suggests Cache-Control: public, max-age=0, s-maxage=86400, stale-while-revalidate=604800 for generated cards. The audit reports image_uncacheable (warning) for a card whose response forbids caching and where no cache hit, or climbing age, shows up over two requests.
Verify your fix
Run these in order after any change to a card.
- Read the served tags. Fetch the page without JavaScript and check one
og:image, absolute and HTTPS, with its size and alt text. - Fetch the image. Use the curl commands above: a 200, an image content type, under 500 KB.
- Run the checker. Enter the page you fixed in the checker and read the failing checks. You can also check this guide's own card. Anything graded below A names a rule in this guide.
- Audit the site. Run the site audit to find the templates that still share a card, have none, or point at a file that does not load.
- Use each platform's own tool for the real look, and for a refresh where one exists: the Facebook Sharing Debugger, LinkedIn's Post Inspector and Slack's Unfurl Debugger. X, WhatsApp and Messages have none that shows the card, so send the link in a new post or message. The guides listed below say how.
For a longer, ordered pre-launch list, use the Open Graph testing checklist. For every tag, see the complete guide to Open Graph tags, and for the basics, what Open Graph is.
Frequently Asked Questions
What is the best size for an OG image?
1200 x 630 pixels, a ratio of about 1.91:1. Facebook recommends at least that size and a ratio close to 1.91:1, LinkedIn gives 1200 x 627 as its minimum, and the other platforms either ask for a similar wide ratio or document nothing larger. properOG's checker gives full marks to an image of at least 1200 x 630 and at most 2400 x 1260 with a ratio within 0.1 of 1.91.
How big can an OG image file be?
The documented ceilings are 600 KB for WhatsApp, 5 MB for LinkedIn and X, 8 MB for Facebook and 10 MB for Messages, which counts icon, image and video together. Aim for under 500 KB, which meets WhatsApp's line and is where properOG's checker and audit start to warn.
Should an OG image be PNG, JPEG or WebP?
PNG or JPEG. Facebook documents JPEG, GIF and PNG as og:image:type values, and WhatsApp and Apple list no file types. X documents WebP but not AVIF. WebP and AVIF compress better, and properOG's checker scores them higher for that reason, but nothing in the platforms' documentation confirms every one of them reads those formats.
Does the OG image URL have to be absolute?
Yes, use an absolute https:// URL. ogp.me defines og:image as an image URL, WhatsApp documents an absolute image URL, and Next.js treats a relative path as a build error unless you set metadataBase, which composes it into a full URL.
Why does my OG image look different on each platform?
Each platform draws the same file at its own size and crop: X's small card crops to a square, messaging apps scale it to a small bubble, and a card below a platform's size threshold becomes a thumbnail. Keep the headline large and in the centre, away from the edges, and check the result in each platform's own tool.
Audit your site
Sample pages across every template in your sitemap and see which ones ship the wrong card, or none. Free, no account needed.
Related guides