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

The converter helps to encode Audio file to Base64 data then to copy or download a result data in several formats. If you want decode use Base64 to 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 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 roperty.
  • 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:


Data Url:


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 Audio file to my site (HTML page)

If you want add Sound in web site, you should encode Sound file and select formats: 

  • HTML Audio Tag;
  • HTML Hyperlink Tag

Example HTML Audio Tag:

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

Copy Paste this code to <body> tag of your web page. You can set addition <audio> tag's. More info about audio tag.

If you want download 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>