Compress to KB topic guide
Compress images for Mastodon: hit the 16 MB post attachment limit
Direct answer
When you attach still images to a Mastodon post, Mastodon’s user documentation publishes file-size, format, and resolution rules for attachments — not optional display hints alone. Mastodon docs — Posting to your profile → Attachments → Files state that images (PNG, JPG, HEIF, WEBP, AVIF) may be up to 16 MB, that images will be downscaled to 8.3 megapixels (enough for a 3840×2160 image), and that up to four images can be attached per post. If your export exceeds those caps, compress and resize before you upload. This page is byte and megapixel prep for Mastodon post attachments — not Bluesky’s 2 MB post embed blobs, Discord’s 20 MB chat files, or X’s 5 MB still-image API paths.
What this workflow handles
Treat Mastodon’s published 16 MB ceiling as your byte budget for still-image post attachments. Mastodon user docs — Attachments → Files: images (PNG, JPG, HEIF, WEBP, AVIF) up to 16 MB; downscaled to 8.3 megapixels (enough for 3840×2160); up to four images per post. Animated GIFs (GIFV) may be up to 16 MB and are converted to soundless MP4s; GIF dimensions must be less than 1 megapixel (1280×720); only one animated GIF per post. Static GIF files follow the same limits as animated GIFs; if upload issues persist, docs suggest converting to another supported image format. Soundless MP4 or WebM may be used as GIF-like attachments under the same animated rules. The user-facing docs state 16 MB, but Mastodon’s Instance API documents configuration.media_attachments.image_size_limit as the per-instance maximum upload size in bytes — some instances may set a lower limit than 16 MB. If uploads fail under 16 MB, check your instance’s published media limits or Instance API configuration rather than assuming a universal byte cap. Set Compress to KB comfortably under 16384 KB (16 × 1024); the limit is a ceiling, not a target. Quality-sweep at current dimensions first; downscale when megapixels exceed the ~8.3 MP / 3840×2160 guidance or when the quality floor still exceeds your byte budget. compress-image-for-bluesky covers Bluesky post embeds at 2,000,000 bytes (2 MB) per image blob with up to four images — a much stricter per-file ceiling. compress-image-for-discord covers Discord Support 20 MB free chat attachments. compress-image-for-twitter covers X API 5 MB still-image uploads. compress-image-for-threads covers Threads API 8 MB JPEG/PNG image posts. Video and audio attachment limits in Mastodon docs are separate from this still-image guide. web.dev’s compress-images guide recommends experimenting with quality rather than assuming one universal setting. Beita’s Compress to KB uses a temporary analysis upload with no long-term storage; see the Privacy Policy for retention details.
Use Compress to KB with a target comfortably under 16384 KB (Mastodon’s documented 16 MB cap is a ceiling, not a target) and downscale when megapixels exceed ~8.3 MP before you attach still images to a Mastodon post. For Bluesky’s 2 MB post embed limit, see Compress image for Bluesky. For Discord’s 20 MB chat attachment cap, see Compress image for Discord.
How to use it
- Open Mastodon docs — Posting to your profile → Attachments → Files; note 16 MB image cap, 8.3 MP downscale (3840×2160), up to four images per post, and accepted still formats.
- Check your instance’s published media limits or Instance API image_size_limit if you are unsure whether 16 MB applies on your server.
- Measure pixel dimensions and megapixels — downscale toward 8.3 MP or 3840×2160 when the source exceeds Mastodon’s downscale guidance.
- Pick PNG, JPG, HEIF, WEBP, or AVIF per docs; export a still image your client accepts under the byte budget.
- Enter a Compress to KB target comfortably under 16384 KB, quality-sweep at current dimensions first, and downscale if megapixels or the quality floor still exceed Mastodon’s published rows.
- Attach up to four images in your Mastodon client; if upload fails, re-read instance limits and megapixel rules before retrying.
Frequently asked questions
What file size limit does Mastodon publish for post attachment images?
Mastodon user docs — Posting to your profile → Attachments → Files state images (PNG, JPG, HEIF, WEBP, AVIF) may be up to 16 MB. Treat 16384 KB (16 × 1024) as the documented ceiling — set Compress to KB comfortably under that limit, not at it. Some instances may enforce a lower cap via configuration.media_attachments.image_size_limit; check your instance if uploads fail below 16 MB.
What resolution or megapixel limits apply to Mastodon image attachments?
The same Mastodon posting docs state images will be downscaled to 8.3 megapixels — enough for a 3840×2160 image. If your source exceeds that megapixel budget, downscale before upload so you control quality rather than relying on server downscaling alone.
How many images can one Mastodon post attach?
Mastodon user docs allow up to four images attached per post. Each still image still needs to meet the 16 MB (or instance-specific) byte cap and the 8.3 MP downscale guidance independently.
Which image formats does Mastodon accept for post attachments?
Mastodon posting docs list PNG, JPG, HEIF, WEBP, and AVIF for still images up to 16 MB. Animated GIF rules (GIFV, dimension limits, one animated GIF per post) and soundless MP4/WebM GIF-like attachments are documented separately in the same Attachments section — this page focuses on still PNG/JPG/HEIF/WEBP/AVIF prep.
Why might my Mastodon upload fail when the file is under 16 MB?
Mastodon is federated: the Instance API documents configuration.media_attachments.image_size_limit as the per-instance max upload size in bytes. User docs describe 16 MB, but your home instance may publish a lower limit. Megapixel downscaling to 8.3 MP can also affect very large dimensions even when bytes look fine. Re-read your instance’s media limits or API configuration if validation fails under 16 MB.
How is Mastodon’s 16 MB cap different from Bluesky 2 MB, Discord 20 MB, or X 5 MB limits?
Different products and numbers. Bluesky post embeds cap each image blob at 2,000,000 bytes (2 MB) — see compress-image-for-bluesky. X API still-image uploads document 5 MB for JPG/PNG/GIF/WEBP — see compress-image-for-twitter. Threads API image posts allow JPEG or PNG up to 8 MB — see compress-image-for-threads. Discord Support documents 20 MB per free chat attachment — see compress-image-for-discord. Slack Help Center documents message file attachments up to 1 GB with separate inline image preview rules (25,000 px longest side, 45 million pixels total) — see compress-image-for-slack. Mastodon user docs describe 16 MB still images with 8.3 MP downscaling and up to four images per post — this page. Same Compress to KB tool; different destination rules.
What KB target should I use in Compress to KB?
Start from 16 MB = 16 × 1024 = 16384 KB as the documented byte ceiling. Enter a budget comfortably under 16384 KB (and under your instance’s limit if it is lower). Quality-sweep first at the current dimensions; downscale when megapixels exceed ~8.3 MP or when the quality floor still exceeds the budget.
Does this page cover Mastodon video or audio attachments?
Only briefly. Mastodon posting docs document separate limits for video and audio attachments. This guide focuses on still PNG, JPG, HEIF, WEBP, and AVIF image attachments where user docs publish the 16 MB and 8.3 megapixel rules.
Sources
- Mastodon Docs — Posting to your profile (Attachments): https://docs.joinmastodon.org/user/posting/ — Still images PNG/JPG/HEIF/WEBP/AVIF up to 16 MB; downscale to 8.3 MP (3840×2160); up to four images per post; GIF/GIFV and video/audio rules in same section.
- Mastodon Docs — Instance (media_attachments): https://docs.joinmastodon.org/entities/Instance/ — configuration.media_attachments.image_size_limit documents per-instance max upload size in bytes — may be lower than user-facing 16 MB.
- web.dev — Compress images: https://web.dev/articles/compress-images — Experiment with quality settings; there is no one universal compression setting.
- Pillow — Image.save (JPEG quality, optimize): https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#jpeg — JPEG quality and optimize parameters used in the quality sweep behind Compress to KB.
Explore the compress to kb topic cluster
This guide covers Mastodon post attachment still-image byte and megapixel limits before upload. Related guides cover general KB budgets, email, WhatsApp, LinkedIn share photos, Instagram Graph JPEG caps, Twitter / X still-image caps, Threads API image posts, Bluesky post embeds, TikTok Content Posting API photo transfer, Shopify admin image uploads, Notion inline image caps, WordPress Media Library caps, Facebook Help photo uploads, Pinterest web Image Pins, YouTube custom thumbnails, Discord chat attachments, and the Compress to KB tool.
Related guides
-
Compress image to KB
General hard byte-budget workflow for forms and marketplaces.
-
Compress images for email
Gmail and Outlook.com 25 MB attachment caps.
-
Compress images for WhatsApp
Meta Cloud API 5 MB JPEG/PNG image-message cap.
-
Compress images for GitHub
GitHub Docs 10 MB cap for images and GIFs on issues and pull requests.
-
Compress images for Discord
Discord Support 20 MB free per-file upload cap.
-
Compress images for Telegram bots
Telegram Bot API sendPhoto 10 MB cap for inline bot photos.
-
Compress images for LinkedIn posts
LinkedIn Help 5 MB cap for share-box photo uploads.
-
Compress images for Instagram
Instagram Graph API 8 MB JPEG cap for feed, Story, and Reels cover.
-
Compress images for Twitter / X
X API 5 MB still-image cap for Posts and DMs (animated GIF 15 MB).
-
Compress images for Notion
Notion Help 5 MB cap for inline PNG/JPG display (all plans).
-
Compress images for WordPress
WordPress Media Library 2560 px big-image threshold and PHP upload_max_filesize limits.
-
Compress images for Facebook
Meta Help Center 15 MB photo uploads; keep PNG under 1 MB to avoid pixelation.
-
Compress images for Pinterest
Pinterest Help 20 MB web Image Pin max; BMP, JPEG, PNG, TIFF, WEBP.
-
Compress images for YouTube
YouTube Help custom thumbnails: 50 MB on desktop; 50 MB mobile video, 10 MB mobile podcasts; JPG or PNG.
-
Compress images for Threads
Threads API image posts: 8 MB max JPEG or PNG; width 320–1440 px, aspect ratio up to 10:1.
-
Compress images for Bluesky
Bluesky post embeds: 2 MB max per image blob (image/*); up to 4 images; alt text required.
-
Compress images for TikTok
TikTok Content Posting API: 20 MB max WebP/JPEG per image; 1080p picture-size ceiling.
-
Compress images for Shopify
Shopify Help 20 MB product/collection and Files image uploads with megapixel rows.
-
Compress images for Slack
Slack Help 1 GB message files; inline image preview under 25,000 px longest side and 45 MP total.
-
Compress to KB tool
Set a KB target and download a file under budget.
All compress to kb guides
- Compress image to KB: hit a hard file-size limit
- Compress images for email: hit Gmail and Outlook attachment caps
- Compress images for WhatsApp: hit the 5 MB image message cap
- Compress images for GitHub: hit the 10 MB image and GIF cap
- Compress images for Discord: hit the 20 MB free upload cap
- Compress images for Telegram bots: hit the sendPhoto 10 MB cap
- Compress images for LinkedIn posts: hit the 5 MB photo share limit
- Compress images for Instagram: hit the 8 MB JPEG upload limit
- Compress images for Twitter / X: hit the 5 MB image upload limit
- Compress images for Notion: stay under the 5 MB inline limit
- Compress images for WordPress: Media Library size and big-image rules
- Compress images for Facebook: file size and format before upload
- Compress images for Pinterest: hit the 20 MB web Image Pin cap
- Compress images for YouTube: custom thumbnail file-size limits
- Compress images for Threads: hit the 8 MB image post limit
- Compress images for Bluesky: hit the 2 MB post embed limit
- Compress images for TikTok: hit the 20 MB photo upload limit
- Compress images for Shopify: hit the 20 MB and megapixel upload limits
- Compress images for Slack: byte size and inline preview limits
- Compress images for eBay: hit the 12 MB listing photo limit
- Compress images for Etsy: stay under the 1 MB upload reliability tip
- Compress images for Medium: hit the 25 MB story-editor limit
- Compress images for Google Business Profile: fit 10 KB–5 MB photo rules
- Compress images for Wix: Media Manager limits and practical upload ceilings
- Compress images for Webflow: 4 MB Assets limits and upload prep
- Compress images for Squarespace: 20 MB cap and 500 KB performance recommendation
- Compress images for Ghost: Ghost(Pro) plan caps (5 MB–1 GB) and self-hosted 50 MB nginx default
- Compress images for Gumroad: 50 MB cover limit and thumbnail prep
- Compress images for beehiiv: 5 MB newsletter uploads, 1200×630 thumbnails, and 10 MB community posts
- Compress images for Mailchimp: 1 MB Content Studio uploads, 1024 KB targets, and legacy vs new builder widths
- Compress images for Kit: smaller-than-25 MB gallery, form/LP sizes, and email look-best width
- Compress images for Klaviyo: 10 MB email ceiling, 1024 KB load targets, form 5120 KB, and full-width dimensions
- Compress images for MailerLite: 10 MB File manager, 1024 KB campaign prep, GIF 4 MB, and width rules
- Compress images for Brevo: 5 MB Content library, layout widths, and HTML/attachment contrast
- Compress images for Substack: official sizes, PNG email banners, and dimension-first prep
- Compress images for Google Ads: 5120 KB JPG/PNG assets, aspect ratios, and surface-specific rows