Convert XML to SRT
Turn XML subtitles, YouTube captions or Timed Text, into a SubRip file that players and editors open.
How to convert XML subtitles to SRT
Open your .xml file
Drop one file into the box above, or click to browse. The page also takes .dfxp, .ttml and .itt files. The file is read by your browser and never uploaded.
Check the preview
The Conversion box shows how many subtitles were read and what changes. If the file isn't subtitles at all, you'll see a message instead of a preview.
Download the .srt file
Save the converted file. It keeps the original name with the new extension, so
captions.xmlbecomescaptions.srt.
Two kinds of XML subtitles
".xml" only says the file is written in XML, a way of marking up text with tags. Subtitles in XML come in two families, and they look quite different inside.
Timed Text (TTML, DFXP)
<tt xmlns="http://www.w3.org/ns/ttml">
<body>
<div>
<p begin="00:00:03.120" end="00:00:05.480">Is this seat taken?</p>
</div>
</body>
</tt>
This is the W3C standard for subtitles. Streaming services, broadcasters and professional subtitling software use it. Each <p> is a subtitle with a begin and an end time, and styles and screen regions are described in a header. Files saved from streaming sites usually look like this, whether they are named .xml, .dfxp or .ttml. See Convert DFXP to SRT for the details of that format.
YouTube caption XML
<timedtext format="3">
<body>
<p t="3120" d="2360">Is this seat taken?</p>
</body>
</timedtext>
YouTube's newer caption XML gives each line a start time t and a duration d, both in milliseconds. Automatic captions split lines into word-by-word <s> pieces, which the converter joins back together. YouTube's older format is a <transcript> with <text start="3.12" dur="2.36"> lines in seconds, and its text is escaped twice, so an apostrophe shows up as &#39;. The converter decodes it back into an apostrophe.
What the converter does
- It finds the subtitle lines, whichever of the two formats the file uses.
- It works out start and end times from clock times, ticks, frames, offsets, or YouTube's start plus duration.
- It keeps line breaks, italic, bold and underline, and joins pieces of the same line.
- It skips empty lines that only open a caption window, and lines it can't time. A broken line never stops the rest of the file from converting.
- It numbers the result from 1 and writes standard SubRip times,
00:00:03,120 --> 00:00:05,480.
Why convert to SRT at all
An XML subtitle file only plays where its format is understood. A website's own player reads its XML. A TV, a phone app or a video editor usually doesn't. SubRip is the format almost every device and program reads: plain text, a number, two times and the words. Once your captions are in SubRip, you can load them in VLC, upload them to another platform, translate them, or burn them into a video with an editor.
Tips
Check that it is subtitles. An .xml file can hold anything, from a podcast feed to program settings. If the page says it found no subtitles, open the file in a text editor and look at the first tag.
Auto-captions overlap. Lines from YouTube's automatic captions often overlap by a fraction of a second. Most players handle that, but some TVs show two lines stacked. Fix SRT File can remove the overlaps after converting.
Times off by a fixed amount. If you edited the video after the captions were made, every line can be early or late by the same amount. Move them all with Shift Subtitle Timing.
Frequently asked questions
What kind of XML subtitles can this page convert?
Two kinds. Timed Text (TTML), the XML format streaming services and broadcasters use, which is also sold under the names DFXP and iTT. And YouTube's own caption XML, which starts with <timedtext> or <transcript>. The page reads what is inside the file and picks the right reader on its own.
How do I know what is inside my .xml file?
Open it in a text editor and look at the first element after the <?xml ?> line. <tt> means Timed Text. <timedtext> or <transcript> means YouTube captions. Anything else, such as <rss> or <html>, is not a subtitle file and the page will say so.
Why does YouTube give me an XML file instead of SRT?
YouTube stores captions in its own formats and serves them as XML. Tools that save captions from YouTube often keep that XML as it is. Converting turns it into a SubRip file that video players and editors open.
My YouTube captions repeat words. Why?
Automatic captions are written to scroll, so one line can appear as several short pieces that overlap. The converter keeps every piece with its own times. If lines stack on top of each other in your player, Fix SRT File can remove the overlaps after converting.
Is anything lost when converting XML to SRT?
The words, line breaks and times stay the same. Italic, bold and underline become SubRip tags, and a Timed Text line placed at the top of the picture keeps the {\an8} code. Colours, fonts and window positions are left out.
Are my subtitle files uploaded anywhere?
No. The file is read and converted by JavaScript in this browser tab. It never leaves your device, and the tool keeps working if you go offline after the page has loaded.
Related tools
Shift Subtitle Timing
Subtitles too early or too late? Move every line by any number of seconds.
Open toolFix Subtitle Encoding
Repair garbled characters like é or ??? caused by the wrong text encoding.
Open toolConvert DFXP to SRT
Turn .dfxp subtitles downloaded from Netflix, Amazon or a streaming site into SubRip for any player or TV.
Open toolConvert SBV to SRT
Turn YouTube .sbv captions into SubRip for players, TVs and video editors.
Open tool