Free tool

TTML to SRT Converter

TTML is an XML subtitle format, and converting TTML to SRT means reading its timing rules correctly: clock times, frame counts and ticks all appear in real files. This tool reads TTML, DFXP and XML subtitle files in your browser, works out each line's start and end in milliseconds, and writes SRT or WebVTT. Nothing is uploaded.

01 — Your file

Choose a subtitle file

02 — Preview

First subtitles

Choose a file to preview the result. Everything runs in this tab.

How to convert TTML to SRT

  1. Drop the .ttml, .dfxp or .xml file into the box above. The file card shows how many subtitles were read, whether the file was recognised as TTML or DFXP, and when the last line ends.
  2. Read the notes. They say if paragraphs were skipped, if times were relative to a <div>, and that styling was dropped.
  3. Check the first subtitles in the preview, especially the times.
  4. Set "Save as" to SRT, or to WebVTT if the captions are going back onto a web page, and press "Convert and download" to save the TTML captions in that format.

TTML, DFXP, IMSC and iTT

These names cause most of the confusion around this format, but they all describe the same family:

TTML
Timed Text Markup Language, the W3C standard for subtitles and captions in XML
DFXP
Distribution Format Exchange Profile, TTML's name in earlier drafts; it survives in profile names and file extensions. A .dfxp file is a TTML file
IMSC
A W3C profile of TTML for subtitles and captions in online media, with a text profile and an image profile
iTT
Apple's iTunes Timed Text, a subset of TTML 1.0
EBU-TT-D and SMPTE-TT
TTML-based profiles from the European Broadcasting Union and SMPTE

YouTube, for example, treats .dfxp files as TTML. For conversion, the profile mostly decides which extra attributes appear; the text and timing are read the same way. The exception is IMSC's image profile, where each subtitle is a picture: there is no text to read, and converting it would need OCR, which this tool doesn't do.

The timing modes, with small examples

TTML can express time in several ways, and the converter reads the settings on the root <tt> element to interpret them:

Clock time
begin="00:01:02.500" is 1 minute 2.5 seconds; end works the same way
Clock time with frames
begin="00:00:10:15" with ttp:frameRate="25" is 10 seconds plus 15 frames, so 10.6 seconds
Frames as an offset
begin="250f" at 25 frames per second is 10 seconds
Ticks
begin="25000000t" with ttp:tickRate="10000000" is 2.5 seconds
Other offsets
1.5s, 90m, 1h and 500ms are all valid, and dur="2.5s" can replace an end time

For NTSC-style rates, files add ttp:frameRateMultiplier="1000 1001" to turn 30 into 29.97, and the converter applies it. If ttp:subFrameRate is set, sub-frames after a dot in a clock time are counted too.

When a file uses frames but declares no ttp:frameRate, 30 frames per second is assumed, which is the fallback the TTML specification gives. When it uses ticks with no ttp:tickRate, the converter uses the frame rate if one is declared, and otherwise one tick per second. If a frame-based file comes out with lines a fraction of a second early or late, it was probably made for a different frame rate: add the right ttp:frameRate to the <tt> tag in a text editor and convert again.

Div offsets and skipped paragraphs

Some files give a <div> its own begin time and time the paragraphs inside it relative to that. The converter adds the div's start to those paragraphs, so the SRT gets absolute times, and the notes mention that it happened.

Each SRT cue comes from one <p> element with a begin and an end (or a begin and a dur). Paragraphs whose timing sits only on the <span> elements inside them, and empty paragraphs, are skipped and counted in a note. If that count is large, the file uses span-level timing throughout and the result will have gaps.

What carries over and what doesn't

  • Kept: the text of each paragraph, line breaks from <br/>, and characters written as XML entities such as &amp; or numeric codes.
  • Flattened: <span> elements are merged into the line, so italic or coloured words become plain text.
  • Dropped: tts:color, tts:fontStyle, tts:textAlign and the other styling attributes, regions with tts:origin and tts:extent, and metadata such as speaker agents. A line placed at the top through a region will appear at the bottom in most players.
  • Watch for: Japanese ruby (furigana) is written inline next to the base text, since SRT has no ruby. Check those lines in the preview.

Broadcast timecode

Some broadcast files start their timecode at 10:00:00:00 rather than zero, so every subtitle in the SRT appears to begin about ten hours in. The conversion is correct; the times just need moving. Shifting subtitle timing explains how to move every line back by a fixed amount.

Where TTML comes from, and why convert

TTML arrives from streaming and broadcast deliveries, caption vendors, Apple iTT packages and some e-learning and media platforms. It is precise and expressive, but video editors, desktop players, TVs and most upload forms want SRT or VTT. The guide to subtitle file formats puts TTML next to SRT, VTT, ASS and SCC.

Once you have an SRT, you can open it with the video in the free subtitle editor to fix lines, retime them on a timeline, and export SRT, VTT or an MP4 with the subtitles burned in.

Limits

  • Text-based TTML only; image-based profiles can't be read. Files over 20 MB are refused.
  • UTF-8 and UTF-16 files are read directly; anything else is read as Windows-1252 with a note. If letters look wrong, use the subtitle encoding converter first.
  • No translation: the text stays in its language. For subtitles in another language, the AI subtitle generator works from the video's audio.
  • Need the opposite direction for a delivery? SRT to TTML writes a TTML file with a language attribute.

More free tools

Turn the file into text

Frequently asked questions

Is a DFXP file the same as TTML?

Yes. DFXP was TTML's name in early drafts, and the term lives on in profile names and the .dfxp extension. The converter reads both the same way.

What does ttp:tickRate mean in a TTML file?

It says how many ticks make one second. With ttp:tickRate="10000000", a time of 25000000t is 2.5 seconds.

Why do all my converted subtitles start around 10 hours?

The file uses broadcast timecode that starts at 10:00:00:00. Shift every line back by ten hours and the timing will match the video.

Why were some paragraphs skipped?

Those paragraphs had no begin and end of their own, usually because the times sit on spans inside them, or they were empty. The note tells you how many.

Can it read IMSC or iTT files?

Text-based IMSC and iTT files, yes, because they are TTML. IMSC image subtitles are pictures and can't be converted to text here.

Are colours and positions kept in the SRT?

No. SRT holds only text and timing, so TTML styles and regions are dropped and every line shows in the player's default position.