MP3 / Audio to Base64 Converter
Drop an MP3 or any audio file and get a Base64 string or data URI. Everything runs in your browser — the file is never uploaded.
How to convert MP3 to Base64
Drag any audio file onto the drop zone above (or click to browse). The tool reads it locally with the browser's FileReader API and outputs the raw Base64 string by default. Click Copy, then paste it where you need it. Use the Data URI toggle to switch to a full data:audio/mpeg;base64,… value with the data: prefix and the file's actual MIME type.
Using audio data URIs
A data URI embeds the whole audio file inline, which works well for tiny sound effects. Drop it into an <audio> src:
<audio src="data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAP..." controls></audio>
The same string also works for a short notification or click sound played from JavaScript:
const beep = new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAP...");
beep.play();
Size warning
Base64 is about 33% larger than the original binary, and audio files are already large. Because of that, only inline short clips — a UI beep, a click, a one-second notification sound:
- Size: a full song encoded as Base64 bloats the page; a 4 MB MP3 becomes ~5.3 MB of text embedded directly in your HTML, JS, or CSS.
- Caching: inlined audio can't be cached on its own — it's re-downloaded with the page every time the surrounding file changes.
- Rule of thumb: inline only tiny sound effects; serve full songs and longer audio as normal files with proper cache headers.
Tip: if your clip is more than a few KB, prefer a normal <audio src="sound.mp3"> so the browser can cache and stream it efficiently.
Is this private?
Yes. The conversion happens entirely client-side in JavaScript. Your audio file is read into memory in the browser and encoded locally — it is never sent to a server. You can confirm this by opening DevTools → Network: adding a file fires no upload request.
Frequently asked questions
How do I convert an MP3 to Base64?
Drop the MP3 onto the converter above. It reads the file locally and outputs the raw Base64 string; toggle to Data URI for the data:audio/mpeg;base64,… form you can use as an <audio> src.
Can I convert WAV or OGG too?
Yes — any audio. The converter accepts MP3, WAV, OGG, M4A, FLAC, AAC, and more. The data URI's MIME type comes from the file itself, so a WAV produces data:audio/wav;base64,….
Should I inline audio as a Base64 data URI?
Only for very short clips like sound effects. Base64 is ~33% larger and can't be cached separately, so a full song bloats the page and hurts performance. Keep longer audio as regular files.
How do I go the other way (Base64 back to a file)?
Use the Base64 to File tool to decode a data URI or raw Base64 back into a downloadable audio file.
Need text, files, or URL-safe Base64?
The main base64.dev tool handles text, files, and URL-safe mode with auto-detect.
Open base64.dev →