TechBuzzPro

Align Two Subtitle Files Sentence by Sentence for Bilingual Captions

· 5 min read · Apps & Browsers

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Creating bilingual subtitles means showing two languages on screen at the same time, usually one at the top and one at the bottom. To do that, you need two subtitle files (like .srt or .vtt) that share the same timing for each line. This guide walks you through aligning them sentence by sentence, so both languages appear together and stay in sync. You don't need any special software—just a text editor and a little patience.

What You'll Need

  • Two subtitle files in the same format (e.g., both .srt or both .vtt). If they're different, convert one to match the other first.
  • A plain text editor (Notepad on Windows, TextEdit on Mac in plain text mode, or any code editor like VS Code).
  • Optional: a free subtitle editor like Subtitle Edit (Windows) or Aegisub (cross-platform) to help with timing adjustments.
  • Optional: a video player that supports subtitle tracks (like VLC) to check your work.

Step-by-Step

  1. Open both files in your text editor. Look at the structure. A typical .srt file looks like:
    1
    00:00:01,000 --> 00:00:04,000
    Hello, how are you?
    Note the sequence numbers, the timestamp line, and the subtitle text.
  2. Decide which file is your base. Usually, you keep the original language as the base and align the translation to it. If both are translations, pick the one with more accurate timing.
  3. Copy the base file's timestamps. You'll be replacing the timestamps in the second file with those from the base. But first, you need to match the text lines.
  4. Start from the top. Look at the first subtitle in the base file and the first in the second file. They should be the same sentence or phrase. If they are, copy the base timestamp line and paste it over the second file's timestamp. If they aren't, you need to find the matching sentence in the second file.
  5. When sentences don't match line-by-line: Sometimes the translation has a different number of lines. For example, base has one line for a sentence, but the translation splits it into two. In that case, you can merge the two translated lines into one (put them on separate lines within the same subtitle block) or split the base line if needed. The goal is to have the same start and end times for both.
  6. Repeat for every subtitle. Go through each numbered entry. For each, copy the timestamp from the base and paste it into the second file, overwriting its timestamp. Do this until you reach the end.
  7. Save the second file. Keep the same format and encoding (usually UTF-8). Save it with a new name so you don't lose the original.
  8. Test in a video player. Load the video, add both subtitle tracks (or combine them later), and play. Check that the text appears at the same time and stays for the same duration.
  9. If you want a single combined file: You can merge both into one .srt by putting the base text on one line and the translation on the next line within the same timestamp block. For example:
    1
    00:00:01,000 --> 00:00:04,000
    Hello, how are you?
    Hola, ¿cómo estás?
    This is a common format for bilingual subtitles.

Common Mistakes

  • Assuming line numbers match. The translation may have more or fewer lines. Always compare the text, not the numbers.
  • Copying timestamps without checking the text. If you blindly copy, you might end up with the wrong translation on screen.
  • Ignoring timecodes with commas vs periods. Some files use commas (00:00:01,000) and others use periods (00:00:01.000). Be consistent; mixing them can cause errors.
  • Not checking the end time. If the base subtitle is longer than the translation, the translation might disappear too early or stay too long.
  • Saving in the wrong encoding. If you save as ANSI instead of UTF-8, special characters (like accents) may break.

Tips

  • Use a subtitle editor for large files. Manually editing hundreds of lines is tedious. Tools like Subtitle Edit have a "synchronize" feature that can shift all timestamps at once if the delay is constant.
  • Leverage online alignment tools. Some websites can automatically align two subtitle files by matching text patterns, but always review the result manually.
  • Keep the original files as backup. You might need them if you make a mistake.
  • Check for overlapping subtitles. If two subtitles appear at the same time, players may show only one. Make sure your combined file doesn't have overlapping timestamps.
  • Use a consistent line break style. In a combined file, decide whether the original or translation comes first and stick to it.

Troubleshooting

  • Subtitles are out of sync by a constant amount. If all lines are shifted by the same delay, use a subtitle editor to shift the entire track by that amount (e.g., +2 seconds or -500 ms).
  • One specific line is out of sync. Manually adjust that line's timestamp in both files.
  • Text is garbled (shows as ????). The file is likely saved in the wrong encoding. Re-save as UTF-8.
  • The video player doesn't show both subtitles. Some players only display one track. Use a player like VLC that supports multiple subtitle tracks, or combine them into one file.
  • Timestamps are in frames instead of milliseconds. Some formats use frames (e.g., 00:00:01:12). You'll need to convert frames to milliseconds based on the frame rate, or use a subtitle editor that handles it.

Frequently Asked Questions

  1. Can I align subtitles automatically? Yes, some tools can auto-align based on text similarity, but they often need manual correction. For perfect alignment, manual work is best.
  2. What if the translation has more lines than the original? You can merge the extra lines into one subtitle block (just put them on separate lines) or split the original subtitle to match. The key is to have the same start and end times.
  3. Do I need to change the sequence numbers? No, the sequence numbers are just order markers. You can keep them as they are, but if you merge or split, you may need to renumber all subsequent lines.
  4. Can I align .vtt files the same way? Yes, .vtt files have a similar structure (with optional WEBVTT header). The process is the same.
  5. How do I add the aligned subtitles to a video? You can either mux them into the video file (using tools like HandBrake or MKVToolNix) or play them as external tracks. For a single file, combine them as described in step 9.
  6. What if the base file has a line that the translation doesn't have? You can either duplicate the translation line (if it's just a repeated phrase) or leave it out—but then the translation won't appear for that line. It's better to add a translation if possible.