Back to all guides

What is TTML?

A plain-English explainer of Timed Text Markup Language, the W3C format behind synced lyrics on Apple Music, Spotify, and Amazon Music.

TTML stands for Timed Text Markup Language. It is a W3C standard for describing text that appears and disappears in sync with media playback. Apple Music, Spotify, Amazon Music, and most major streaming platforms use TTML to power their synchronized lyrics features.

If you have seen a lyric line animate word by word while a song plays, you have seen TTML at work. The data behind that animation is a TTML file that ships alongside the audio.

The shape of a TTML file

A TTML file is XML with a small set of tags. The outer wrapper is <tt>. Inside are a <head> with metadata and a <body> with lyric lines. Each line is a <p> element with a begin and end attribute.

<tt xmlns="http://www.w3.org/ns/ttml"
    xmlns:ttm="http://www.w3.org/ns/ttml#metadata">
  <head>
    <metadata>
      <ttm:title>Example song</ttm:title>
    </metadata>
  </head>
  <body>
    <div>
      <p begin="00:00:12.000" end="00:00:15.200">
        This is the first lyric line
      </p>
    </div>
  </body>
</tt>

That is a line-synced TTML file. The whole line appears at 12 seconds and disappears at 15.2 seconds. The platform renders it as one block.

Word-level timing

The animated sing-along effect comes from nesting <span> elements inside a line. Each span holds one word with its own begin and end attributes.

<p begin="00:00:12.000" end="00:00:15.200">
  <span begin="00:00:12.000" end="00:00:12.400">This</span>
  <span begin="00:00:12.400" end="00:00:12.800">is</span>
  <span begin="00:00:12.800" end="00:00:13.200">the</span>
  <span begin="00:00:13.200" end="00:00:14.000">first</span>
  <span begin="00:00:14.000" end="00:00:15.200">line</span>
</p>

The rendering platform reads the timing and animates each word as its begin time passes the playhead. That is how the bouncing-word effect on Apple Music is produced.

Why TTML instead of LRC

LRC is simpler: one timestamp per line, plain text, easy to author in a notepad. It is enough for line-synced playback and remains popular for desktop players.

TTML wins when you need word-level timing, multiple singers on the same track, background vocals, or precise metadata. It is also the format streaming platforms ingest. If you want synced lyrics on Apple Music, you need TTML.

Who authors TTML files

Record labels, music distributors, and independent artists all ship TTML. Labels deliver TTML through partners like Musixmatch or direct via Apple's Content Collector. Independent artists usually author TTML themselves and hand it to their distributor.

Writing TTML by hand is possible but slow. A single song can have hundreds of word spans, each with millisecond-accurate begin and end times. Tools like CallEditor exist to capture timing from audio taps and serialize the XML for you.

Next steps

If you want to understand the details of the format, the TTML file format reference covers every tag Apple Music uses. If you want to ship a file today, open CallEditor and import your audio.

Ready to try it?

Better Lyrics

A browser extension that adds time-synced, animated lyrics to YouTube Music. Free, open source, and the reason CallEditor exists.

Visit better-lyrics.boidu.dev