CapsAI

Subtitle format converter

TTML to SRT Converter

TTML, also called DFXP, is the W3C's XML subtitle format, used in streaming and broadcast workflows. This converter reads each timed <p> paragraph, works out its times whether they are written as clock time, frames or ticks, and writes a numbered SRT file. It runs in your browser and the file is never uploaded.

Browser-basedFree to use

No sign-up needed to try

Need to Create Subtitles First?

Upload your video to CapsAI, generate editable AI subtitles, and start with 3 free minutes.

Tool workspace

No account required · processed locally

Three steps

How this tool works

  1. 1

    Paste the TTML or DFXP XML, or open the .ttml, .dfxp or .xml file.

  2. 2

    Each <p> with a begin time becomes a cue; <br/> becomes a line break.

  3. 3

    Check the timings in the preview and download captions.srt.

Useful for

Common workflows

  • Subtitles delivered as TTML or DFXP for a player that needs SRT
  • Opening broadcast or streaming caption files in a desktop editor
  • Turning an XML caption file into readable timed text for review
  • Making an SRT base for a translation

What it checks

Focused, transparent output

  • Clock, frame and offset time expressions
  • ttp:tickRate, ttp:frameRate and frame rate multiplier
  • XML entities and <br/> line breaks

TTML and DFXP explained

How TTML and DFXP store subtitle timing

TTML is precise about time and very flexible about how it is written. Most conversion problems come from the timing attributes, not the text.

One format, two names

TTML is the Timed Text Markup Language from the W3C. Earlier drafts called it DFXP, the Distribution Format Exchange Profile, and the name survives in profile names and the .dfxp extension. YouTube's help page treats .dfxp files as TTML. A TTML document is XML in the http://www.w3.org/ns/ttml namespace, and each caption is usually a <p> element with begin and end attributes, or begin and dur.

Three ways to write a time

TTML2 allows clock time such as 00:00:01.500, clock time with a frame count such as 00:00:01:12, and offset time: a number followed by h, m, s, ms, f (frames) or t (ticks), for example 1.5s or 90f. Frames are counted using ttp:frameRate, which defaults to 30 when the file does not set it, adjusted by ttp:frameRateMultiplier; NTSC's 29.97 frames per second is 30 with a 1000:1001 multiplier.

How ticks work

Ticks divide one second into equal parts, and ttp:tickRate on the root tt element says how many. With ttp:tickRate="10000000", 15000000t is 1.5 seconds. If the file sets no tick rate but does set a frame rate, the spec makes the tick rate the frame rate times the sub-frame rate; with neither, one tick is one second. The converter applies the same rules, which is why tick-based files need their root element intact.

What is kept and what is dropped

Text inside each <p> is kept, including text inside <span> elements, and XML entities such as &amp; become normal characters. A <br/> is a forced line break in TTML and becomes a line break in the SRT. Styles, regions and positions, colours, italics set through tts attributes, language tags and metadata are dropped, because SRT cannot store them.

Check nested timing

The converter reads begin, end and dur on each <p>. In TTML, a time on a parent <div> or <body> shifts the paragraphs inside it, and times can also sit on <span> elements. Neither is added here. If every cue comes out early by the same amount, add the parent offset with the subtitle time shift tool. Image-based subtitles contain no text, so they produce no cues.

Questions

Frequently asked questions

Is DFXP the same as TTML?

Yes, in practice. DFXP (Distribution Format Exchange Profile) was the earlier name for TTML and lives on in profile names and the .dfxp extension. YouTube's help page treats .dfxp files as TTML, and this converter reads both.

Which time formats can it read?

Clock time (00:00:01.000), clock time with frames (00:00:01:12) and offset time in hours, minutes, seconds, milliseconds, frames or ticks (1.5s, 1500ms, 90f, 15000000t). Frames and ticks use the ttp:frameRate, ttp:frameRateMultiplier and ttp:tickRate values on the root element.

Is styling kept?

No. SRT has no place for TTML styles, regions, colours or positions, so only the text and line breaks are kept.

Is my file uploaded?

No. The XML is parsed in your browser and never sent to a server. The tool is free and needs no account.

Why are my cues all shifted by the same amount?

Your file probably sets a begin time on a <div> or <body>, which TTML adds to the paragraphs inside it. This converter reads times on each <p> only, so add that offset with the subtitle time shift tool.

Why did some paragraphs not convert?

A <p> without a begin time, with times only on its <span> children, or with a wallclock time is skipped. Paragraphs with no text are skipped too.

Continue your subtitle workflow