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

MP3 to Base64

Drop an MP3 and copy it as a data:audio/mpeg;base64, URI or plain Base64. Preview it in the player, and check the length before pasting it anywhere.

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 MP3 to Base64

  1. Drop an .mp3 file on the box or pick it with the file picker.
  2. Listen in the preview to confirm the clip.
  3. Keep Output as on Data URI for HTML and JavaScript, or switch to Plain Base64 or JSON for an API.
  4. Press Copy output, or Save as .txt for long files.

Length per bitrate

An MP3’s size is its bitrate times its duration, and Base64 makes it a third longer. Figures below are for the audio data alone, without tags:

Bitrate1 second10 seconds1 minute
64 kbps10,668 chars106,668 chars640,000 chars
128 kbps21,336 chars213,336 chars1,280,000 chars
192 kbps32,000 chars320,000 chars1,920,000 chars
320 kbps53,336 chars533,336 chars3,200,000 chars

For a notification sound or a spoken prompt, 64 kbps mono is usually plenty and keeps the string short. Re-export the clip at a lower bitrate in an audio editor before encoding if it is longer than you need.

The ID3 tag can be most of the file

MP3 files from music libraries carry an ID3v2 tag at the start, and that tag often contains embedded cover art. A two-second sound effect can come with a cover image that is larger than the audio itself, and all of it goes into the Base64.

A tagged file’s output starts with SUQz. SUQzBA means ID3 version 2.4 and SUQzAw version 2.3. If the file is meant for a UI sound or an API, remove the tags with an audio editor or tag editor, then encode the clean file. The meter under the output shows the difference.

Using a Base64 MP3

In HTML:

<audio controls src="data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2..."></audio>

In JavaScript, a data URI works anywhere a URL does:

const ping = new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2...");
document.querySelector("#send").addEventListener("click", () => ping.play());

play() must run after a user gesture such as a click, or the browser blocks it.

For JSON APIs, use Plain Base64 unless the API documents a data URI. Speech-to-text services in particular usually want bare Base64 plus a separate field for the audio format.

Common problems

  • The player stays silent. Check that the data URI begins with data:audio/mpeg;base64, and that URL-safe and Wrap at 76 are off. URL-safe characters are not valid in a data: URL, and line breaks end a JavaScript string literal.
  • The duration is wrong or seeking jumps. Variable-bitrate MP3s without a proper header can confuse players. This comes from the file itself; re-export it with an audio editor.
  • You need the file back. Base64 to MP3 decodes the string and lets you play or download it. For other formats see Audio to Base64.

FAQ

What is the correct MIME type for a Base64 MP3?

audio/mpeg. You will see audio/mp3 in some code, but the registered type is audio/mpeg, and APIs that validate the type expect it.

Why does my MP3 Base64 start with SUQz?

SUQz is ID3, the start of an ID3v2 tag with title, artist and maybe cover art. MP3 files without a tag start directly with an audio frame, which encodes to // followed by a letter such as //uQ or //OQ.

How many characters is one minute of MP3 in Base64?

At 128 kbps a minute of audio is 960,000 bytes, which encodes to 1,280,000 characters. At 64 kbps it is half that. Tags and cover art come on top.