惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 聂微东
GbyAI
GbyAI
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园 - 叶小钗
A
About on SuperTechFans
M
MIT News - Artificial intelligence
宝玉的分享
宝玉的分享
雷峰网
雷峰网
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Martin Fowler
Martin Fowler
Google DeepMind News
Google DeepMind News
博客园 - Franky
B
Blog RSS Feed
Y
Y Combinator Blog
Stack Overflow Blog
Stack Overflow Blog
MongoDB | Blog
MongoDB | Blog
Last Week in AI
Last Week in AI
T
The Blog of Author Tim Ferriss
The GitHub Blog
The GitHub Blog
S
SegmentFault 最新的问题
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Open Graph Image Sizes and Dimensions: The Complete 2026 ...
Nico Acosta · 2026-06-17 · via DEV Community
Cover image for Open Graph Image Sizes and Dimensions: The Complete 2026 Guide

When you paste a link into Slack, X, or iMessage and it unfurls into a rich card with a big image, that image comes from your page's Open Graph tags. Get the size wrong and the card collapses into a tiny thumbnail or, worse, shows nothing at all. This guide gives you the exact dimensions and the meta tags to use.

The short answer

Use 1200 by 630 pixels. That is an aspect ratio of roughly 1.91 to 1, and it is the size every major platform renders as a full-width preview card. If you only remember one number, remember 1200 by 630.

Platform-by-platform sizes

Platform Recommended size Notes
Facebook 1200 x 630 Under 600 x 315 drops to a small thumbnail
X (Twitter) 1200 x 630 Needs twitter:card set to summary_large_image
LinkedIn 1200 x 627 Treats 1200 x 630 the same in practice
Slack 1200 x 630 Reads standard og:image
Discord 1200 x 630 Reads standard og:image
iMessage 1200 x 630 Reads standard og:image

The takeaway: one 1200 by 630 image satisfies all of them. You do not need a different file per platform.

Minimum, maximum, and file size

  • Minimum for a large card: 600 by 315. Below this, Facebook and LinkedIn render a small square thumbnail next to the text instead of the big card.
  • Aspect ratio: keep it at 1.91 to 1. If your image is a different ratio, platforms crop it, usually from the center, and your text can get cut off.
  • File size: keep it under 8 MB for Facebook, but aim for well under 1 MB so the card loads fast. WebP or optimized PNG and JPEG all work.
  • Safe zone: keep important text and logos away from the outer edges, since some apps crop a few pixels.

The meta tags you actually need

Put these in the <head> of every page you want to share:

<meta property="og:title" content="Your page title" />
<meta property="og:description" content="A one-line summary." />
<meta property="og:image" content="https://yoursite.com/og/your-page.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="https://yoursite.com/og/your-page.png" />

Setting og:image:width and og:image:height is the detail most people skip. It lets the platform reserve the right space and render the large card immediately instead of guessing.

How to generate OG images from a URL

Designing a unique image for every page by hand does not scale. The pattern that does: build one small HTML template that renders the title and your branding, then capture that page as an image at 1200 by 630.

A screenshot API turns that into a single request. Point it at your template URL with a fixed viewport:

curl https://api.grabbit.live/v1/grabs \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://yoursite.com/og/my-post", "width": 1200, "height": 630 }'

The response gives you a hosted image_url you can drop straight into your og:image tag. Because the source is a real web page, you can style it with the same CSS as the rest of your site, pull in dynamic titles, and never open a design tool. This is exactly what Grabbit's screenshot API is built for, and you can wire it up with a free test key first.

Common mistakes

  • Using a logo as the OG image. Logos are square and get cropped or shrunk. Use a 1200 by 630 card with the title.
  • Forgetting summary_large_image for X. Without it, X shows the small card no matter how big your image is.
  • A relative image URL. og:image must be an absolute URL, including https://. Crawlers do not resolve relative paths.
  • Not testing. Always preview the card before you publish. See the FAQ for how.

Wrapping up

One size, 1200 by 630, covers every major platform. Set the width and height tags, use an absolute URL, add summary_large_image for X, and generate the image from an HTML template so it scales across your whole site. For automating that last step, see how to generate dynamic OG images from any URL.


Originally published on the Grabbit blog.