Upload a file
  1. base64hub
  2. File tools
  3. MP4 to Base64

MP4 to Base64

Drop an MP4 and copy a data:video/mp4;base64, URI or plain Base64 for a JSON request. The preview player confirms the clip, and the meter shows how long the string will be.

Free no sign-up, no limits Local nothing uploaded Updated Oct 27, 2026
Drop files here, paste, or pick them
Input –Output –Size –

Processed in your browser. This page cannot send your data anywhere – how we know

How to convert MP4 to Base64

  1. Drop an .mp4 file on the box or pick it with the file picker.
  2. Play it in the preview. If it does not play here, it probably will not play from a data URI in this browser either.
  3. Keep Output as on Data URI for <video> tags, or pick Plain Base64 or JSON for APIs.
  4. Copy output, or Save as .txt for big files.

Encoded length per bitrate

MP4 size is roughly bitrate × duration. For a 10-second clip:

Total bitrateFile sizeBase64 length
0.5 Mbps625,000 bytes833,336 chars
1 Mbps1,250,000 bytes1,666,668 chars
2.5 Mbps3,125,000 bytes4,166,668 chars
5 Mbps6,250,000 bytes8,333,336 chars

Phone recordings often run at 10 Mbps or more, so ten seconds of untouched phone video already produce more than 16 million characters. Re-encode at a lower resolution and bitrate first; Video to Base64 has a tested ffmpeg command for that.

The ftyp brand in the first characters

The first box of an MP4 declares a major brand, which tells players which specification the file follows. It is visible in the Base64:

BrandMeaningBase64 (32-byte ftyp box)
isomISO base media file, the generic brand (ffmpeg’s default)AAAAIGZ0eXBpc29t
mp42MP4 version 2AAAAIGZ0eXBtcDQy
M4VApple’s MP4 video variantAAAAIGZ0eXBNNFYg
qtQuickTime movie (.mov)AAAAIGZ0eXBxdCAg

The fifth character changes with the box size (G for 24 bytes, H for 28, I for 32), so detection code should look for GZ0eXB after the first five characters. A file with brand qt is really a QuickTime movie with an .mp4 name; it may still play, but label it video/quicktime if the receiver checks.

Embedding and sending

A short muted loop in a self-contained HTML page:

<video autoplay muted loop playsinline src="data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21p..."></video>

Sending a clip in a JSON request from Node.js:

import { readFile } from "node:fs/promises";

const video = await readFile("clip.mp4");
const body = JSON.stringify({
  mimeType: "video/mp4",
  data: video.toString("base64"),
});

The field names here are placeholders; use the ones from your API’s documentation. More in Base64 in Node.js.

Problems you might hit

  • The data URI plays in Safari but not in Chrome or Firefox. The video track is probably HEVC. Re-encode to H.264.
  • The page freezes while loading. The browser is parsing a huge string. Data URIs above a few megabytes are better replaced by a file URL or a Blob URL.
  • The receiver says the file is corrupt. Compare the decoded length with the original file size in the meter; a truncated string cuts off the end of the file, where many MP4s keep their index. Base64 to MP4 shows whether the decoded clip plays.

FAQ

Why does my MP4 Base64 start with AAAA?

An MP4 opens with the size of its first box, ftyp, as a 4-byte number. The first three bytes are zero for any normal header, and zero bytes encode to A. The ftyp box name and the brand follow, e.g. AAAAIGZ0eXBpc29t for brand isom.

Will my MP4 play from a data URI in every browser?

If it uses H.264 video and AAC audio, yes. MP4 files with HEVC (H.265) play in Safari and only in some other browsers, depending on the system. The container alone does not guarantee playback.

How do I send an MP4 to an API as Base64?

Choose Plain Base64 unless the API documents a data URI, and send video/mp4 as the media type. Check the API’s size limit against the encoded length, which is a third larger than the file.