How to Convert MP3 Into a HTML Code

by Ashan R. Hampton

Digital music files are popular additions to web pages, especially social networking sites. Before music can be streamed online, it must be converted to a compatible file format. MP3 is the most common file type for music, due to its small compression size and cross platform accessibility. Different types of MP3 converter software or CD rippers are available online for free. Once music files have been successfully converted, MP3s can be added to HTML documents or web-based media players.

Step 1

Convert music files to MP3 format. Other extensions such as WMA or CDA will not load to the Internet effectively.

Step 2

Upload MP3s from a local computer to the Internet through a website hosting account. The MP3s must be loaded onto the web before inclusion in HTML code.

Step 3

Once the file is posted to the internet, copy and paste the URL address. The web address for the MP3 file can be accessed in two ways: click the file to open it in a new browser window then copy and paste the address that appears in the web browser or right click the MP3 file and choose "copy shortcut" from the submenu. The address should look something like this:

Step 4

Open a new document in Notepad or another HTML editor. Paste the code into the document for reference.

Step 5

Attach the MP3 to a link so that users can easily download it. For example, type the following HTML code within Notepad: Download this song

Step 6

To test the link, save the Notepad document as an html page. Click "File" then choose "Save as" from the submenu. In the file name box, type test.html. Under "Save as type" click "All files." Save the page to the desktop.

Open the HTML page on the desktop in Internet Explorer. Click the MP3 link. If a download box appears and the file opens within a media player, the HTML code is correct.


  • According to Steven Pemberton, editor for the World Wide Web Consortium (W3C), updates to HTML coding standards are stricter than in the past. Unlike previous self-correcting versions of HTML, incorrect HTML or XML code will not properly display in most web browsers.


  • Use a media player to attractively present MP3 files on websites. Most free media players downloaded from the internet require intermediate knowledge of HTML or XML coding for proper installation. Google and Yahoo offer free Flash MP3 media players that can be customized by tweaking the HTML embed code.


About the Author

Ashan R. Hampton is an instructor, multimedia specialist, author and commercial radio broadcaster/producer. She has earned certificates in information technology multimedia and instructional design. Hampton also holds an M.A. in English and is completing a doctorate in higher education administration.

More Articles