
Social Media Image Sizes
- 1.7k installs
- 4 repo stars
- Updated April 30, 2026
- branding5/social-media-image-sizes
social-media-image-sizes is a skill that Check and resize images for social media platforms. Run scripts/check.js to validate any image against specs for Instagram, Facebook, X (Twitter), LinkedIn, TikTok, YouTube, Pinte
About
The social-media-image-sizes skill helps with Check and resize images for social media platforms. Run scripts/check.js to validate any image against specs for Instagram, Facebook, X (Twitter), LinkedIn, TikTok, YouTube, Pinterest, Snapchat, and Threads - get a ranked match list with exact resize commands. Run scripts/resize.js to export a correctly-sized copy. Use when a user asks to validate image dimensions, resize an image for a platform, . Key workflows include Social Media Image Sizes; Setup; Check an image; Resize an image. Documented capabilities cover **Sharp requires a native binary.** On first `npm install`, it downloads a prebuilt binary for your platform. If install fails behind a proxy, set `SHARP_IGNORE_GLOBAL_LIBVIPS=1` and retry.; **All slides in an Instagram carousel must share the same aspect ratio.** The first image sets the ratio for the whole carousel - check all slides, not just the first.; **Facebook cover photo has two safe zones.** Desktop shows 820×312; mobile crops to 640×360. Keep key content in the center 640×312.; **YouTube banner safe area is much smaller than the
- Social Media Image Sizes
- Setup
- Check an image
- Resize an image
- → photo-instagram-portrait-post.jpg (1080×1350 px)
Social Media Image Sizes by the numbers
- 1,682 all-time installs (skills.sh)
- +19 installs in the week ending Aug 5, 2026 (Skillselion tracking)
- Ranked #346 of 1,879 Marketing & SEO skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
social-media-image-sizes capabilities & compatibility
- Capabilities
- social media image sizes · setup · check an image · resize an image · → photo instagram portrait post.jpg (1080×1350 p
- Use cases
- planning · research
What social-media-image-sizes says it does
Check and resize images for social media platforms. Run scripts/check.js to validate any image against specs for Instagram, Facebook, X (Twitter), LinkedIn, TikTok, YouTube, Pinter
npx skills add https://github.com/branding5/social-media-image-sizes --skill social-media-image-sizesAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1.7k |
|---|---|
| repo stars | ★ 4 |
| Security audit | 3 / 3 scanners passed |
| Last updated | April 30, 2026 |
| Repository | branding5/social-media-image-sizes ↗ |
How do I apply social-media-image-sizes for social media image sizes tasks?
Check and resize images for social media platforms. Run scripts/check.js to validate any image against specs for Instagram, Facebook, X (Twitter), LinkedIn, TikTok, YouTube, Pinter
Who is it for?
Teams using social-media-image-sizes as documented in the skill repository.
Skip if: Tasks outside the social-media-image-sizes scope in SKILL.md.
When should I use this skill?
User mentions social-media-image-sizes, social-media-image-sizes, or related skill triggers.
What you get
Structured guidance and deliverables from the social-media-image-sizes SKILL.md workflow.
- Platform match validation report
- Resized image export
By the numbers
- Covers 9 social platforms: Instagram, Facebook, X, LinkedIn, TikTok, YouTube, Pinterest, Snapchat, Threads
- Skill version 1.0.0 requires Node.js 18+
Files
Social Media Image Sizes
Check and resize images for 9 platforms / 60+ specs. Scripts mirror the logic at branding5.com/tools/social-media-cheat-sheet.
Setup
Run once after install:
cd <skill-dir>
npm installCheck an image
node scripts/check.js photo.jpgOutputs a ranked match list — perfect → close → usable → too small — with an inline node scripts/resize.js command for every non-perfect match.
Filter by platform or match level:
node scripts/check.js photo.jpg --platform instagram
node scripts/check.js photo.jpg --filter perfect
node scripts/check.js photo.jpg --filter usablePlatform slugs: instagram facebook twitter linkedin tiktok youtube pinterest snapchat threads
Resize an image
node scripts/resize.js photo.jpg "Instagram Portrait Post"
# → photo-instagram-portrait-post.jpg (1080×1350 px)
node scripts/resize.js photo.jpg "YouTube Custom Thumbnail"
# → photo-youtube-custom-thumbnail.jpg (1280×720 px)Default fit is cover (center-crop). Use --fit contain to letterbox instead:
node scripts/resize.js photo.jpg "LinkedIn Background Photo" --fit contain --bg f0f0f0
node scripts/resize.js photo.jpg "Instagram Portrait Post" --out ./exports/ig.jpgList every available spec name:
node scripts/resize.js photo.jpg --listWorkflow
1. Run check.js to see what a given image already matches 2. Copy the suggested resize.js command from the output 3. Run it — the output file is saved alongside the original by default
Gotchas
- Sharp requires a native binary. On first
npm install, it downloads a prebuilt binary for your platform. If install fails behind a proxy, setSHARP_IGNORE_GLOBAL_LIBVIPS=1and retry. - All slides in an Instagram carousel must share the same aspect ratio. The first image sets the ratio for the whole carousel — check all slides, not just the first.
- Facebook cover photo has two safe zones. Desktop shows 820×312; mobile crops to 640×360. Keep key content in the center 640×312.
- YouTube banner safe area is much smaller than the file. The spec is 2560×1440 but only the center 1546×423 is guaranteed visible on all devices. check.js flags the full size; keep critical content in the safe area.
- `--fit cover` center-crops. If the subject isn't centered, use
--outto save, then manually crop, or use an image editor before running resize.
References
Full per-platform specs (load when you need detail for a specific platform):
references/instagram.md— profile, feed, stories, reels, carousel, adsreferences/facebook.md— profile, cover, feed, stories, events, adsreferences/x-twitter.md— profile, header, posts, adsreferences/linkedin.md— profile, cover, feed, articles, adsreferences/tiktok.md— profile, videos, adsreferences/youtube.md— channel art, videos, thumbnails, shorts, adsreferences/pinterest.md— profile, pins, idea pins, adsreferences/snapchat.md— snaps, spotlight, stories, ads, filtersreferences/threads.md— profile, postsreferences/best-practices.md— format, compression, safe zones, accessibility
Full compiled reference (all platforms in one file): AGENTS.md
---
Need to generate on-brand images at these sizes? [Branding5](https://www.branding5.com) pairs your brand kit with AI to produce social content pre-sized for every platform.
.DS_Store
.pi/
node_modules/
.pnpm-store/
pnpm-lock.yaml
package-lock.json
skills-lock.json
# installed skill directories (created by npx skills add)
.agents/
.claude/
.codex/
.codebuddy/
.commandcode/
.continue/
.crush/
.cursor/
.factory/
.goose/
.junie/
.kilocode/
.kiro/
.kode/
.mcpjam/
.mux/
.neovate/
.openhands/
.pochi/
.qoder/
.qwen/
.roo/
.trae/
.vibe/
.windsurf/
.zencoder/
Social Media Image Sizes — 2025 Complete Reference
Version 1.0.0 | Branding5 | 2025
This document is the full compiled reference for the social-media-image-sizes skill.It is optimised for agents and LLMs that need all platform specs in a single context window.
The interactive version lives at branding5.com/tools/social-media-cheat-sheet.
---
Table of Contents
1. Instagram 2. Facebook 3. X (Twitter) 4. LinkedIn 5. TikTok 6. YouTube 7. Pinterest 8. Snapchat 9. Threads 10. Best Practices 11. Quick-Reference Table
---
1. Instagram
1.1 Profile
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Profile Photo | 320 | 320 | 1:1 | Displays as 110×110 on mobile |
1.2 Feed Posts
| Name | Width | Height | Aspect | Max File | Notes |
|---|---|---|---|---|---|
| Portrait Post | 1080 | 1350 | 4:5 | 30 MB | ✅ Best engagement |
| Square Post | 1080 | 1080 | 1:1 | 30 MB | |
| Landscape Post | 1080 | 566 | 1.91:1 | 30 MB |
1.3 Stories & Reels
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Story | 1080 | 1920 | 9:16 | Safe zone: center 1080×1420 |
| Reel | 1080 | 1920 | 9:16 | Cover photo: 1080×1920 |
| Reel Cover Thumbnail | 420 | 654 | 1:1.55 | Shown in grid as 1:1 crop |
1.4 Carousel Posts
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Carousel Square | 1080 | 1080 | 1:1 | Up to 10 slides |
| Carousel Portrait | 1080 | 1350 | 4:5 | Up to 10 slides; best engagement |
All slides must share the same aspect ratio. The first image sets the ratio.
1.5 Ads
| Name | Width | Height | Aspect |
|---|---|---|---|
| Feed Ad (Square) | 1080 | 1080 | 1:1 |
| Feed Ad (Landscape) | 1200 | 628 | 1.91:1 |
| Story Ad | 1080 | 1920 | 9:16 |
1.6 Technical Requirements
- Images: JPG or PNG | Videos: MP4 or MOV H.264 | Color: sRGB
- Max image file size: 30 MB | Minimum width: 320 px
---
2. Facebook
2.1 Profile & Cover
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Profile Photo | 170 | 170 | 1:1 | Desktop: 176×176, mobile: 196×196 |
| Cover Photo | 820 | 312 | 2.63:1 | Min 400×150. Mobile crop: 640×360 |
2.2 Feed Posts
| Name | Width | Height | Aspect |
|---|---|---|---|
| Image Post (Landscape) | 1200 | 630 | 1.91:1 |
| Image Post (Square) | 1200 | 1200 | 1:1 |
| Image Post (Portrait) | 1080 | 1350 | 4:5 |
2.3 Stories & Reels
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Story | 1080 | 1920 | 9:16 | Leave 14% top & 20% bottom for UI |
| Reel | 1080 | 1920 | 9:16 |
2.4 Events & Groups
| Name | Width | Height | Aspect |
|---|---|---|---|
| Event Cover | 1920 | 1005 | 1.91:1 |
| Group Cover | 1640 | 856 | 1.91:1 |
2.5 Ads
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Feed Ad | 1200 | 628 | 1.91:1 | |
| Carousel Ad | 1080 | 1080 | 1:1 | 2–10 cards |
| Right Column Ad | 1200 | 628 | 1.91:1 | |
| Marketplace Ad | 1200 | 628 | 1.91:1 |
2.6 Technical Requirements
- Images: JPG or PNG | Videos: MP4 or MOV H.264, max 4 GB | Color: sRGB
- Minimum image width: 600 px
---
3. X (Twitter)
3.1 Profile & Header
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Profile Photo | 400 | 400 | 1:1 | Displayed as circle (200×200) |
| Header Image | 1500 | 500 | 3:1 |
3.2 Posts
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Single Image | 1600 | 900 | 16:9 | Min 600×335. Max 5 MB images / 15 MB GIFs |
| Two Images | 700 | 800 | 7:8 | Per image in a 2-image post |
| Card Image | 800 | 418 | 1.91:1 | Link preview / Twitter Card |
3.3 Ads
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Single Image Ad | 1200 | 675 | 16:9 | |
| Carousel Ad | 800 | 800 | 1:1 | 2–6 cards |
| Website Card | 800 | 418 | 1.91:1 |
3.4 Technical Requirements
- Images: JPG, PNG, GIF, WebP | Videos: MP4 or MOV H.264
- Max image: 5 MB (JPG/PNG), 15 MB (GIF) | Max video: 512 MB, 2 min 20 sec
---
4. LinkedIn
4.1 Profile & Cover
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Profile Photo | 400 | 400 | 1:1 | Min 200×200, max 8 MB |
| Background Photo | 1584 | 396 | 4:1 | |
| Company Logo | 300 | 300 | 1:1 | |
| Company Cover | 1128 | 191 | 5.91:1 |
4.2 Feed Posts
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Image Post (Landscape) | 1200 | 627 | 1.91:1 | |
| Image Post (Square) | 1200 | 1200 | 1:1 | |
| Image Post (Portrait) | 1080 | 1350 | 4:5 | ✅ Best engagement |
4.3 Articles & Newsletters
| Name | Width | Height | Aspect |
|---|---|---|---|
| Article Cover | 1920 | 1080 | 16:9 |
| Newsletter Cover | 1920 | 1080 | 16:9 |
4.4 Ads
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Sponsored Content | 1200 | 627 | 1.91:1 | |
| Carousel Ad | 1080 | 1080 | 1:1 | 2–10 cards |
| Spotlight Ad Logo | 100 | 100 | 1:1 |
4.5 Technical Requirements
- Images: JPG or PNG | Videos: MP4 H.264, max 5 GB | Color: sRGB
- Max video length: 10 min (organic), 30 min (ads)
---
5. TikTok
5.1 Profile
| Name | Width | Height | Aspect |
|---|---|---|---|
| Profile Photo | 200 | 200 | 1:1 |
5.2 Videos
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Video (Full Screen) | 1080 | 1920 | 9:16 | Min 720×1280. Max 10 min. |
| Video Thumbnail | 1080 | 1920 | 9:16 | Custom thumbnail from video |
5.3 Ads
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| In-Feed Ad | 1080 | 1920 | 9:16 | 5–60 seconds |
| TopView Ad | 1080 | 1920 | 9:16 | Up to 60 seconds; first thing seen on open |
| Spark Ad | 1080 | 1920 | 9:16 | Boosts existing organic content |
5.4 Technical Requirements
- Video: MP4 or MOV, H.264/H.265 | Frame rate: 23–60 fps | Bitrate: ≥ 516 kbps
- Max video size: 500 MB (web), 72 MB (Android app)
---
6. YouTube
6.1 Channel Art
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Profile Photo | 800 | 800 | 1:1 | Displays as 98×98 |
| Channel Banner | 2560 | 1440 | 16:9 | Safe area: center 1546×423 |
6.2 Videos
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Video Upload (1080p) | 1920 | 1080 | 16:9 | |
| Video Upload (4K) | 3840 | 2160 | 16:9 | |
| Custom Thumbnail | 1280 | 720 | 16:9 | Min 640×360. Max 2 MB |
| Shorts | 1080 | 1920 | 9:16 | Up to 60 seconds |
6.3 Community & Ads
| Name | Width | Height | Aspect |
|---|---|---|---|
| Community Post Image | 1200 | 675 | 16:9 |
| Display Ad | 300 | 250 | 6:5 |
| Overlay Ad | 480 | 70 | 48:7 |
6.4 Technical Requirements
- Video: MP4 recommended, H.264 | Max size: 256 GB or 12 hours
- Thumbnail: JPG/PNG/GIF/BMP, max 2 MB | Frame rate: 24–60 fps
---
7. Pinterest
7.1 Profile
| Name | Width | Height | Aspect |
|---|---|---|---|
| Profile Photo | 165 | 165 | 1:1 |
| Board Cover | 222 | 150 | 3:2 |
7.2 Pins
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Standard Pin | 1000 | 1500 | 2:3 | ✅ Optimal for feed |
| Square Pin | 1000 | 1000 | 1:1 | |
| Long Pin | 1000 | 2100 | 1:2.1 | Max ratio 1:2.1 |
| Idea Pin | 1080 | 1920 | 9:16 | Up to 20 pages |
7.3 Ads
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Promoted Pin | 1000 | 1500 | 2:3 | |
| Carousel Ad | 1000 | 1500 | 2:3 | 2–5 cards |
| Shopping Ad | 1000 | 1500 | 2:3 |
7.4 Technical Requirements
- Images: JPG or PNG, max 20 MB | Videos: MP4 or MOV H.264, max 2 GB
- Video length: 4 sec–15 min
---
8. Snapchat
8.1 Content
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Snap | 1080 | 1920 | 9:16 | |
| Spotlight | 1080 | 1920 | 9:16 | 5–60 seconds |
| Story | 1080 | 1920 | 9:16 |
8.2 Ads
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Single Image/Video Ad | 1080 | 1920 | 9:16 | |
| Collection Ad | 1080 | 1920 | 9:16 | Up to 4 tappable tiles |
| Filter / Lens | 1080 | 2340 | 9:19.5 | Full device screen |
8.3 Technical Requirements
- Images: JPG or PNG, max 5 MB | Videos: MP4 or MOV H.264, max 32 MB
- Frame rate: 30–60 fps | Video length: 3–180 seconds
---
9. Threads
9.1 Profile
| Name | Width | Height | Aspect | Notes |
|---|---|---|---|---|
| Profile Photo | 320 | 320 | 1:1 | Same as Instagram |
9.2 Posts
| Name | Width | Height | Aspect |
|---|---|---|---|
| Image Post (Portrait) | 1080 | 1350 | 4:5 |
| Image Post (Square) | 1080 | 1080 | 1:1 |
| Image Post (Landscape) | 1080 | 566 | 1.91:1 |
9.3 Technical Requirements
- Images: JPG or PNG, max 30 MB | Videos: MP4 or MOV, max 5 min
---
10. Best Practices
10.1 Format Selection
| Format | Best For |
|---|---|
| JPG | Photos, complex imagery |
| PNG | Logos, graphics, transparency |
| MP4 | All video content |
10.2 Safe Zones
| Platform | Content Type | Safe Zone |
|---|---|---|
| Story/Reel | Center 1080×1420 px | |
| Story | Avoid top 14% and bottom 20% | |
| TikTok | Video | y: 150–1770 px |
| Snapchat | Snap/Ad | Center 1080×1420 px |
| YouTube | Banner | Center 1546×423 px |
10.3 Aspect Ratio Decision Guide
| Use Case | Ratio | Reason |
|---|---|---|
| Stories, Reels, TikTok, Shorts | 9:16 | Full-screen mobile |
| Instagram/LinkedIn feed | 4:5 | More feed space, best engagement |
| Universal feed post | 1:1 | Safe crop everywhere |
| YouTube, X posts | 16:9 | Standard widescreen |
| Facebook/LinkedIn feed, link cards | 1.91:1 | Standard preview ratio |
| 2:3 | Column format |
10.4 Compression
- Target 72–150 dpi; higher adds file size without benefit on screen
- Use sRGB color profile — CMYK renders incorrectly on screens
- Keep images under 1 MB where possible
10.5 Accessibility
- Text contrast ratio ≥ 4.5:1 (WCAG AA)
- Minimum 28–32 px equivalent font size for Story/Reel overlays
- Add captions to all videos
---
11. Quick-Reference Table
| Platform | Content Type | Width | Height | Aspect | Notes |
|---|---|---|---|---|---|
| Feed (Portrait) | 1080 | 1350 | 4:5 | ✅ Best engagement | |
| Feed (Square) | 1080 | 1080 | 1:1 | ||
| Story / Reel | 1080 | 1920 | 9:16 | Safe zone: center 1080×1420 | |
| Feed (Landscape) | 1200 | 630 | 1.91:1 | ||
| Cover Photo | 820 | 312 | 2.63:1 | Safe: center 640×312 | |
| Story | 1080 | 1920 | 9:16 | Avoid top 14% / bottom 20% | |
| X (Twitter) | Post Image | 1600 | 900 | 16:9 | Min 600×335 |
| X (Twitter) | Header | 1500 | 500 | 3:1 | |
| Feed (Portrait) | 1080 | 1350 | 4:5 | ✅ Best engagement | |
| Background Photo | 1584 | 396 | 4:1 | ||
| TikTok | Video | 1080 | 1920 | 9:16 | Min 720×1280 |
| YouTube | Thumbnail | 1280 | 720 | 16:9 | Max 2 MB |
| YouTube | Channel Banner | 2560 | 1440 | 16:9 | Safe area: center 1546×423 |
| Standard Pin | 1000 | 1500 | 2:3 | ✅ Optimal for feed | |
| Snapchat | Snap / Story | 1080 | 1920 | 9:16 | |
| Threads | Feed (Portrait) | 1080 | 1350 | 4:5 |
---
About
This reference is maintained by Branding5 and published under the MIT license.
Need to generate social assets that are on-brand and correctly sized? Branding5 combines your brand kit with AI to produce ready-to-publish content for every platform above.
- Interactive tool: branding5.com/tools/social-media-cheat-sheet
- Try the app free: app.branding5.com
MIT License
Copyright (c) 2025 Branding5
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
{
"name": "@branding5/social-media-image-sizes",
"version": "1.0.0",
"description": "Check and resize images for social media platforms. CLI tools for AI agents.",
"license": "MIT",
"author": "Branding5 (https://www.branding5.com)",
"homepage": "https://github.com/Branding5/social-media-image-sizes",
"repository": {
"type": "git",
"url": "https://github.com/Branding5/social-media-image-sizes"
},
"scripts": {
"check": "node scripts/check.js",
"resize": "node scripts/resize.js"
},
"dependencies": {
"sharp": "^0.33.0"
},
"engines": {
"node": ">=18"
}
}
Social Media Image Sizes
Free, open-source AI agent skill from Branding5.
Check and resize images for every major social media platform.
Validates image dimensions against 60+ specs across Instagram, Facebook, X (Twitter), LinkedIn, TikTok, YouTube, Pinterest, Snapchat, and Threads. Outputs a ranked match list and generates correctly-sized exports via sharp.
Install:
npx skills add Branding5/social-media-image-sizesUse when a user asks:
- _"Is this image the right size for Instagram?"_
- _"Resize this photo for a LinkedIn banner"_
- _"What size should my YouTube thumbnail be?"_
- _"Prep these assets for Facebook ads"_
- _"Check if my image fits the TikTok spec"_
Check an image:
node scripts/check.js image.png!check output
Resize to a named spec:
node scripts/resize.js image.png "Instagram Profile Photo"!resize output
Platforms covered:
| Platform | Specs |
|---|---|
| Profile, Feed (portrait/square/landscape), Stories, Reels, Carousel, Ads | |
| Profile, Cover, Feed, Stories, Reels, Events, Groups, Ads | |
| X (Twitter) | Profile, Header, Posts, Cards, Ads |
| Profile, Background, Company, Feed, Articles, Newsletters, Ads | |
| TikTok | Profile, Videos, Ads |
| YouTube | Profile, Banner, Thumbnails, Shorts, Community, Ads |
| Profile, Boards, Standard/Square/Long/Idea Pins, Ads | |
| Snapchat | Snaps, Spotlight, Stories, Ads, Filters/Lenses |
| Threads | Profile, Posts |
→ View skill · Full reference · Interactive tool
---
Installation
npx skills add Branding5/social-media-image-sizesInstall globally so it's available in every project:
npx skills add Branding5/social-media-image-sizes -gContributing
Bug reports and pull requests welcome. If a platform updates its specs, open an issue or PR against the relevant file in references/ or scripts/platform-data.js.
License
MIT — free to use, fork, and redistribute.
---
_Skills built alongside Branding5 — AI brand positioning and marketing strategy_
Social Media Image Best Practices — 2025
Choose the Right Format
| Format | Best For | Avoid When |
|---|---|---|
| JPG | Photos, complex imagery, backgrounds | Need transparency |
| PNG | Logos, graphics with transparency, text-heavy images | Large photos (file size) |
| WebP | Web delivery (smaller than JPG/PNG) | Platform doesn't support it |
| GIF | Short looping animations | High quality is required (256 colour limit) |
| MP4 | All video content | — |
Compression Guidelines
- Target 72–150 dpi for web; higher resolutions add file size without visual benefit
- Keep images under 1 MB where possible for faster load times without quality loss
- Use tools like Squoosh, TinyPNG, or ImageOptim before uploading
- Always use sRGB color profile — CMYK images render incorrectly on screens
Safe Zones
Every platform reserves UI space (navigation bars, profile info, CTAs) that can obscure your image. Keep key visuals and text inside these safe zones:
| Platform | Content Type | Safe Zone |
|---|---|---|
| Story/Reel | Center 1080 × 1420 px | |
| Story | Avoid top 14% and bottom 20% | |
| TikTok | Video | y: 150 – 1770 px |
| Snapchat | Snap/Ad | Center 1080 × 1420 px |
| YouTube | Banner | Center 1546 × 423 px |
Aspect Ratio Decision Guide
| Aspect Ratio | Common Use | Why |
|---|---|---|
| 9:16 (vertical) | Stories, Reels, TikTok, Shorts | Full-screen mobile; highest immersion |
| 4:5 (portrait) | Instagram/LinkedIn feed | More feed space than square; best engagement |
| 1:1 (square) | Universal feed posts | Safe crop on all platforms |
| 16:9 (landscape) | YouTube, X posts, article covers | Standard widescreen; desktop-friendly |
| 1.91:1 (wide) | Facebook/LinkedIn feed, Twitter cards | Standard link preview ratio |
| 2:3 (tall) | Pinterest Pins | Pinterest column format |
Accessibility
- Ensure text in images has a contrast ratio ≥ 4.5:1 against the background (WCAG AA)
- Don't rely on images alone to convey critical information — include alt text and captions
- Use readable fonts at a minimum 28–32 px equivalent for Story/Reel text overlays
- Add closed captions to videos — most platforms auto-generate them but review for accuracy
Consistency & Branding
- Use consistent padding and margins around your logo (typically 5–10% of image width)
- Maintain the same color palette and font stack across all platforms for brand recognition
- Create templates at each canonical size so the team doesn't have to remember dimensions
💡 Tip: Branding5 stores your brand kit (colors, fonts, logo) and generates on-brand social assets at the correct size for each platform automatically.
Facebook Image & Video Sizes — 2025
Profile & Cover
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Profile Photo | 170 × 170 | 1:1 | Displays 176×176 on desktop, 196×196 on smartphone |
| Cover Photo | 820 × 312 | 2.63:1 | Min 400×150. Mobile: 640×360 crop |
Cover tip: Place key content in the center 640×312 safe zone — that area is visible on both desktop and mobile.
Feed Posts
| Name | Size (px) | Aspect |
|---|---|---|
| Image Post (Landscape) | 1200 × 630 | 1.91:1 |
| Image Post (Square) | 1200 × 1200 | 1:1 |
| Image Post (Portrait) | 1080 × 1350 | 4:5 |
Stories & Reels
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Story | 1080 × 1920 | 9:16 | Leave 14% top & 20% bottom for UI chrome |
| Reel | 1080 × 1920 | 9:16 |
Events & Groups
| Name | Size (px) | Aspect |
|---|---|---|
| Event Cover | 1920 × 1005 | 1.91:1 |
| Group Cover | 1640 × 856 | 1.91:1 |
Ads
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Feed Ad | 1200 × 628 | 1.91:1 | |
| Carousel Ad | 1080 × 1080 | 1:1 | 2–10 cards |
| Right Column Ad | 1200 × 628 | 1.91:1 | |
| Marketplace Ad | 1200 × 628 | 1.91:1 |
Format & Technical Requirements
- Images: JPG or PNG
- Videos: MP4 or MOV, H.264, max 4 GB
- Color space: sRGB
- Minimum image width: 600 px
- Text in ads: Minimal text performs best; Facebook limits reach for ad images with excessive text
Instagram Image & Video Sizes — 2025
Profile
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Profile Photo | 320 × 320 | 1:1 | Displays as 110×110 on mobile |
Feed Posts
| Name | Size (px) | Aspect | Max File | Notes |
|---|---|---|---|---|
| Portrait Post | 1080 × 1350 | 4:5 | 30 MB | ✅ Best engagement |
| Square Post | 1080 × 1080 | 1:1 | 30 MB | |
| Landscape Post | 1080 × 566 | 1.91:1 | 30 MB |
Best practice: Use 4:5 portrait (1080×1350) for feed posts — portrait content occupies more screen real estate and consistently drives higher engagement.
Stories & Reels
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Story | 1080 × 1920 | 9:16 | Keep text in safe zone (center 1080×1420) |
| Reel | 1080 × 1920 | 9:16 | Cover photo: 1080×1920 |
| Reel Cover Thumbnail | 420 × 654 | 1:1.55 | Shown in grid as 1:1 crop |
Safe zone: Leave ~250 px padding top and bottom — Instagram's UI (profile pic, CTA buttons) occupies those areas.
Carousel Posts
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Carousel Square | 1080 × 1080 | 1:1 | Up to 10 slides |
| Carousel Portrait | 1080 × 1350 | 4:5 | Up to 10 slides; best engagement |
All slides in a carousel must share the same aspect ratio. The first image sets the ratio for the whole carousel.
Ads
| Name | Size (px) | Aspect |
|---|---|---|
| Feed Ad (Square) | 1080 × 1080 | 1:1 |
| Feed Ad (Landscape) | 1200 × 628 | 1.91:1 |
| Story Ad | 1080 × 1920 | 9:16 |
Format & Technical Requirements
- Images: JPG or PNG
- Videos: MP4 or MOV, H.264
- Color space: sRGB
- Max image file size: 30 MB
- Minimum image width: 320 px
- Ad text: Keep text under 20% of image area for best delivery
LinkedIn Image & Video Sizes — 2025
Profile & Cover
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Profile Photo | 400 × 400 | 1:1 | Min 200×200, max 8 MB |
| Background Photo | 1584 × 396 | 4:1 | |
| Company Logo | 300 × 300 | 1:1 | |
| Company Cover | 1128 × 191 | 5.91:1 |
Feed Posts
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Image Post (Landscape) | 1200 × 627 | 1.91:1 | |
| Image Post (Square) | 1200 × 1200 | 1:1 | |
| Image Post (Portrait) | 1080 × 1350 | 4:5 | ✅ Best engagement on feed |
Best practice: Portrait (4:5) posts take up more vertical space in the feed and consistently outperform landscape on LinkedIn engagement metrics.
Articles & Newsletters
| Name | Size (px) | Aspect |
|---|---|---|
| Article Cover | 1920 × 1080 | 16:9 |
| Newsletter Cover | 1920 × 1080 | 16:9 |
Ads
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Sponsored Content | 1200 × 627 | 1.91:1 | |
| Carousel Ad | 1080 × 1080 | 1:1 | 2–10 cards |
| Spotlight Ad Logo | 100 × 100 | 1:1 |
Format & Technical Requirements
- Images: JPG or PNG
- Videos: MP4, H.264, max 5 GB
- Max image file size: 5 MB (profile photo), 8 MB (background)
- Max video length: 10 min (organic), 30 min (ads)
- Color space: sRGB
Pinterest Image & Video Sizes — 2025
Profile
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Profile Photo | 165 × 165 | 1:1 | |
| Board Cover | 222 × 150 | 3:2 |
Pins
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Standard Pin | 1000 × 1500 | 2:3 | ✅ Optimal for feed |
| Square Pin | 1000 × 1000 | 1:1 | |
| Long Pin | 1000 × 2100 | 1:2.1 | Max ratio 1:2.1 |
| Idea Pin | 1080 × 1920 | 9:16 | Up to 20 pages |
Best practice: The 2:3 ratio (1000×1500) is Pinterest's recommended format — it fills the column perfectly without being cut off. Avoid going taller than 1:2.1 or Pinterest will crop the bottom.
Ads
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Promoted Pin | 1000 × 1500 | 2:3 | |
| Carousel Ad | 1000 × 1500 | 2:3 | 2–5 cards |
| Shopping Ad | 1000 × 1500 | 2:3 |
Format & Technical Requirements
- Images: JPG or PNG
- Videos: MP4 or MOV, H.264
- Max image file size: 20 MB
- Max video file size: 2 GB
- Video length: 4 sec – 15 min (ads: 6–15 sec recommended)
Snapchat Image & Video Sizes — 2025
Content
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Snap | 1080 × 1920 | 9:16 | |
| Spotlight | 1080 × 1920 | 9:16 | 5–60 seconds |
| Story | 1080 × 1920 | 9:16 |
Ads
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Single Image/Video Ad | 1080 × 1920 | 9:16 | |
| Collection Ad | 1080 × 1920 | 9:16 | Up to 4 tappable tiles |
| Filter / Lens | 1080 × 2340 | 9:19.5 | Full device screen |
Safe zone: Keep branding and text within the center 1080×1420 area. The top ~260 px is taken by the sender info, and the bottom ~240 px by the reply bar.
Format & Technical Requirements
- Images: JPG or PNG
- Videos: MP4 or MOV, H.264
- Max image file size: 5 MB
- Max video file size: 32 MB
- Video length: 3–180 seconds (organic), 3–180 seconds (ads)
- Frame rate: 30–60 fps recommended
Threads Image & Video Sizes — 2025
Profile
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Profile Photo | 320 × 320 | 1:1 | Same as Instagram profile |
Posts
| Name | Size (px) | Aspect |
|---|---|---|
| Image Post (Portrait) | 1080 × 1350 | 4:5 |
| Image Post (Square) | 1080 × 1080 | 1:1 |
| Image Post (Landscape) | 1080 × 566 | 1.91:1 |
Note: Threads shares its account system with Instagram. Profile photo changes on one platform update the other. The same dimension conventions apply for posts.
Format & Technical Requirements
- Images: JPG or PNG
- Videos: MP4 or MOV
- Max video length: 5 minutes
- Max image file size: 30 MB
TikTok Image & Video Sizes — 2025
Profile
| Name | Size (px) | Aspect |
|---|---|---|
| Profile Photo | 200 × 200 | 1:1 |
Videos
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Video (Full Screen) | 1080 × 1920 | 9:16 | Min 720×1280. Max 10 min. |
| Video Thumbnail | 1080 × 1920 | 9:16 | Custom thumbnail from video |
Safe zone: Keep text and important visuals between y=150 and y=1770 (avoiding the top profile area and bottom action bar).
Ads
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| In-Feed Ad | 1080 × 1920 | 9:16 | 5–60 seconds |
| TopView Ad | 1080 × 1920 | 9:16 | Up to 60 seconds; first thing users see on open |
| Spark Ad | 1080 × 1920 | 9:16 | Boosts existing organic content |
Format & Technical Requirements
- Video formats: MP4 or MOV recommended
- Codec: H.264 or H.265
- Frame rate: 23–60 fps
- Bitrate: ≥ 516 kbps
- Max video file size: 287.6 MB (iOS app), 72 MB (Android), 500 MB (web upload)
- Landscape (16:9) is also accepted but performs significantly worse than full-screen 9:16
X (Twitter) Image & Video Sizes — 2025
Profile & Header
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Profile Photo | 400 × 400 | 1:1 | Displayed as circle (200×200) |
| Header Image | 1500 × 500 | 3:1 |
Header tip: The profile photo overlaps the lower-left of the header. Keep important content away from the bottom-left 20% of the header image.
Posts
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Single Image | 1600 × 900 | 16:9 | Min 600×335. Max 5 MB (images), 15 MB (GIFs) |
| Two Images | 700 × 800 | 7:8 | Per image in a 2-image post |
| Card Image | 800 × 418 | 1.91:1 | Link preview / Twitter Card |
Feed crop: X auto-crops images in the timeline to approximately 16:9. For safe display without cropping, use 1600×900.
Ads
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Single Image Ad | 1200 × 675 | 16:9 | |
| Carousel Ad | 800 × 800 | 1:1 | 2–6 cards |
| Website Card | 800 × 418 | 1.91:1 |
Format & Technical Requirements
- Images: JPG, PNG, GIF, WebP
- Videos: MP4 or MOV, H.264
- Max image file size: 5 MB (JPEG/PNG), 15 MB (GIF)
- Max video file size: 512 MB
- Max video length: 2 min 20 sec (organic), 2 min 20 sec (ads)
YouTube Image & Video Sizes — 2025
Channel Art
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Profile Photo | 800 × 800 | 1:1 | Displays as 98×98 |
| Channel Banner | 2560 × 1440 | 16:9 | Safe area: center 1546×423 |
Banner safe zone: Only the center 1546×423 is guaranteed visible on all devices. Keep your channel name and key visuals there. The full 2560×1440 is only visible on large TVs.
Videos
| Name | Size (px) | Aspect | Notes |
|---|---|---|---|
| Video Upload (1080p) | 1920 × 1080 | 16:9 | |
| Video Upload (4K) | 3840 × 2160 | 16:9 | |
| Custom Thumbnail | 1280 × 720 | 16:9 | Min 640×360. Max 2 MB |
| Shorts | 1080 × 1920 | 9:16 | Up to 60 seconds |
Thumbnail: Use 1280×720 JPG or PNG. Thumbnails are one of the biggest factors in click-through rate — use high contrast and readable text at small sizes.
Community & Ads
| Name | Size (px) | Aspect |
|---|---|---|
| Community Post Image | 1200 × 675 | 16:9 |
| Display Ad | 300 × 250 | 6:5 |
| Overlay Ad | 480 × 70 | 48:7 |
Format & Technical Requirements
- Video formats: MP4 (recommended), MOV, AVI, WMV, FLV, WebM
- Codec: H.264
- Max file size: 256 GB or 12 hours
- Thumbnail formats: JPG, PNG, GIF, BMP — max 2 MB
- Frame rate: 24, 25, 30, 48, 50, or 60 fps
#!/usr/bin/env node
/**
* check.js — validate an image against social media platform specs
*
* Usage:
* node check.js <image-path> [--platform <slug>] [--filter perfect|close|usable|too-small]
*
* Examples:
* node check.js photo.jpg
* node check.js banner.png --platform linkedin
* node check.js story.jpg --filter perfect
*/
const fs = require('fs');
const path = require('path');
const { getAllSpecs } = require('./platform-data');
// ─── argument parsing ──────────────────────────────────────────────────────────
const args = process.argv.slice(2);
const imgPath = args.find(a => !a.startsWith('--'));
if (!imgPath) {
console.error('Usage: node check.js <image-path> [--platform <slug>] [--filter perfect|close|usable|too-small]');
process.exit(1);
}
if (!fs.existsSync(imgPath)) {
console.error(`File not found: ${imgPath}`);
process.exit(1);
}
const platformFlag = args.includes('--platform') ? args[args.indexOf('--platform') + 1] : null;
const filterFlag = args.includes('--filter') ? args[args.indexOf('--filter') + 1] : null;
// ─── read image dimensions ─────────────────────────────────────────────────────
let sharp;
try {
sharp = require('sharp');
} catch {
console.error('sharp is not installed. Run: npm install');
process.exit(1);
}
async function run() {
const meta = await sharp(imgPath).metadata();
const { width, height } = meta;
const fileSize = fs.statSync(imgPath).size;
const aspect = (width / height).toFixed(2);
// ─── classify ───────────────────────────────────────────────────────────────
function classify(imgW, imgH, specW, specH) {
const wRatio = imgW / specW;
const hRatio = imgH / specH;
if (Math.abs(wRatio - 1) <= 0.02 && Math.abs(hRatio - 1) <= 0.02) return 'perfect';
const imgAsp = imgW / imgH;
const specAsp = specW / specH;
const aspDiff = Math.abs(imgAsp - specAsp) / specAsp;
if (aspDiff <= 0.03 && wRatio >= 0.9 && hRatio >= 0.9) return 'close';
if (imgW >= specW && imgH >= specH) return 'usable';
return 'too-small';
}
const LEVEL_ORDER = { perfect: 0, close: 1, usable: 2, 'too-small': 3 };
const LEVEL_ICON = { perfect: '✅', close: '🟡', usable: '🔄', 'too-small': '❌' };
const LEVEL_LABEL = { perfect: 'PERFECT', close: 'CLOSE (scale only)', usable: 'USABLE (will crop)', 'too-small': 'TOO SMALL' };
let specs = getAllSpecs();
if (platformFlag) specs = specs.filter(s => s.slug === platformFlag);
const results = specs
.map(s => ({ ...s, level: classify(width, height, s.width, s.height) }))
.filter(s => !filterFlag || s.level === filterFlag)
.sort((a, b) => LEVEL_ORDER[a.level] - LEVEL_ORDER[b.level]);
// ─── output ─────────────────────────────────────────────────────────────────
const bar = '─'.repeat(60);
console.log(`\n${bar}`);
console.log(` 📐 ${path.basename(imgPath)}`);
console.log(` ${width} × ${height} px (${aspect}:1) • ${formatSize(fileSize)}`);
console.log(bar);
if (results.length === 0) {
console.log('\n No matches found.\n');
} else {
let lastLevel = null;
for (const r of results) {
if (r.level !== lastLevel) {
console.log(`\n ${LEVEL_ICON[r.level]} ${LEVEL_LABEL[r.level]}`);
lastLevel = r.level;
}
const sizeStr = `${r.width}×${r.height}`;
const noteStr = r.notes ? ` · ${r.notes}` : '';
const resizeHint = r.level !== 'perfect'
? ` → node scripts/resize.js ${imgPath} "${r.platform} ${r.name}"`
: '';
console.log(` ${r.platform.padEnd(12)} ${r.category.padEnd(20)} ${r.name.padEnd(28)} ${sizeStr.padEnd(12)} ${r.aspect}${noteStr}${resizeHint}`);
}
}
// counts
const counts = {};
for (const l of ['perfect','close','usable','too-small']) counts[l] = results.filter(r => r.level === l).length;
console.log(`\n${bar}`);
console.log(` ✅ ${counts.perfect} perfect 🟡 ${counts.close} close 🔄 ${counts.usable} usable ❌ ${counts['too-small']} too small`);
console.log(` Full reference → branding5.com/tools/social-media-cheat-sheet`);
console.log(`${bar}\n`);
}
function formatSize(bytes) {
if (bytes < 1024) return `${bytes} B`;
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
}
run().catch(e => { console.error(e.message); process.exit(1); });
// Social media platform specs — matches branding5.com/tools/social-media-cheat-sheet
// Updated 2025
const platforms = [
{
name: 'Instagram', slug: 'instagram',
categories: [
{ name: 'Profile', sizes: [
{ name: 'Profile Photo', width: 320, height: 320, aspect: '1:1', notes: 'Displays as 110×110 on mobile' }
]},
{ name: 'Feed Posts', sizes: [
{ name: 'Portrait Post', width: 1080, height: 1350, aspect: '4:5', maxFileSize: '30MB', notes: 'Best for engagement' },
{ name: 'Square Post', width: 1080, height: 1080, aspect: '1:1', maxFileSize: '30MB' },
{ name: 'Landscape Post', width: 1080, height: 566, aspect: '1.91:1', maxFileSize: '30MB' }
]},
{ name: 'Stories & Reels', sizes: [
{ name: 'Story', width: 1080, height: 1920, aspect: '9:16', notes: 'Keep text in safe zone (center 1080×1420)' },
{ name: 'Reel', width: 1080, height: 1920, aspect: '9:16', notes: 'Cover photo: 1080×1920' },
{ name: 'Reel Cover Thumbnail', width: 420, height: 654, aspect: '1:1.55', notes: 'Shown in grid as 1:1 crop' }
]},
{ name: 'Carousel', sizes: [
{ name: 'Carousel Square', width: 1080, height: 1080, aspect: '1:1', notes: 'Up to 10 slides' },
{ name: 'Carousel Portrait', width: 1080, height: 1350, aspect: '4:5', notes: 'Up to 10 slides; best engagement' }
]},
{ name: 'Ads', sizes: [
{ name: 'Feed Ad (Square)', width: 1080, height: 1080, aspect: '1:1' },
{ name: 'Feed Ad (Landscape)', width: 1200, height: 628, aspect: '1.91:1' },
{ name: 'Story Ad', width: 1080, height: 1920, aspect: '9:16' }
]}
]
},
{
name: 'Facebook', slug: 'facebook',
categories: [
{ name: 'Profile & Cover', sizes: [
{ name: 'Profile Photo', width: 170, height: 170, aspect: '1:1', notes: 'Displays 176×176 on desktop, 196×196 on smartphones' },
{ name: 'Cover Photo', width: 820, height: 312, aspect: '2.63:1', notes: 'Min 400×150. Displays at 820×312 on desktop, 640×360 on mobile' }
]},
{ name: 'Feed Posts', sizes: [
{ name: 'Image Post (Landscape)', width: 1200, height: 630, aspect: '1.91:1' },
{ name: 'Image Post (Square)', width: 1200, height: 1200, aspect: '1:1' },
{ name: 'Image Post (Portrait)', width: 1080, height: 1350, aspect: '4:5' }
]},
{ name: 'Stories & Reels', sizes: [
{ name: 'Story', width: 1080, height: 1920, aspect: '9:16', notes: 'Leave 14% top & 20% bottom for UI' },
{ name: 'Reel', width: 1080, height: 1920, aspect: '9:16' }
]},
{ name: 'Events & Groups', sizes: [
{ name: 'Event Cover', width: 1920, height: 1005, aspect: '1.91:1' },
{ name: 'Group Cover', width: 1640, height: 856, aspect: '1.91:1' }
]},
{ name: 'Ads', sizes: [
{ name: 'Feed Ad', width: 1200, height: 628, aspect: '1.91:1' },
{ name: 'Carousel Ad', width: 1080, height: 1080, aspect: '1:1', notes: '2–10 cards' },
{ name: 'Right Column Ad', width: 1200, height: 628, aspect: '1.91:1' },
{ name: 'Marketplace Ad', width: 1200, height: 628, aspect: '1.91:1' }
]}
]
},
{
name: 'X (Twitter)', slug: 'twitter',
categories: [
{ name: 'Profile & Header', sizes: [
{ name: 'Profile Photo', width: 400, height: 400, aspect: '1:1', notes: 'Displayed as circle, 200×200' },
{ name: 'Header Image', width: 1500, height: 500, aspect: '3:1' }
]},
{ name: 'Posts', sizes: [
{ name: 'Single Image', width: 1600, height: 900, aspect: '16:9', notes: 'Min 600×335. Max 5MB (images), 15MB (GIFs)' },
{ name: 'Two Images', width: 700, height: 800, aspect: '7:8', notes: 'Per image in 2-image post' },
{ name: 'Card Image', width: 800, height: 418, aspect: '1.91:1', notes: 'Link preview cards' }
]},
{ name: 'Ads', sizes: [
{ name: 'Single Image Ad', width: 1200, height: 675, aspect: '16:9' },
{ name: 'Carousel Ad', width: 800, height: 800, aspect: '1:1', notes: '2–6 cards' },
{ name: 'Website Card', width: 800, height: 418, aspect: '1.91:1' }
]}
]
},
{
name: 'LinkedIn', slug: 'linkedin',
categories: [
{ name: 'Profile & Cover', sizes: [
{ name: 'Profile Photo', width: 400, height: 400, aspect: '1:1', notes: 'Min 200×200, max 8MB' },
{ name: 'Background Photo', width: 1584, height: 396, aspect: '4:1' },
{ name: 'Company Logo', width: 300, height: 300, aspect: '1:1' },
{ name: 'Company Cover', width: 1128, height: 191, aspect: '5.91:1' }
]},
{ name: 'Feed Posts', sizes: [
{ name: 'Image Post (Landscape)', width: 1200, height: 627, aspect: '1.91:1' },
{ name: 'Image Post (Square)', width: 1200, height: 1200, aspect: '1:1' },
{ name: 'Image Post (Portrait)', width: 1080, height: 1350, aspect: '4:5', notes: 'Best engagement on feed' }
]},
{ name: 'Articles & Newsletters', sizes: [
{ name: 'Article Cover', width: 1920, height: 1080, aspect: '16:9' },
{ name: 'Newsletter Cover', width: 1920, height: 1080, aspect: '16:9' }
]},
{ name: 'Ads', sizes: [
{ name: 'Sponsored Content', width: 1200, height: 627, aspect: '1.91:1' },
{ name: 'Carousel Ad', width: 1080, height: 1080, aspect: '1:1', notes: '2–10 cards' },
{ name: 'Spotlight Ad Logo', width: 100, height: 100, aspect: '1:1' }
]}
]
},
{
name: 'TikTok', slug: 'tiktok',
categories: [
{ name: 'Profile', sizes: [
{ name: 'Profile Photo', width: 200, height: 200, aspect: '1:1' }
]},
{ name: 'Videos', sizes: [
{ name: 'Video (Full Screen)', width: 1080, height: 1920, aspect: '9:16', notes: 'Min 720×1280. Max 10 min.' },
{ name: 'Video Thumbnail', width: 1080, height: 1920, aspect: '9:16', notes: 'Custom thumbnail from video' }
]},
{ name: 'Ads', sizes: [
{ name: 'In-Feed Ad', width: 1080, height: 1920, aspect: '9:16', notes: '5–60 seconds' },
{ name: 'TopView Ad', width: 1080, height: 1920, aspect: '9:16', notes: 'Up to 60 seconds' },
{ name: 'Spark Ad', width: 1080, height: 1920, aspect: '9:16', notes: 'Boosted organic content' }
]}
]
},
{
name: 'YouTube', slug: 'youtube',
categories: [
{ name: 'Channel Art', sizes: [
{ name: 'Profile Photo', width: 800, height: 800, aspect: '1:1', notes: 'Displays as 98×98' },
{ name: 'Channel Banner', width: 2560, height: 1440, aspect: '16:9', notes: 'Safe area: 1546×423 (center)' }
]},
{ name: 'Videos', sizes: [
{ name: 'Video Upload (1080p)', width: 1920, height: 1080, aspect: '16:9' },
{ name: 'Video Upload (4K)', width: 3840, height: 2160, aspect: '16:9' },
{ name: 'Custom Thumbnail', width: 1280, height: 720, aspect: '16:9', notes: 'Min 640×360. Max 2MB' },
{ name: 'Shorts', width: 1080, height: 1920, aspect: '9:16', notes: 'Up to 60 seconds' }
]},
{ name: 'Community & Ads', sizes: [
{ name: 'Community Post Image', width: 1200, height: 675, aspect: '16:9' },
{ name: 'Display Ad', width: 300, height: 250, aspect: '6:5' },
{ name: 'Overlay Ad', width: 480, height: 70, aspect: '48:7' }
]}
]
},
{
name: 'Pinterest', slug: 'pinterest',
categories: [
{ name: 'Profile', sizes: [
{ name: 'Profile Photo', width: 165, height: 165, aspect: '1:1' },
{ name: 'Board Cover', width: 222, height: 150, aspect: '3:2' }
]},
{ name: 'Pins', sizes: [
{ name: 'Standard Pin', width: 1000, height: 1500, aspect: '2:3', notes: 'Optimal ratio for feed' },
{ name: 'Square Pin', width: 1000, height: 1000, aspect: '1:1' },
{ name: 'Long Pin', width: 1000, height: 2100, aspect: '1:2.1', notes: 'Max ratio 1:2.1' },
{ name: 'Idea Pin', width: 1080, height: 1920, aspect: '9:16', notes: 'Up to 20 pages' }
]},
{ name: 'Ads', sizes: [
{ name: 'Promoted Pin', width: 1000, height: 1500, aspect: '2:3' },
{ name: 'Carousel Ad', width: 1000, height: 1500, aspect: '2:3', notes: '2–5 cards' },
{ name: 'Shopping Ad', width: 1000, height: 1500, aspect: '2:3' }
]}
]
},
{
name: 'Snapchat', slug: 'snapchat',
categories: [
{ name: 'Content', sizes: [
{ name: 'Snap', width: 1080, height: 1920, aspect: '9:16' },
{ name: 'Spotlight', width: 1080, height: 1920, aspect: '9:16', notes: '5–60 seconds' },
{ name: 'Story', width: 1080, height: 1920, aspect: '9:16' }
]},
{ name: 'Ads', sizes: [
{ name: 'Single Image/Video Ad', width: 1080, height: 1920, aspect: '9:16' },
{ name: 'Collection Ad', width: 1080, height: 1920, aspect: '9:16', notes: 'Up to 4 tappable tiles' },
{ name: 'Filter/Lens', width: 1080, height: 2340, aspect: '9:19.5', notes: 'Full device screen' }
]}
]
},
{
name: 'Threads', slug: 'threads',
categories: [
{ name: 'Profile', sizes: [
{ name: 'Profile Photo', width: 320, height: 320, aspect: '1:1', notes: 'Same as Instagram profile' }
]},
{ name: 'Posts', sizes: [
{ name: 'Image Post (Square)', width: 1080, height: 1080, aspect: '1:1' },
{ name: 'Image Post (Landscape)', width: 1080, height: 566, aspect: '1.91:1' },
{ name: 'Image Post (Portrait)', width: 1080, height: 1350, aspect: '4:5' }
]}
]
}
];
// Flat list of all specs with platform/category context — useful for check.js
function getAllSpecs() {
const specs = [];
for (const platform of platforms) {
for (const category of platform.categories) {
for (const size of category.sizes) {
specs.push({ platform: platform.name, slug: platform.slug, category: category.name, ...size });
}
}
}
return specs;
}
// Generate a slug-style key for resize.js targeting, e.g. "instagram-portrait-post"
function getSpecKey(platformName, sizeName) {
return `${platformName}-${sizeName}`.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
}
module.exports = { platforms, getAllSpecs, getSpecKey };
#!/usr/bin/env node
/**
* resize.js — resize an image to a named social media spec
*
* Usage:
* node resize.js <image-path> "<Platform> <Size Name>" [options]
* node resize.js <image-path> --list # list all available spec names
*
* Options:
* --fit cover Center-crop to fill exact dimensions (default)
* --fit contain Letterbox — scale to fit, pad with background color
* --bg <hex> Background color for contain mode (default: ffffff)
* --out <path> Output file path (default: auto-named alongside input)
*
* Examples:
* node resize.js photo.jpg "Instagram Portrait Post"
* node resize.js photo.jpg "YouTube Custom Thumbnail"
* node resize.js banner.png "LinkedIn Background Photo" --fit contain --bg 000000
* node resize.js photo.jpg "Instagram Portrait Post" --out ./exports/ig-portrait.jpg
*/
const fs = require('fs');
const path = require('path');
const { getAllSpecs } = require('./platform-data');
// ─── argument parsing ──────────────────────────────────────────────────────────
const args = process.argv.slice(2);
const imgPath = args[0];
if (!imgPath || imgPath.startsWith('--')) {
printUsage();
process.exit(1);
}
if (args.includes('--list')) {
listSpecs();
process.exit(0);
}
const specQuery = args[1];
if (!specQuery || specQuery.startsWith('--')) {
printUsage();
process.exit(1);
}
if (!fs.existsSync(imgPath)) {
console.error(`File not found: ${imgPath}`);
process.exit(1);
}
const fitRaw = args.includes('--fit') ? args[args.indexOf('--fit') + 1] : 'cover';
const fitMode = ['cover', 'contain'].includes(fitRaw) ? fitRaw : (() => { console.error(`Invalid --fit value: "${fitRaw}". Use "cover" or "contain".`); process.exit(1); })();
const bgColor = args.includes('--bg') ? args[args.indexOf('--bg') + 1] : 'ffffff';
const outArg = args.includes('--out') ? args[args.indexOf('--out') + 1] : null;
// ─── helpers ───────────────────────────────────────────────────────────────────
function listSpecs() {
const specs = getAllSpecs();
console.log('\nAvailable specs (use as second argument):\n');
let lastPlatform = null;
for (const s of specs) {
if (s.platform !== lastPlatform) {
console.log(` ${s.platform}`);
lastPlatform = s.platform;
}
console.log(` "${s.platform} ${s.name}" → ${s.width}×${s.height} (${s.aspect})`);
}
console.log('');
}
function findSpec(query) {
const specs = getAllSpecs();
const q = query.toLowerCase().trim();
// exact match first
let match = specs.find(s => `${s.platform} ${s.name}`.toLowerCase() === q);
if (match) return match;
// partial match
match = specs.find(s => `${s.platform} ${s.name}`.toLowerCase().includes(q));
if (match) return match;
// fuzzy: all words present
const words = q.split(/\s+/);
match = specs.find(s => {
const hay = `${s.platform} ${s.category} ${s.name}`.toLowerCase();
return words.every(w => hay.includes(w));
});
return match || null;
}
function buildOutputPath(inputPath, spec) {
const ext = path.extname(inputPath) || '.jpg';
const base = path.basename(inputPath, ext);
const suffix = `${spec.platform}-${spec.name}`.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
const dir = path.dirname(inputPath);
return path.join(dir, `${base}-${suffix}${ext}`);
}
function printUsage() {
console.log('Usage: node resize.js <image-path> "<Platform> <Size Name>" [--fit cover|contain] [--bg hex] [--out path]');
console.log(' node resize.js <image-path> --list');
}
function hexToRgb(hex) {
let h = hex.replace(/^#/, '');
if (h.length === 3) h = h[0] + h[0] + h[1] + h[1] + h[2] + h[2];
if (!/^[0-9a-fA-F]{6}$/.test(h)) {
console.error(`Invalid --bg hex color: "${hex}". Use a 3- or 6-digit hex value (e.g. fff or f0f0f0).`);
process.exit(1);
}
return {
r: parseInt(h.substring(0, 2), 16),
g: parseInt(h.substring(2, 4), 16),
b: parseInt(h.substring(4, 6), 16)
};
}
// ─── main ──────────────────────────────────────────────────────────────────────
let sharp;
try {
sharp = require('sharp');
} catch {
console.error('sharp is not installed. Run: npm install');
process.exit(1);
}
async function run() {
const spec = findSpec(specQuery);
if (!spec) {
console.error(`\nSpec not found: "${specQuery}"`);
console.error('Run: node resize.js <image> --list\n');
process.exit(1);
}
const outPath = outArg || buildOutputPath(imgPath, spec);
const outDir = path.dirname(outPath);
if (!fs.existsSync(outDir)) fs.mkdirSync(outDir, { recursive: true });
const { width: W, height: H } = spec;
let pipeline = sharp(imgPath);
if (fitMode === 'contain') {
const rgb = hexToRgb(bgColor);
pipeline = pipeline.resize(W, H, {
fit: 'contain',
background: { r: rgb.r, g: rgb.g, b: rgb.b, alpha: 1 }
});
} else {
// default: cover (center crop)
pipeline = pipeline.resize(W, H, {
fit: 'cover',
position: 'centre'
});
}
// preserve format from extension
const ext = path.extname(outPath).toLowerCase();
if (ext === '.png') pipeline = pipeline.png({ quality: 90 });
else if (ext === '.webp') pipeline = pipeline.webp({ quality: 85 });
else pipeline = pipeline.jpeg({ quality: 90, mozjpeg: true });
await pipeline.toFile(outPath);
const outSize = fs.statSync(outPath).size;
console.log(`\n✅ ${path.basename(outPath)}`);
console.log(` ${W} × ${H} px (${spec.aspect}) • ${formatSize(outSize)}`);
console.log(` ${spec.platform} — ${spec.category} — ${spec.name}`);
if (spec.notes) console.log(` 💡 ${spec.notes}`);
console.log(` Saved to: ${outPath}\n`);
}
function formatSize(bytes) {
if (bytes < 1024) return `${bytes} B`;
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
}
run().catch(e => { console.error(e.message); process.exit(1); });
Related skills
FAQ
What does social-media-image-sizes do?
Check and resize images for social media platforms. Run scripts/check.js to validate any image against specs for Instagram, Facebook, X (Twitter), LinkedIn, TikTok, YouTube, Pinterest, Snapchat, and Threads - get a ranke
When should I use social-media-image-sizes?
When you need social media image sizes help per SKILL.md.
Is social-media-image-sizes safe to install?
Review the Security Audits panel on this page before installing in production.