Timing and Sync

Timecodes in Subtitle Files

Timecodes tie each line of subtitle text to a position in the video. Learn how they are written, how they differ between formats, and how they can go wrong.

On this page
  1. What a timecode is
  2. The usual layout
  3. Two common styles
  4. The starting point
  5. Timecodes and edits
  6. What can go wrong
  7. Precision and readability
  8. Reading a file with your own eyes

What a timecode is

A timecode is a label for a position in a video, written as a time. It says “this moment, measured from a starting point.” In a subtitle file, every cue carries two of them: one for when the text appears and one for when it disappears. Together they anchor the words to the picture and sound.

The file does not contain any knowledge of what is being said. It simply says that at one moment text should show, and at another it should go. The player does the rest by comparing the current playback position with those numbers.

The usual layout

Most timecodes are written as hours, minutes, seconds and a smaller unit, separated by punctuation. For example, 00:01:05.500 means zero hours, one minute, five seconds and five hundred thousandths of a second, which is half a second. Some formats separate the fraction with a comma and others with a period. Some write fewer digits for hours or leave out the hours when they are zero. These small differences are why a file that works in one tool may fail or look wrong in another.

Because the units are base 60 for minutes and seconds but base 10 for fractions, it is easy to make arithmetic mistakes by hand. Adding ten seconds to 00:00:55.000 gives 00:01:05.000, not 00:00:65.000. Tools that shift timecodes do this correctly, so it is better to use them than to edit numbers manually.

Two common styles

There are two broad ways to write the last part of a timecode.

  • Time-based: The final part is a fraction of a second, such as milliseconds. It is independent of the video’s frame rate, which makes it simple for web video and plain text files.
  • Frame-based: The final part counts frames, usually written as HH:MM:SS:FF. The number of frames in a second depends on the video, so the same digits mean different moments at different rates. This style is common in professional editing and broadcast work.

When frame-based timecodes are read at the wrong rate, the cues land in the wrong places. A file timed at one rate and played against video at another may start correctly and slip further out of line as it goes. This is one of the main causes of sync drift.

The starting point

All timecodes are measured from some zero. In a web file that zero is normally the start of the video. In broadcast and editing work, the first frame of a program often has a timecode like 01:00:00:00, with the hour showing, rather than zero. The reason is practical: it leaves room for color bars, tone and other material before the program starts.

If a subtitle file was timed against a version that began at 01:00:00:00 and is applied to a version that begins at zero, every cue will be off by an hour unless the tool corrects for the offset. Knowing where the clock starts is therefore a basic part of checking a file. It is also why source preparation and exact version labeling matter before work begins.

Timecodes and edits

When a video is re-edited, scenes may be shortened, removed or reordered. The old timecodes then point to the wrong moments. In some cases the offset is constant, such as a section of added introduction, and everything after it can be shifted by the same amount. In others, different parts need different adjustments. Teams that reuse subtitles when a video is re-edited usually compare the old and new versions and move cue groups accordingly.

What can go wrong

Several simple mistakes recur:

  • End before start: A cue whose end time is earlier than its start time will confuse most players.
  • Overlapping cues: One cue starts before the previous has ended. Some players show both, others drop one.
  • Wrong separator or length: A missing digit or a comma where a period is expected can cause a file to be rejected or misread.
  • Cumulative error: A slightly wrong conversion factor makes cues slip more as the video progresses.

Many subtitle editors and checkers flag these automatically. They remain worth a quick look, particularly after a file has been converted from one format to another.

Precision and readability

Timecodes can be extremely precise, but the viewer does not need that. A video at 25 frames per second has a new frame every 0.04 seconds, so timing finer than a frame has no visible effect. For most purposes, accuracy to a frame or to a few hundredths of a second is enough. What matters more is that the cue starts and ends in a place that suits the speech and the picture, which is the job of the person doing the timing.

Reading a file with your own eyes

You can learn a lot by opening a plain text subtitle file in an ordinary text editor. Look at the first few cues. Check the format of the numbers, whether the first cue starts near where you expect, and whether the times only ever increase. If the first cue is a minute or more before the first spoken word, or the later cues stop making sense, the timecodes are the first thing to investigate.

The complete guide to timing and sync

How Subtitle Timing Works
Read the guide

Keep exploring

Guides from other topics

All topics →