Skip to content
Free Subtitle Converter
Language
Color theme
Support us

SRT to TTML converter

Broadcasters, streaming services and caption platforms often ask for TTML, the W3C’s XML format for timed text. Convert an SRT file into a plain TTML 1 document: every caption becomes a timed paragraph with its line breaks and italics.

Convert your subtitle file

Subtitle fileStays on your device

Drop subtitle files here

SRT, VTT, ASS, SBV, TTML, SUB, SMI, LRC and more · up to 100 files

Or paste subtitle text
No file at hand?

Your file is read by this page in your browser. It is not uploaded anywhere.

How to use it

  1. Open the SRT file

    Drop the .srt file, or a whole batch for a delivery. The TTML files are saved as UTF-8.

  2. Check the TTML preview

    TTML is already selected. Each caption appears as a p element with begin and end times.

  3. Download and add the language

    Save the .ttml file, then fill in xml:lang on the tt element if your platform asks for a language.

What the TTML file contains

The file starts with an XML declaration and a tt element in the TTML namespace, followed by a body with one div. Each caption becomes a p element with begin and end times written as hours, minutes, seconds and milliseconds, such as 00:00:01.000. Line breaks become <br/>, and italic, bold and underline become span elements with tts:fontStyle, tts:fontWeight and tts:textDecoration.

There is no head section: no named styles, no layout regions and no frame or tick rate. Where and how the text appears is left to the player or platform. Characters such as & and < are written as &amp; and &lt;, as XML requires.

Before and after

Two SRT captions and the TTML document. The italic caption becomes a span with tts:fontStyle="italic", the line break becomes <br/>, the & becomes &amp;, and the times keep all three decimal places.

Your SRT file
1
00:00:01,000 --> 00:00:03,500
<i>Where were you last night?</i>

2
00:00:04,000 --> 00:00:06,250
At the station,
waiting for you & the kids.
The TTML file you download
<?xml version="1.0" encoding="UTF-8"?>
<tt xmlns="http://www.w3.org/ns/ttml" xmlns:tts="http://www.w3.org/ns/ttml#styling" xml:lang="">
  <body>
    <div>
      <p begin="00:00:01.000" end="00:00:03.500"><span tts:fontStyle="italic">Where were you last night?</span></p>
      <p begin="00:00:04.000" end="00:00:06.250">At the station,<br/>waiting for you &amp; the kids.</p>
    </div>
  </body>
</tt>

Before you deliver the file

The language attribute on the tt element is left empty, as xml:lang="". Many delivery specifications require a language, so open the file in a text editor and fill it in, for example xml:lang="en".

Some services ask for a particular profile, such as IMSC, or their own TTML variant with required regions, styles or metadata. This converter writes plain TTML 1, so read the specification and add what it requires.

Prefer the command line?

If FFmpeg is installed on your computer, this conversion takes one command:

ffmpeg -i input.srt output.ttml

FFmpeg 4.4 and later can write TTML, but its TTML writer keeps only the words and line breaks, so italics are lost. This page writes them as tts:fontStyle spans.

Nothing to install here: open up to 100 files at once on this page and download them all as one ZIP.

Need it the other way round? Use the TTML to SRT converter. More about these formats: XML subtitles explained: TTML, DFXP and IMSC

Questions and answers

TTML or DFXP: which should I choose?

Use the one the platform asks for. This site writes the same XML for both; only the file extension differs. The SRT to DFXP converter saves a .dfxp file.

Are SRT font colors kept?

No. Only italic, bold and underline are written as TTML styling; font color tags are removed.

Does the TTML file keep my timing to the millisecond?

Yes. Times are written with three decimal places, exactly as they are in the SRT file.

Buy me a coffee