How to use the Base64 converter
To encode a sound:
- Set Direction to Audio → Base64.
- Choose the Output: Data URI (
data:audio/…;base64,…), Raw Base64, or a complete<audio>tag with controls. - Drop an audio file or press Choose a file. A player appears so you can check it.
- Press Encode to Base64, then copy the text or download it as a
.b64.txtfile.
To decode:
- Set Direction to Base64 → audio.
- Paste a data URI or raw Base64 into Data URI or Base64.
- Press Decode to audio. You get a player, the detected Type and Size, and a download named
decoded-audiowith a matching extension.
What it does and when to use it
A data URI puts a whole file inside a line of text. That is handy for a short click or notification sound in a single-file HTML page, an email template, a code sample, a test fixture, or a JSON settings file that cannot reference separate files. Decoding is the reverse: you found a long data:audio/mpeg;base64,… string in a web page or an API response and want to hear it or save it.
Keep embedded sounds short. Trim them first with the audio trimmer, and save them as M4A or OGG with the audio converter to cut the size before encoding. For pictures, use image to Base64; for plain text there is a general Base64 encoder.
How it works
Everything runs on the page itself; no file or text is sent anywhere. Encoding reads the file’s bytes and converts them to Base64 in chunks so large files do not crash the browser. The MIME type comes from the file, or from its first bytes if the browser does not report one. Decoding accepts either a data URI or bare Base64, ignores spaces and line breaks, accepts the URL-safe alphabet (- and _), adds missing = padding, and rejects anything else. The audio is not decoded or re-encoded, so the bytes come back exactly as they went in.
Worked examples
From the tool’s own output:
- Encode a 0.25-second WAV beep (10.8 KB) as a Data URI: Encoded length 14,782 chars, Type audio/wav. The text starts with
data:audio/wav;base64,UklGR, the Base64 form of the “RIFF” header every WAV begins with. - Decode
data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YQAAAAA=: Type audio/wav, Size 44 B, a valid but empty WAV saved asdecoded-audio.wav. - Decode the same text without the
data:prefix: the type is still detected as audio/wav from its bytes. - Decode
data:audio/wav,hello: “This data URI is not Base64-encoded.”
Limits and tips
- Encoding only accepts files the browser lists as audio.
- Very large files make huge strings that can slow the page; keep data URIs to small sounds.
- Some email programs block data URIs in messages, so test before sending.
Frequently asked questions
How much bigger does Base64 make a file?
When should I not use a data URI?
My Base64 has no data:audio prefix. Will decoding work?
Does decoding check that the audio actually plays?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.