Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to export album/track information from an iTunes music library into, say, a comma-separated values (CSV) file, or another spreadsheet-friendly format?

I'd like to be able to grab a snapshot of at least basic metadata – being artist name, album name, and track name – and copy into a spreadsheet or database software for reference, cleansing, & analysis. (If you want to call me a music nerd for wanting to data-mine information about my CD collection, go right ahead! :-)

Is there a way to do such a metadata export within iTunes itself, or else might there be a third-party tool that can extract such information from iTunes library storage? Or perhaps you have a quick & dirty homebrew script of your own you could share here?

I'm aware there is XML somewhere in the bowels of my iTunes library, and I'm a programming nerd too, but I'm hoping somebody has already invented this particular wheel.


share|improve this question
up vote 15 down vote accepted

Make sure all the columns you want metadata for are visible in the playlist or library you're looking at. Then, select the tunes you want with shift-click or -click or whatever:

enter image description here

Then, hit +C to copy. This will allow you to paste what's visible in the iTunes playlist into any sort of spreadsheet you like:

enter image description here

It won't label the columns for you, but it'll do the trick quickly.

share|improve this answer
Huh, didn't even consider that. Nice answer! – Kyle Cronin Mar 27 '12 at 23:14
@Kyle I saw the question and actually said, out loud, in my apartment, to nobody, "OH, I ACTUALLY KNOW THIS ONE!" – hairboat Mar 27 '12 at 23:18
I've been testing this out, and it works great for up to a few hundred rows, but I can't get it to work much beyond that. If the OP wants to do analytics on his entire library, he may want to use my method. – Kyle Cronin Mar 27 '12 at 23:24
@KyleCronin I'm not surprised. I imagine this functionality is mainly used to do stuff like make liner notes for burned CDs and such. – hairboat Mar 27 '12 at 23:25
FWIW, I was able to export all ~1500 rows on my Mac's iTunes library, and all ~16000 rows on my Windows iTunes library. Also, I used Cmd-A (Windows: Ctrl-A) to select all rows, instead of the mouse. I may still resort to Kyle's method to automate this and get at raw bits instead. Both answers are excellent. – Chris W. Rea Mar 27 '12 at 23:45

You can do File -> Library -> Export Library and get an XML file of your library metadata. From there it would be a relatively straightforward matter for a programmer to convert the XML data into a CSV, spreadsheet, or database.

For example, I made this quick Ruby script in about 10 minutes to get the artist, album, and track names from the XML and output a CSV. Note that it will only match tracks that have all 3 pieces of info provided, and that it requires the library file to be called "Library.xml" in the current directory:

require 'csv'

track = /<key>Name<\/key><string>(.*)<\/string>[.\s]*<key>Artist<\/key><string>(.*)<\/string>[.\s]*<key>Album<\/key><string>(.*)<\/string>/

file ="Library.xml", "r")
contents =

out ="Library.csv", "w")

contents.scan(track) do |match|
  out << match
share|improve this answer
Thanks for the head start. – Chris W. Rea Mar 27 '12 at 23:36

For enhancements/tools to work with ITunes probably the first place to go is Doug's Applescripts for iTunes. There are many useful scripts here.

On the page for Exporting Info there is this script that exports track information as a text file.

This script will write a discrete alphabetical list of your choice of the Albums, Artists, Album Artists, Composers, Genres, Shows, or Track Names in iTunes to a text file.

share|improve this answer

Please consider giving a try. It is a Visual Basic script I wrote that loops through your iTunes library and provides a text file of all kinds of statistics. It then puts those stats into a .csv file for you to keep long-term.

share|improve this answer
This could be a really interesting answer to the problem but it suffers from: 1) a lack of example output that shows specificallly how it answer the question being asked; and 2) instructions for how you would use it on a Mac (remember, this is an Apple site and iTunes runs on both Windows and Apple machines). If you added some more detail you might find you're not attracting down votes. – Ian C. Mar 29 '15 at 19:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.