Compress Video Under 25MB for Gmail With FFmpeg

Sep 19, 2026

Gmail's documented attachment limit for personal accounts is 25 MB, and it applies to your total attachment size — not to each file. Google's wording is exact about that: "If your total attachment size is greater than the limit, Gmail automatically removes the attachment and adds it as a Google Drive link in the email." Three 10 MB clips in one message are over the line even though no single file is.

That one sentence decides how you should compress. You are not encoding to 25 MB — you are encoding to a budget you chose, some distance below it.

Pick a target size before you touch the encoder

Two documented reasons to leave headroom.

The limit is a budget for the whole message. A second clip, an embedded image, a PDF — all of it lands in the same number, because Google measures "your total attachment size."

Google does not say which side of encoding the personal limit sits on. The phrase "before encoding" does appear in Google's documentation, but on the Workspace admin page, attached to that product's sending limits: "These values are the limits on the total size of the message content and attachments before encoding." The Gmail Help page that gives personal accounts their 25 MB says nothing about encoding in either direction.

This matters because of a number you have certainly seen repeated: that you can "really" only send about 17 to 18 MB. That figure has no official source. It is a third-party back-calculation from a different statement on a different page — Google's Workspace receiving limits, where the note reads "These values are the limit after encoding, which adds about a 37% increase." Receiving, not sending; Workspace editions, not personal Gmail. Google's documentation does not apply that increase to personal sending, so treat it as a reason the ceiling is uncertain — not as a second, lower ceiling you can aim at.

The practical move: choose a round budget under 25 MB, encode to it, and check the size on disk. 20 MB is a sensible working number — it leaves room for the rest of the message and for whatever the encoder overshoots by.

The arithmetic

File size is bitrate multiplied by duration, so a target size converts directly into a target bitrate. Using 1 MB as 1,000,000 bytes:

  1. Get the duration. ffprobe input.mp4 prints it, along with every stream in the container.
  2. Turn your budget into bits: MB × 8,000,000.
  3. Divide by the duration in seconds. That is your total bitrate budget.
  4. Subtract the audio bitrate you plan to use. What is left is the video bitrate.
  5. Round down. Container overhead and encoder variance both push the real file up, never down.

A three-minute clip at a 20 MB budget: 20 × 8,000,000 = 160,000,000 bits, divided by 180 seconds, is about 888 kbps for everything. Hold back 96 kbps for audio and round down, and the video gets roughly 750 kbps.

The command

ffmpeg -i input.mp4 -c:v libx264 -b:v 750k -c:a aac -b:a 96k output.mp4

Substitute your own two bitrates from the arithmetic above. Then measure the result on disk — that number, not your target, is what Gmail adds up.

One caveat about every encoder option in that line, including the ones a dozen other pages will hand you with confident quality values attached. FFmpeg's own documentation site carries this warning: "The following documentation is regenerated nightly, and corresponds to the newest FFmpeg revision. Consult your locally installed documentation for older versions." Option names, defaults and accepted ranges move between releases. Confirm what your build actually supports with ffmpeg -h encoder=libx264, and take quality settings from the official FFmpeg documentation for the encoder you are using rather than from a blog post — this one included. More command breakdowns live in the FFmpeg guides hub.

Try it right here

Runs in your browser. Your file is not uploaded anywhere.

Loading tool…

That runs in the browser tab: the file is read from disk, re-encoded locally, and handed back without being uploaded anywhere — the right path for a one-off, or for a recording you would rather not hand to a third-party server on the way to the recipient. If you want the knobs instead of a preset, the video compressor exposes them.

What re-encoding buys you, and what copying does not

If you are tempted to avoid re-encoding entirely, FFmpeg's documentation is precise about what that path can do. Stream copy is "copying one input elementary stream's packets without decoding, filtering, or encoding them," and the payoff is stated as a guarantee: "Since there is no decoding or encoding, it is very fast and there is no quality loss."

The documented scope is narrow, and it is the whole list: stream copy is useful for "changing the elementary stream count, container format, or modifying container-level metadata." No encoder is in the path, so it cannot change a stream's resolution, codec or bitrate. It will not bring an oversized clip under 25 MB by itself — every megabyte you need has to come out of a stream you actually re-encode.

One flag to know before you start selecting streams by hand: -map is all or nothing. Per the documentation, "When -map is used, only user-mapped streams are included in that output file, with one possible exception for filtergraph outputs." Forget to list a stream and it is dropped silently — a quiet way to email someone a video with no audio.

Variations

Only the picture needs shrinking. If the audio track is already small, re-encode video and copy audio with -c:a copy. That is the stream copy path, with its documented guarantee of no quality loss on the copied stream — and its documented catch: the entire size budget now comes out of the video.

Nobody needs to see the picture. For a recorded call or an interview, audio alone is a fraction of the size and clears 25 MB easily. The audio extractor does this in the browser.

Do not zip it first. Gmail blocks "certain types of files, including their compressed form (like .gz or .bz2 files) or when found within archives (like .zip or .tgz files)", along with "documents with malicious macros" and "password-protected archives with archived content". Note also what is not on Google's blocked-extension list: no common video or audio extension appears on it, though .img and .iso do — so a disc image of your footage fails for reasons unrelated to size. Google adds that it "often updates the types of files not allowed", so check the current list in the official documentation.

Troubleshooting

The file is under the limit and Gmail still will not send it. Size is not the only gate. Google states that "attachments count toward your Google storage. Storage is shared across Drive, Photos, and Gmail. If you reach your storage limit, you can't send or receive attachments." The Drive documentation says the same from the other side. Check your storage before you re-encode again.

Gmail replaced my attachment with a link. That is the documented behaviour, not a failure — Gmail "automatically removes the attachment and adds it as a Google Drive link in the email." What changes is which rulebook applies: the file is now governed by Drive's sharing settings, and it occupies your Google storage. See what happens when Gmail turns your attachment into a Drive link.

The recipient cannot open the link. Google lists three cases where a file kept private stays invisible: they "don't have a Google Account", "the email address you used isn't a Google account", or "they got the message through a mailing list (unless the mailing list is managed through Google Groups and the file is shared with the Group)".

This is a work or school account. Then 25 MB may not be your number at all. Google says that "for work and school accounts, your Google Workspace administrator sets the attachment sending limits and attachment receiving limits."

FAQ

What size video can I attach to a Gmail message? For personal Gmail accounts, the documented limit is 25 MB, measured as your total attachment size across the message. For work and school accounts, the administrator sets both the sending and receiving limits.

Is the real Gmail limit actually 17 MB or 18 MB? Google's documentation does not state that. The "about a 37% increase" those figures are derived from appears on Google's Workspace receiving limits page and is described there as an after-encoding measurement for Enterprise editions. Nothing official applies it to personal sending — which is exactly why aiming at 20 MB rather than 25 MB is worth the two minutes.

Does Gmail compress my video for me? Google's attachment pages say nothing about transcoding or compressing attachments. The behaviour they do document is replacement: oversized attachments become Drive links. Compress it yourself before it leaves your machine.

What bitrate should I use to hit a target size? Multiply your budget in MB by 8,000,000 to get bits, divide by the clip's duration in seconds, subtract your audio bitrate, and round down. For quality-based options such as CRF and preset, check the official FFmpeg documentation for your encoder and your own build.

Should I split the video into parts instead? It rarely helps here, because the cap counts your total attachment size per message — splitting into three files in one email changes nothing. Separate emails work but give the recipient a worse experience than one compressed clip.


Gmail and Drive limits cited from Google's Gmail attachment help, blocked file types, Workspace sending limits and Workspace receiving limits, checked 16 September 2026. FFmpeg quotes from the official documentation. More on the cap itself in Gmail's attachment size limit, or browse all Clapr tools.

Clapr team

Clapr team

Compress Video Under 25MB for Gmail With FFmpeg | Clapr Blog