SpunkArt
Color, art and images

How to make an Open Graph share image

When someone shares a link in a chat app or on social media, the preview card usually shows a large image. That image comes from a tag in the page’s head, and a little planning makes it look right everywhere.

Where the image comes from

Open Graph is a set of meta tags, first introduced by Facebook, that describe how a page should look when shared. Most messaging apps and social networks read them. The image tag looks like this:

<meta property="og:image" content="[full address of the image]">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="Short description of the image">
<meta name="twitter:card" content="summary_large_image">

The content of og:image must be an absolute address that includes the scheme and the domain, not a path that starts with a slash. Crawlers that build the preview do not resolve relative paths reliably. The twitter:card line asks X (formerly Twitter) for the large-image card style instead of a small thumbnail.

The size and ratio

The widely used size is 1200 × 630 pixels. Its ratio is 1200 ÷ 630 = 1.905, often written as 1.91:1. Platforms scale it down and sometimes crop it, so design to that ratio and keep important content away from the edges.

WidthHeight at 1.91:1When
1200630The standard; sharp on high-density screens
600315Half size; small file, softer on large screens

Some apps show a square crop from the centre instead. A 630 × 630 square in the middle of a 1200 × 630 image runs from x = 285 to x = 915. Keep the title and logo inside that zone and the card works in both shapes.

Layout that reads at thumbnail size

The preview is often shown at 500 pixels wide or less, less than half its real size. Text that looks fine in your editor can become tiny.

  1. Use one short headline, about six words at most. The page title already appears under the card, so do not repeat a long one.
  2. Set the headline large. At least 60 pixels tall in a 1200-pixel-wide design is a sensible starting point.
  3. Leave a margin of about 60 pixels or more on every side.
  4. Use strong contrast between text and background. A plain color or a soft gradient works better than a busy photo.
  5. Add a small logo or site name in a corner, not in the middle.

File format and weight

Use PNG for flat graphics and text, and JPEG for photographic backgrounds. Uncompressed, a 1200 × 630 image with transparency is 1200 × 630 × 4 = 3,024,000 bytes, about 2.88 MiB, so compression matters. A flat design saved as PNG is usually a small fraction of that. Some platforms reject or skip images above their own size limits, so a few hundred kilobytes is a safe target. The image compression guide explains the settings.

One image per page, or one for the site

A single site-wide image is simple and better than nothing. Separate images for key pages, each with that page’s own headline, make shared links more specific and more likely to be clicked. If you build many pages, you can generate the images automatically from a template at build time.

Updating a cached preview

Platforms store the preview the first time someone shares a link. If you change the image later, old shares keep the old one. Two ways to refresh:

  • Give the new image a new file name, such as share-v2.png, and update the tag.
  • Use the platform’s own link-preview debugging tool, where one exists, to ask it to fetch the page again.

Common mistakes

  • A relative image path. The card shows no image at all.
  • Important text at the edges. It gets cropped on some apps.
  • Images behind a login or blocked in robots.txt. The crawler cannot fetch them.
  • Missing alt text. Add og:image:alt so the image has a description for screen-reader users where platforms support it.

Questions people ask

Does an Open Graph image affect search rankings?

It controls how your link looks when shared, not where the page ranks. A clear card can still bring more clicks from social and chat apps.

Can I use an SVG?

Most platforms do not accept SVG for previews. Export a PNG or JPEG.