OG Image Generator: 4 Ways to Make Social Images
An OG image is the picture that shows up when someone shares your link on X, LinkedIn, Facebook, Slack, Discord, WhatsApp or iMessage. It's set with the og:image meta tag, and without one your link shows as a plain text card or, on some platforms, as a tiny thumbnail.
"OG image generator" covers four quite different approaches. This guide explains each one, who it suits, and the trade-offs, so you can pick the right one before you write any code.
What every generated image needs
Whatever approach you choose, the output should meet the same targets:
- 1200×630 pixels (ratio about 1.91:1). This meets Meta's recommended size and LinkedIn's 1200×627 minimum.
- PNG or JPEG, under 600 KB. WhatsApp says images "should be" under 600 KB, which is the strictest limit among the major platforms.
- An absolute
https://URL inog:image, reachable without cookies or login. og:image:widthandog:image:heighttags, which help Facebook show the image on the very first share.
Full sources are in OG image size.
1. Design tools (manual)
You open a design app, make a 1200×630 canvas, type the title, export, and upload.
Good for: a homepage and a handful of landing pages that rarely change.
Trade-offs: it doesn't scale. Every new blog post needs a new export, and images drift out of sync with titles when you edit them. Most sites with a blog end up with a generic fallback image on everything, which makes every share look the same.
Tip: if you go this route, make one template file and only change the text, so the images at least look consistent.
2. Build-time generation (static)
A script runs during your build, renders an image for every page, and writes PNG files into your output folder. Common building blocks are a headless browser screenshotting an HTML template, or an HTML/CSS-to-SVG renderer that converts the SVG to PNG.
Good for: static sites (Astro, Hugo, Eleventy) with a moderate number of pages and a developer who's happy to own the script.
Trade-offs:
- Build time grows with page count. Hundreds of images can add minutes to every deploy unless you cache them between builds.
- You maintain fonts, layout and the toolchain. A headless browser is a heavy CI dependency.
- Generated files bloat your repo or your deploy output.
3. On-demand generation in your own code
Your app exposes a route that renders an image when it's requested, usually with an HTML/CSS-to-image library running in a serverless or edge function. Next.js has this built in with the opengraph-image file convention.
Good for: apps already running on a platform that supports it, with dynamic content (user profiles, products) where images must reflect live data.
Trade-offs:
- You own caching. Without good cache headers, every crawler hit can run your function.
- Limits apply. In Next.js, for example,
opengraph-imageoutput must stay under 8 MB andtwitter-imageunder 5 MB or the build fails, fonts must be TTF, OTF or WOFF, and the function bundle is limited to 500 KB. - Layout uses a CSS subset (flexbox only in common renderers), which takes some getting used to.
See dynamic OG images in Next.js for this approach in detail.
4. Hosted URL generators
A service renders the image from parameters in a URL. You put that URL straight into og:image, and the service renders it on first request and caches it.
Good for: any stack, including WordPress, Ghost, Hugo and plain HTML, where you want images without running rendering code.
Trade-offs:
- You depend on a third party, so check what happens when you hit limits (do images break or keep working?).
- Design freedom is limited to the templates offered.
- Without signed URLs, anyone could generate images on your account, so look for signing.
More on evaluating these in OG image API.
What makes a card readable
Feed previews are small. On a phone, a 1200×630 image is often shown just a few hundred pixels wide, so design for that size, not for your monitor:
- One idea per image. The title is the image. Skip paragraphs, bullet lists and screenshots of text.
- Big, high-contrast text. If you can't read it when you zoom out to thumbnail size, nobody in a feed will.
- Keep content away from the edges. Some platforms crop slightly or round the corners.
- Consistent branding. The same layout, colors and position for your name on every image make your links recognizable in a busy feed.
- Don't repeat the link text exactly. Most platforms already show the page title under the image, so a subtitle with your domain or section adds more than the title twice.
Quick comparison
| Feature | Design tool | Build-time | On-demand (own code) | Hosted URL |
|---|---|---|---|---|
| Scales with content | No | Yes | Yes | Yes |
| Code to maintain | None | Script + toolchain | Route + fonts + caching | One meta tag |
| Works on any CMS | Manual uploads | Static sites | Platforms with functions | Yes |
| Updates when title changes | No | On rebuild | Yes | Yes (new URL) |
| Design freedom | Full | Full | Full (CSS subset) | Template-limited |
Unfurlkit: a hosted URL generator
Unfurlkit is option 4. One URL, and you're done:
<meta property="og:image"
content="https://unfurlkit.com/v1/basic.png?title=How%20we%20cut%20build%20times&subtitle=unfurlkit.com%2Fguides&theme=dark" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />
What you get at launch:
- The
basictemplate (title, subtitle, light or dark theme, accent color) as a 1200×630 PNG. Six more:blog,product,changelog,repo,eventandpodcast(see templates). - Free: every image URL needs your key. A Free key gets 10 renders in total (no monthly reset), with a small "unfurlkit" watermark, and needs no card.
- Pro: $9/mo or $90/yr for 10,000 renders a month, no watermark, and custom fonts (Inter, Roboto, Playfair Display, JetBrains Mono) and logo. Pro URLs are signed on your server. See Signing Pro URLs.
- Only new images count. Shares and cache hits are free. A render is counted only when a unique image is generated uncached.
- Images keep loading. On Free past the limit, new images get a plain version (your title on the basic card, with the small mark) that doesn't count (the free allowance doesn't reset). On Pro there's no hard stop and no overage charge, and we may contact you about your usage.
Upgrade to Pro to remove watermarks from all your images. See pricing.
Setup guides: Next.js, Astro, Hugo, WordPress, Ghost, Eleventy, SvelteKit.
Generating an image "from a URL"
People often search for a generator that takes a page URL and makes an image from it. There are two meanings:
- Screenshot the page. Some tools capture the live page. Screenshots of full pages are usually too busy to read at feed size, and text gets tiny.
- Read the page's title and build a card. This reads much better. With a hosted URL generator you do this in your template: take the page's title and put it in the image URL, so every page gets its own card automatically.
Which one should you pick?
- A few static pages, no blog: a design tool is fine.
- Static site, you enjoy owning tooling: build-time generation.
- App with live data on a platform with image functions: on-demand in your own code.
- Any CMS or stack, and you'd rather not maintain rendering code: a hosted URL generator.
Check the result
Whichever approach you pick, test before you share:
- Open the image URL directly. It should load as an image, with no login or redirect to HTML.
- Paste your page into the Free OG Image Checker to see how it previews on X, LinkedIn, Facebook, WhatsApp, Slack, Discord and iMessage, and which tags are missing. We don't store the URLs you check.
- If a platform shows an old image, re-scrape it in that platform's debugger. See OG image not showing.
FAQ
Is there a free OG image generator? Yes. Unfurlkit's Free plan renders 10 new images in total with a small watermark, and only new images count. Design tools and build-time scripts are also free, at the cost of your time.
Which languages and scripts are supported? Right-to-left scripts such as Arabic and Hebrew aren't supported yet at launch.
Can I use my own fonts and logo?
On Pro, yes: pick one of four bundled fonts (Inter, Roboto, Playfair Display, JetBrains Mono) with font, and add your logo with logo (an https link to a PNG, JPEG or GIF).
What size should the image be? 1200×630 PNG or JPEG, under 600 KB.
Do I need a different image for X?
Usually not; the same 1200×630 image works. X is commonly reported to fall back to og:image, but we couldn't confirm that in current official X docs, so set twitter:image too. Add twitter:card set to summary_large_image for the large card. See Twitter card validator.