Skip to content

Audio to Base64 Converter

Encode MP3, WAV or OGG audio as Base64, or decode an audio string and play the result before downloading.

Runs in your browser Free, no sign-up
Loading tool workspace...

What is Audio to Base64 Converter?

This audio to Base64 converter works in both directions. In Encode mode, choose an audio file, such as MP3, WAV, OGG or WebM, and the tool converts it into a Base64 data URI (data:audio/mpeg;base64,…) that you can embed directly in HTML, CSS, JavaScript or JSON without hosting a separate file.

In Decode mode, paste Base64 audio data, pick the audio format, and the sound appears in a built-in player so you can listen to it, then download it as a file. It is useful for short sounds in web apps, audio returned by text-to-speech APIs, and debugging audio stored as Base64.

How to use Audio to Base64 Converter

  1. Choose Encode to convert an audio file, or Decode to turn Base64 back into audio.
  2. To encode, select an audio file; the Base64 data URI appears, ready to copy.
  3. To decode, paste the Base64 string (with or without the data: prefix) and choose the format: MP3, MPEG, WAV, OGG or WebM.
  4. Play the decoded audio in the player and click Download Audio to save it.

Key features

  • Encode audio files to Base64 data URIs
  • Decode Base64 back to playable audio
  • Built-in audio player for decoded sound
  • MP3, MPEG, WAV, OGG and WebM formats
  • Download decoded audio as a file
  • Runs entirely in your browser

Common use cases

  • Embedding short notification sounds directly in a web app
  • Saving audio returned as Base64 by text-to-speech and voice APIs
  • Debugging audio stored as Base64 in databases or JSON
  • Including sound effects in single-file HTML demos
  • Sending small audio clips in JSON payloads

Technical details & standards

Encoding reads the file with the browser's FileReader and produces a data URI containing the file's MIME type and its Base64 content, which is about 33% larger than the original file. Decoding converts the Base64 back into bytes and plays them through an HTML audio element with the MIME type you choose.

Base64 audio is best for short clips such as notification sounds, UI effects and voice snippets. For longer recordings, a normal audio file is smaller, can be cached by the browser and can start playing before it has fully downloaded. Everything happens in your browser, so recordings are not uploaded.

Frequently asked questions

How do I convert Base64 to MP3?

Choose Decode, paste the Base64 string and select MP3 (or MPEG). The audio appears in the player; click Download Audio to save it as a file.

How do I play Base64 audio in HTML?

Use the data URI as the audio source: <audio controls src="data:audio/mpeg;base64,…"></audio>. In JavaScript, new Audio(dataUri).play() works too.

Why is my Base64 audio larger than the file?

Base64 encoding adds about 33% to the size. That is fine for short sounds but wasteful for long recordings, which are better served as normal audio files.

Which format should I choose when decoding?

Choose the format the audio was created in; text-to-speech APIs usually say in their documentation, often MP3 or OGG. If playback fails, try another format, or check the data URI prefix if one was included.

Is my data safe?

Processing happens locally in your browser. Tool input is not sent to CodeUnpack servers.

Does it work offline?

Once the page has loaded, this tool can process input without an internet connection.

More encoders & decoders tools

View all