Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including id3-writer with all npm packages installed. Try it out:

var id3Writer = require("id3-writer")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

id3-writer v1.3.0

Binding to id3lib and eyeD3

ID3 Writer logo

ID3 Writer is a small and tested library for writing ID3 tags to MP3 files. We don't touch the files self - we speak to write adapters like id3lib/libid3-tools or eyeD3. So this library is just a wrapper around the CLI programs.

I don't plan to support Windows explicit. But if someone requests a pull for a write adapter with Windows support I will not reject it.

Build Status Gittip npm Downloads npm Version Dependency Status Code Climate Coverage Status


  • Support for multiple write adapters
    • We check if some binaries are available to do the tasks
      • eyeD3 (0.6.x, 0.7.x)
      • id3lib/libid3-tools (3.8.x)
  • Support for ID3v1 and ID3v2
    • ID3v2 Tags need some validation at this point
  • Support for converting the encoding of the given tags
  • Support for writing images to the MP3 files (eyeD3 only atm)

Getting Started


$ npm install id3-writer


Simply write ID3 tags

// Load and assign modules
var id3 = require('id3-writer');
var writer = new id3.Writer();

var file = new id3.File('/tmp/your.mp3');
var meta = new id3.Meta({
    artist: 'Blur',
    title: 'Song 2',
    album: 'Blur'

writer.setFile(file).write(meta, function(err) {

    if (err) {
        // Handle the error

    // Done

Write ID3 tags with an additional image

// Load and assign modules
var id3 = require('id3-writer');
var writer = new id3.Writer();

var mp3 = new id3.File('/tmp/your.mp3');
var coverImage = new id3.Image('/tmp/cover.png');

var meta = new id3.Meta({
    artist: 'Blur',
    title: 'Song 2',
    album: 'Blur'
}, [coverImage]);

writer.setFile(mp3).write(meta, function(err) {

    if (err) {
        // Handle the error

    // Done

Supported metadata

TagDescriptionlibid3 noteseyeD3 notes
artistArtist of the song--
title (compatibility: song)Title of the song--
albumAlbum of the song--
commentFurther user comments--
descUser comment description-Same as comment
genreGenre of the songNeeds to be a genre numberAll is possible: std ID3 genre names, ids and any other
yearThe year the song was recorded--
trackPosition of the track on the album--
totalAmount of tracks on the album--

ID3 genre list

0Blues37Sound Clip74Acid Jazz112Club
1Classic Rock38Gospel76Retro113Tango
3Dance40AlternRock78Rock & Roll115Folklore
4Disco41Bass79Hard Rock116Ballad
5Funk42Soul80Folk117Power Ballad
6Grunge43Punk81Folk-Rock118Rhythmic Soul
7Hip-Hop44Space82National Folk119Freestyle
9Metal46Instrumental Pop84Fast Fusion121Punk Rock
10New Age47Instrumental Rock85Bebob122Drum Solo
11Oldies48Ethnic86Latin123A Cappella
13Pop50Darkwave88Celtic125Dance Hall
15Rap52Electronic90Avantgarde127Drum & Bass
16Reggae53Pop-Folk91Gothic Rock128Club-House
17Rock54Eurodance92Progressive Rock129Hardcore
18Techno55Dream93Psychedelic Rock130Terror
19Industrial56Southern Rock94Symphonic Rock131Indie
20Alternative57Comedy95Slow Rock132BritPop
21Ska58Cult96Big Band133Negerpunk
22Death Metal59Gangsta Rap97Chorus134Polsk Punk
23Pranks60Top 4098Easy Listening135Beat
24Soundtrack61Christian Rap99Acoustic136Christian Gangsta Rap
25Euro-Techno62Pop / Funk100Humour137Heavy Metal
26Ambient63Jungle101Speech138Black Metal
27Trip-Hop64Native American102Chanson139Crossover
28Vocal65Cabaret103Opera140Contemporary Christian
29Jazz+Funk66New Wave104Chamber Music141Christian Rock
32Classical69Showtunes107Booty Bass144Thrash Metal
34Acid71Lo-Fi109Porn Groove146JPop
36Game73Acid Punk111Slow Jam148Rock/Pop

Running Tests

To run the test suite just run the following command, which installs the development dependencies:

$ npm install

Run the tests with:

$ make test
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free