TTML

Also known as: Timed Text Markup Language

On this page 7

TTML, the Timed Text Markup Language, is an XML-based standard from the W3C for describing text that appears in synchronization with media, such as subtitles, captions and on-screen descriptions. In video accessibility, TTML serves as a rich interchange and delivery format that carries not only the words and their timing but also positioning, styling and language metadata needed for accessible viewing.

Unlike simple sidecar formats, TTML was designed to preserve the full intent of professional captioning, which is why broadcasters, streaming platforms and archive systems use it as a master or distribution format across many devices.

How a TTML document is structured

A TTML file is an XML document with a root tt element that contains a head and a body. The head defines styles, regions and metadata, while the body holds the timed content in div, p and span elements. Each paragraph carries begin and end attributes that tell the player exactly when the text should appear and disappear.

This separation of content from presentation is the central design idea. A caption author can define a region such as the lower third of the screen once, attach a style with font, color and background, and then reference both from hundreds of cues. The table below lists the core building blocks.

ElementLocationPurpose
ttRootDeclares namespaces, language and timing parameters
styling and styleHeadDefine fonts, colors, outlines and backgrounds
layout and regionHeadDefine screen areas where text may appear
div and pBodyGroup and hold individual caption cues
spanBodyApplies styling to part of a line
brBodyForces a line break inside a cue
Core elements of a TTML document

Timing models and expressions in TTML

TTML supports several time expression formats, which lets it match both broadcast and web workflows. Clock time such as 00:01:23.500 is common, while frame-based timing expressed against a declared frame rate suits broadcast material where captions must align with exact video frames.

Timing can also be relative to a parent element, so a whole block of cues can be shifted by changing one value. This flexibility is powerful but is a frequent source of errors when different tools interpret time bases and frame rates inconsistently, for example between 25 fps and 29.97 fps drop-frame material.

Expression typeExampleTypical use
Clock time00:00:05.250Web and streaming delivery
Frame-based clock00:00:05:06Broadcast workflows tied to timecode
Offset in seconds5.25sSimple programmatic generation
Offset in frames131fFrame-accurate editing tools
Offset in ticks52500000tHigh-precision streaming profiles
Common TTML time expressions

TTML profiles used in practice

Full TTML is large and flexible, so industry groups define profiles that restrict it to a predictable subset. A player that supports a profile can render every file that conforms to it, which is essential for interoperable accessibility across televisions, browsers and mobile devices.

ProfileMain domainNotable characteristic
IMSC 1.x TextStreaming and webW3C profile adopted by many platforms
IMSC 1.x ImageStreaming of graphic subtitlesCarries subtitle images instead of text
EBU-TT-DEuropean broadcast distributionDesigned for online and HbbTV delivery
SMPTE-TTUS broadcast and online videoCan embed legacy CEA-608 data
DFXPEarly web and Flash playersOriginal 1.0 profile name, now legacy
Widely used TTML profiles

IMSC, the Internet Media Subtitles and Captions profile, has become the most important modern profile because it is referenced by streaming packaging standards and can be carried inside fragmented MP4 segments used by DASH and HLS delivery.

TTML compared with other caption formats

TTML competes with simpler text formats and with legacy broadcast standards. Its main advantage is expressive styling and positioning, which supports accessibility features such as speaker placement, colored text for speaker identification and avoidance of on-screen graphics. Its main drawback is verbosity and complexity compared with plain-text formats.

FormatSyntaxStyling and layoutTypical role
TTMLXMLRich, region-basedMastering, broadcast and streaming
WebVTTPlain textModerate, CSS-basedHTML5 web video
SubRipPlain textMinimalConsumer subtitles and simple exchange
SCCEncoded hex pairsLimited to CEA-608 featuresLegacy US broadcast captions
CEA-708Binary in video streamModerate, window-basedUS digital television captions
TTML and related caption formats

In practice, many workflows keep a TTML or IMSC master and convert it to WebVTT for browsers or to SCC for legacy broadcast outlets. Each conversion can lose positioning or styling, so quality control after conversion is a standard step.

Accessibility strengths and common pitfalls

TTML supports accessibility well when it is authored carefully. It can mark language per element, place captions away from burned-in graphics, and express non-speech information such as sound effects for closed captions and SDH. It also allows viewers’ players to apply user preferences, since styles are declared separately from text.

  • Profile mismatch: a file valid as full TTML may be rejected by an IMSC-only player.
  • Frame rate errors: wrong frameRate or frameRateMultiplier values cause drifting captions.
  • Overlapping regions: poorly defined regions can hide text behind other cues.
  • Excessive styling: decorative fonts and low contrast reduce readability for low-vision viewers.
  • Missing language tags: screen readers and players cannot select the correct language track.

Validation against the target profile, combined with visual playback checks on the actual devices, catches most of these problems before release. Accessibility reviewers also check caption reading rate and synchronization, which TTML records precisely but cannot enforce by itself.

A non-technical view

TTML is a way of writing down captions so that any compatible video player knows what to show, when to show it and where. Think of it as a detailed script for the words on screen, with notes about timing, position and appearance.

Simpler caption files only list the words and times. TTML adds instructions for layout and style, so a caption can move to the top of the screen when a scoreboard is at the bottom, or change color to show who is speaking. That extra detail helps people who are deaf or hard of hearing follow the video more easily.

A concrete example

A public broadcaster prepares a documentary series for its streaming service and its television channel. The captioning team authors one IMSC 1.1 Text master in TTML at 25 frames per second, using two regions: the default lower area and an upper area for scenes with lower-third name graphics.

From that single master, the delivery system packages captions into fragmented MP4 segments for DASH streaming, converts a copy to WebVTT for the web player, and creates an EBU-TT-D file for HbbTV. During quality control, reviewers notice that one converter ignored the upper region, so captions covered interviewee names on the web player. After fixing the converter settings, all three outputs show identical timing and placement, and the series passes the broadcaster’s accessibility checks on the first resubmission.