Encode Audio to Base64 - MP3, WAV, OGG, AAC, MIDI, WEBA, OPUS

The converter helps to encode the Audio file to Base64 data and then copy or download the result data in several formats. If you want to decode, use Base64 for Audio Decoder.

How to encode Audio file to Base64 Data

  1. Select or drag & drop one or several Audio files (MP3, WAV, OGG, AAC, MIDI, WEBA, OPUS);
  2. Press Encode button (you will see the result below);
  3. Select output format (Plain Text, Data URL, HTML Audio Tag, Embed Tag, HTML Iframe Tag, HTML Hyperlink Tag);
  4. Copy or Download Base64 data;
  5. Done!

Output Formats

  • Plain Text - Only Base64 data;
  • Data Url - Base64 in data URL format (data:[<MIME-type>][;charset=<encoding>][;base64],<base64 data>)
  • HTML Audio Tag - HTML Tag <audio> with Data Url data in SOURCE.SRC property.
  • HTML Hyperlink Tag - HTML Tag <a> with Data Url data in HREF property.
  • HTML IFarme Tag - HTML Tag <iframe> with Data Url data in SRC property
  • HTML Embed Tag - HTML Tag <embed> with Data Url data in SRC property.

Output Format Examples for Audio (truncated data, for example)

Plain Text:

SUQzAwAAAAA2PVRDT04AAAAFAAAAKDApAFRZRVIAAAA...

Data Url:

data:audio/mpeg;base64,SUQzAwAAAAA2PVRDT04AAAAFAAAAKDApAFRZRVIAAAA...

HTML Audio Tag

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

HTML Hyperlink Tag:

<a href="data:audio/mpeg;base64,SUQzAwAAAAA2PVRDT04AAAAFAAAAKDApAFRZRVIAAAA...">Click</a>

HTML IFrame Tag:

<iframe src="data:audio/mpeg;base64,SUQzAwAAAAA2PVRDT04AAAAFAAAAKDApAFRZRVIAAAA..."></iframe>

HTML Embed Tag

<embed src="data:audio/mpeg;base64,SUQzAwAAAAA2PVRDT04AAAAFAAAAKDApAFRZRVIAAAA..."></embed>

How to add the Audio file to my site (HTML page)

If you want to add Sound to the website, you should encode the Sound file and select the formats: 

  • HTML Audio Tag;
  • HTML Hyperlink Tag

Example HTML Audio Tag:

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

Copy and Paste this code to your web page's <body> tag. You can set additional <audio> tags - more info about an audio tag.

If you want to download an Audio file by HTML Hyperlink Tag, add attribute download="<file-name>.<extension>"

<a href="data:audio/mpeg;base64,SUQzAwAAAAA2PVRDT04AAAAFAAAAKDApAFRZRVIAAAA..." download="sound.mp3">Download Audio File</a>