og:image Meta Tag: Syntax, Sizes and How Sites Use It
og:image syntax and image properties, the size rules Facebook and LinkedIn document, and how Google uses og:image for preview images.
The og:image meta tag gives the URL of the image that represents a page when someone shares a link to it. Facebook, LinkedIn and Google document how they use it. Add one relevant image of at least 1200 by 630 pixels, with its width, height and alt text.
Syntax
<meta property="og:image" content="https://example.com/images/cat.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="A gray cat asleep on a keyboard">
og:image is one of the four required properties of the Open Graph protocol. The other three are og:title, og:type and og:url. The Open Graph meta tags guide explains them. Open Graph tags use the property attribute, not name.
Image properties
The protocol defines these structured properties for an image. Put them after the og:image tag that they describe.
| Property | Value |
|---|---|
og:image:url |
Same as og:image |
og:image:secure_url |
Another URL to use if the page needs HTTPS |
og:image:type |
MIME type, for example image/png |
og:image:width |
Width in pixels |
og:image:height |
Height in pixels |
og:image:alt |
A description of what is in the image, not a caption |
The protocol asks for og:image:alt on every page that has og:image. If you add more than one image, repeat the og:image tag. Each new og:image tag starts a new group of properties. If tags conflict, the first one in the page wins.
Facebook requirements
Meta gives these numbers in its image guide for sharing:
- The minimum size is 200 by 200 pixels.
- For high resolution screens, use at least 1200 by 630 pixels.
- Keep the aspect ratio close to 1.91:1, so the image shows in Feed without cropping.
- The file must not be larger than 8 MB.
Meta says that og:image:width and og:image:height let its crawler show the image the first time that someone shares the page. Meta caches images by URL. If you replace an image, give the new file a new URL. Do not delete the old image, because older posts can still refer to it. The Facebook crawler reads the tags.
LinkedIn requirements
LinkedIn’s help page on shared content lists og:image as a required tag. It gives a minimum size of 1200 by 627 pixels, a 1.91:1 ratio and a maximum file size of 5 MB.
How Google uses og:image
Google says that its choice of a preview image is automated. You can give a preferred image with og:image or with schema.org markup (Google image best practices). Google gives two examples of where the image can appear: the image of a text result in Search, and the preview image in Discover. Google gives these rules for the preferred image:
- Choose an image that is relevant and representative of the page.
- Do not use a generic image, such as your site logo, or an image with text.
- Do not use an extreme aspect ratio.
- Use a high resolution if you can.
For large images in Google Discover, Google asks for images at least 1200 pixels wide and the max-image-preview:large setting. That setting is a rule of the robots meta tag.
What og:image does not do
The og:image tag does not do these things:
- It does not make Google show your image. Google says only that the tag can influence its choice.
- It does not update old previews. Facebook keeps the cached image until you use a new image URL. You can ask Facebook to read the page again in the Sharing Debugger.
- It does not set the image on X when X finds its own
twitter:imagetag. Read the Twitter card meta tags guide.
Test the tag
Paste the page URL into the Facebook Sharing Debugger. It shows the tags that the crawler reads, with errors and warnings. LinkedIn has a similar tool, the Post Inspector.