MP4 to Base64
Encode an MP4 to Base64 in your browser: copy a data:video/mp4;base64 URL, raw Base64 or a <video> tag, with the exact output size shown first.
Still loading. If the tool doesn’t appear, reload this page.
About this tool
MP4 to Base64 — Video to Base64 Converter
Encode an MP4, WebM, MOV or OGV file to Base64 in your browser and copy it as a data URL, raw Base64 or an HTML video tag.
To convert MP4 to Base64, pick the file: it is encoded in this tab and you copy the result as a data:video/mp4;base64,… URL, raw Base64 or a <video> tag. Base64 writes every 3 bytes as 4 characters, so output is about 33% larger — a 3 MB clip becomes about 4 MB of text, plus the 22-character prefix.
How to use MP4 to Base64
Pick a local MP4, WebM, MOV or OGV file — anything up to 25 MiB, which is the ceiling because the Base64 text is a third larger again and has to fit in memory.
Encoding starts immediately; the panel reports the source bytes and the exact character count of the Base64 output.
Choose Data URL, Raw Base64 or HTML <video>, confirm the clip plays in the preview, then Copy or Download the text.
Why use MP4 to Base64
Nothing is uploaded
The file is read and encoded in your browser; no bytes are sent to a server.
Exact output size up front
Shows the character count and padding before you convert, using ceil(bytes ÷ 3) × 4.
Playback check built in
The generated data URL is fed straight back into a video element so you can confirm it decodes.
Common use cases
- Inline a two-second loop in a single self-contained HTML file that has to work with no network.
- Paste a small clip into a JSON API request body or a database seed script that only accepts text.
- Embed a test video inside an automated test fixture so the suite has no external asset dependency.
Frequently asked questions
How much bigger does Base64 make a video file?
Exactly 33.3% bigger, because three bytes become four characters. A 5 MiB MP4 produces 6,990,508 Base64 characters, plus the 22-character data:video/mp4;base64, prefix.
Link to answerWhat is the maximum file size I can convert here?
25 MiB. The original bytes and the Base64 text (about 35 MB for a 25 MiB file) both have to sit in memory at once, along with the preview, so larger files risk slowing or crashing the tab.
Link to answerShould I use a Base64 data URL for video on a real website?
Only for very small clips. Inlined video cannot be range-requested, streamed or cached separately, and it inflates the HTML or CSS file by a third. Serve anything longer than a couple of seconds as a normal file over HTTP.
Link to answerCan I convert video formats other than MP4?
Yes — four containers are accepted: MP4 (including .m4v), WebM, QuickTime .mov and Ogg .ogv. The MIME type of whichever file you pick is written into the data URL prefix, so a WebM comes back as data:video/webm;base64, and still plays in the built-in preview.
Link to answerIs my video uploaded anywhere?
No. The file is read straight from your device with the browser's own file API and encoded in the page, so the bytes never leave your machine — there is no server, no account and no upload step, which is the point of doing it in the browser.
Link to answerWhat is the difference between a data URL and raw Base64?
Raw Base64 is just the encoded bytes, e.g. AAAAIGZ0eXBpc29t… for an MP4. A data URL adds the media type in front — data:video/mp4;base64,AAAAIGZ0eXBpc29t… — so it can go straight into a src attribute. Many JSON APIs want the raw form; HTML and CSS need the data URL.
Link to answerHow do I convert Base64 back to an MP4?
Use the companion Base64 to Video tool: paste the raw Base64 or the full data URL and it decodes the bytes, detects MP4/WebM/MOV from the file header, previews the clip and downloads it with the right extension.
Link to answerEmbed this tool on your site
Add the MP4 to Base64 widget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.
<iframe src="https://www.altftool.com/embed/widget/mp4-to-base64"
title="MP4 to Base64 — free AltFTool widget"
width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
loading="lazy" referrerpolicy="no-referrer-when-downgrade" allow="clipboard-write"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/mp4-to-base64?utm_source=embed&utm_medium=widget" rel="nofollow">AltFTool — free online tools</a></p>