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

Video to Base64

Drop a video and copy it as a data:video/...;base64, URI or plain Base64. Best for clips of a few seconds; anything longer belongs in a normal file.

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 a video to Base64

  1. Drop a video file on the box or pick it with the file picker. MP4, WebM, MOV and other formats your system recognizes are accepted.
  2. Watch it in the preview player to make sure it is the right clip.
  3. Output as starts on Data URI. Choose Plain Base64 or JSON for an API.
  4. Copy output for short clips; Save as .txt for anything large.

Recognizing video in Base64

ContainerMIME typeBase64 starts with
MP4video/mp4AAAA + one character + GZ0eXB, e.g. AAAAIGZ0eXBpc29t
MOV (QuickTime)video/quicktimeAAAAFGZ0eXBxdCAg (brand qt)
WebM, MKVvideo/webm, video/x-matroskaGkXfo
AVIvideo/x-msvideoUklGR (RIFF, like WAV and WebP)

The container tells you how to label the data URI. Whether a browser can play it depends on the codec inside, such as H.264, HEVC, VP9 or AV1.

When Base64 video makes sense

  • Tiny looping clips in a single-file HTML page, like a product animation or a UI demo of a second or two. Use autoplay muted loop playsinline, since browsers generally block autoplay with sound.
  • Test fixtures for upload, transcoding or playback tests, kept next to the test code.
  • APIs that accept short video inline: some multimodal and media-processing APIs take a short clip as Base64 in JSON. They limit the size, and usually also accept a link to a stored file for anything longer.

For everything else, a video file served normally is better. The browser can request it in ranges, start playback before the download finishes, and cache it. A data URI has to be downloaded and decoded completely, and it bloats whatever HTML, CSS or JSON contains it by the video’s size plus a third. In a web app that already has the file in memory, URL.createObjectURL(blob) gives you a playable URL without any Base64 at all.

Make the clip smaller before encoding

Video size is mostly resolution, frame rate and bitrate. A 3-second 1280×720 test clip of 69,243 bytes dropped to 17,281 bytes after scaling to 480 pixels wide and removing the audio track:

ffmpeg -i clip.mp4 -vf scale=480:-2 -c:v libx264 -crf 28 -an -movflags +faststart small.mp4

-crf 28 trades some quality for size (higher is smaller), -an drops the audio, and scale=480:-2 keeps the aspect ratio with an even height. Encode the result here. For MP4-specific details, see MP4 to Base64; Base64 to Video plays a Base64 string back.

FAQ

Can I embed a video in HTML with Base64?

Yes: <video src="data:video/mp4;base64,..." controls></video>. It works for short clips. Longer videos make the page enormous and cannot stream, because the browser needs the whole data URI before it can play.

How long a video can I convert?

The tool has no fixed limit; large files are encoded in chunks and saved as .txt. Output above roughly 48 MB cannot be copied. In practice, a data URI over a few megabytes is already a bad idea in a web page.

Which video format should I encode?

MP4 with H.264 video plays in every current browser. WebM (VP9 or AV1) is often smaller and also widely supported. MOV files from phones may use HEVC, which many browsers outside Safari cannot play.