What is MusicXML, and what to do with a MusicXML file

MusicXML is an open file format for written sheet music. It stores the score itself as text: each note's pitch and spelling, its length, the clefs, key and time signatures, ties, slurs, dynamics and lyrics. The point is to move a score between programs such as MuseScore, Dorico and Sibelius without retyping it. Files end in .musicxml, .mxl (compressed) or .xml.
Michael Good created MusicXML at Recordare, and version 1.0 came out in January 2004. MakeMusic bought Recordare in 2011; since 2015 the W3C Music Notation Community Group has looked after it. The current version is 4.0, from June 2021. It's open: anyone can read and write it without paying for the format, and MuseScore, Dorico, Sibelius and Finale all do.
The exact look of the page travels worst. A file can carry layout hints, but each program lays out the score its own way, so spacing, line breaks and some markings change between programs. An imported file still needs checking against the original.
MusicXML stores the notes where a PDF stores a picture
A PDF of sheet music is a picture. You can print it, but you can't click a note and change it, because the program showing it doesn't know a note is there. MusicXML is the score as data, so any program that reads it can edit, play back, transpose or reprint it. Getting from a PDF to MusicXML takes music recognition software; renaming the file does nothing.
A MusicXML file is readable text
Here's a middle C quarter note on the treble staff of a piano part, as MusicXML writes it:
<note>
<pitch><step>C</step><octave>4</octave></pitch>
<duration>1</duration>
<type>quarter</type>
<staff>1</staff>
</note>
Octave 4 is the one that starts at middle C. <type> is the note value you see; <duration> is the length the program plays, counted in divisions of a quarter note that the file sets once at the start of the part (here one division per quarter). Change <staff>1</staff> to <staff>2</staff> and the same note sits on the bass staff.
Accidentals keep their spelling. F sharp is <step>F</step><alter>1</alter> and G flat is <step>G</step><alter>-1</alter>: the same key on the piano, and the file knows which one was written. MIDI can't tell them apart. The notation program writes all of this; you don't edit it by hand.
MusicXML, MIDI and PDF each keep something different
| Format | What it stores | Good for | What it loses |
|---|---|---|---|
| What the page looks like | Printing, reading at the piano | You can't edit the notes | |
| MusicXML | The written score: spelling, beaming, clefs, both staves, markings | Moving a score into another notation program | Page layout changes from program to program |
| MIDI | A performance: which key, when, how hard | Playback, recording software | Spelling, beaming, clefs and most markings |
Use MusicXML when someone will edit the notation, and MIDI when someone will make sound with it. What's inside a MIDI file goes further into what MIDI keeps and drops.
The file can end in .musicxml, .mxl or .xml
A plain-text MusicXML file should end in .musicxml, the extension the standard recommends. An .mxl file holds the same score zipped; compression arrived in version 2.0 and makes the file smaller to email. Older plain-text files often end in .xml, which doesn't tell a program the file is music rather than any other XML. That's why the standard moved to .musicxml.
MuseScore, which is free, opens all three with File > Open, and so do Dorico and Sibelius. If double-clicking the file shows a page of code, your computer handed it to a web browser or text editor; open it from inside the notation program instead. Finale's development ended in August 2024; Finale users can carry their scores into other programs by exporting MusicXML.
A piano score comes through, but check these things
In MusicXML a grand staff is normally one part with two staves. Some programs export the hands as two separate parts instead, which is why an import can arrive as two instruments.
Notes, rhythms, key signatures and repeats usually come through. After an import, look at:
- tempo words and expression text
- where the dynamics sit
- notes that cross from one staff to the other
- bars where one hand has two voices
- line and page breaks
If MuseScore keeps the original's line breaks and they come out cramped, turn off "Import system and page breaks" under Import in its preferences and open the file again. Each trip between programs can change a little more, so keep one master copy and export fresh from it.
Then play it back once, following the original. In the site's PDF to MuseScore worked example, the tempo word "Spiritoso" went missing and had to be added back in MuseScore.
Opening and exporting MusicXML in PlayableNotes
PlayableNotes opens a piano MusicXML file (.musicxml or .xml; open an .mxl in MuseScore and export it uncompressed first) as an editable, playable score. There's nothing to read, so importing uses no credits. Any score in your projects downloads free as MusicXML, MIDI, PDF or KM, and so do the roughly 320 public-domain pieces in the library once you open a free copy.
Reading a score from a photo, screenshot or PDF costs 1 credit per line of music (treble and bass staff together; a typical page has 5 to 7), and a failed reading is free. PlayableNotes reads two-staff piano music only; check each reading against the page. Photo to MusicXML shows the whole route.
Open a MusicXML file or a page of your own music at your projects page; your first 50 credits are free.
FAQ
What is the difference between MusicXML and MXL?
They hold the same score. An .mxl file is MusicXML zipped, so it's smaller to email; a .musicxml file is plain text. The .xml extension is an older name for plain MusicXML; the standard recommends .musicxml instead.
Is MusicXML the same as MIDI?
No. MusicXML stores the written score: spelling, clefs, beaming, both piano staves and the markings. MIDI stores a performance: which keys, when and how hard. MIDI can't tell F sharp from G flat; MusicXML can.
What program opens a MusicXML file?
MuseScore, which is free, opens .musicxml, .mxl and .xml files with File > Open, as do Dorico and Sibelius. Double-clicking an .xml file often opens it in a web browser as code, so open it from the notation program.
Can I turn a PDF into MusicXML?
Only with music recognition software, which reads the staves and writes out the notes; a general PDF-to-XML converter gives you XML with no notes in it. Expect to fix some notes. The guide to converting PDF sheet music to MusicXML compares the tools.
Where can I get MusicXML files?
MuseScore, Dorico, Sibelius and Finale export one, a music recognition app writes one from a photo or PDF, and some public-domain archives post one beside the PDF. The format itself is free to use. The PlayableNotes library has about 320 public-domain piano pieces; open a free copy of one and download its MusicXML at no cost.