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.

Try the Compress to KB

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

  1. 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.
  2. Check your instance’s published media limits or Instance API image_size_limit if you are unsure whether 16 MB applies on your server.
  3. Measure pixel dimensions and megapixels — downscale toward 8.3 MP or 3840×2160 when the source exceeds Mastodon’s downscale guidance.
  4. Pick PNG, JPG, HEIF, WEBP, or AVIF per docs; export a still image your client accepts under the byte budget.
  5. 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.
  6. 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

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

All compress to kb guides