Skip to content

Fabber-bot/og-preview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OG Preview

Test OpenGraph images across social media platforms before deploying.

OG Preview Screenshot

Live Demo →

Features

  • Multi-platform preview — See how your OG image appears on Facebook, Twitter/X, LinkedIn, Discord, Slack, WhatsApp, iMessage, and Telegram
  • Safe zone visualization — 60px industry-standard margin overlay shows what might get cropped
  • Actual display sizes — Images rendered at real platform dimensions, not just scaled
  • Zero dependencies — Single HTML file, works offline
  • URL parameter support — Share previews with ?url=https://...

Usage

Option 1: Open directly

Just open index.html in your browser and paste any image URL.

Option 2: Serve locally

# Using Python
python3 -m http.server 8000

# Using Node
npx serve .

# Using PHP
php -S localhost:8000

Then open http://localhost:8000

Option 3: URL parameter

file:///path/to/og-preview/index.html?url=https://example.com/og.png

Platform Specifications

Platform Display Size Aspect Ratio Crops OG 1.91:1?
Facebook 500 × 261 1.92:1 May crop
Twitter/X 506 × 265 1.91:1 No
LinkedIn 520 × 272 1.91:1 No
Discord 400 × 210 1.90:1 No
Slack 360 × 189 1.90:1 No
WhatsApp 300 × 157 1.91:1 No
iMessage 300 × 157 1.91:1 No
Telegram 320 × 168 1.90:1 No

Safe Zone

OG images are 1200×630px. The 60px safe zone (industry standard) ensures important content isn't cropped:

  • Safe area: 1080 × 510px (center)
  • Danger zone: 60px from all edges

Keep logos, text, and CTAs inside the safe zone.

Tips

  1. Test with real URLs — Use your actual OG image endpoint, not local files (CORS)
  2. Add cache busters — Append ?t=123 to force reload: https://example.com/og.png?t=123
  3. Check Facebook specifically — It crops more aggressively than other platforms
  4. Design for small sizes — Images display at 25-50% of original, ensure text is readable

License

MIT

About

Test OpenGraph images across Facebook, Twitter/X, LinkedIn, Discord, Slack, WhatsApp, iMessage, and Telegram before deploying. Zero dependencies, single HTML file.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages