# Subtitle Time Shifter

> Moves every cue in an SRT or WebVTT subtitle file by one constant, millisecond-precise offset. It changes recognised timing lines while keeping cue text, identifiers, settings, comments and surviving line endings intact.

Use it: https://tessalor.com/en/text/subtitle-time-shifter

This tool runs entirely in the browser. Nothing entered into it is uploaded.

## How it is done

1. Read the file as UTF-8 in this browser tab. Preserve an existing UTF-8 byte-order mark and each line ending; refuse UTF-16, invalid UTF-8 and binary input rather than guessing an encoding and damaging subtitle text.
2. Treat a WEBVTT magic header as WebVTT and an accepted file without that header as SubRip. A file named .vtt is refused when the required WEBVTT first line is missing.
3. Walk blank-line-separated blocks. Preserve WebVTT header, NOTE, STYLE and REGION blocks; recognise a cue only when one of its first two lines matches that format's complete start-arrow-end grammar.
4. Parse each start and end into an integer number of milliseconds and require the end to be later than the start. Round the requested offset to one millisecond, then add it for Later or subtract it for Earlier.
5. When an earlier shift puts a whole cue at or before zero, remove it because no negative playback time exists. When only the start crosses zero, either clamp the start to zero or remove the cue, exactly as selected.
6. Write only the recognised timing line back in the source format. Preserve cue numbers, identifiers, payload text, WebVTT cue settings, structural blocks, a UTF-8 marker and the line endings of every surviving line, then offer the complete file for download.

## Assumptions

- One constant offset applies to the whole file. If captions are aligned at the start and increasingly wrong later, that is drift or a playback-speed mismatch and cannot be repaired by adding one number everywhere.
- The offset is entered in seconds and rounded once to the nearest millisecond, because both supported file formats physically store three decimal digits. Later is positive and Earlier is negative in the result panel.
- SubRip timing is hours:minutes:seconds,milliseconds around the --> arrow. Numeric cue counters, including the compact form where the counter shares the timing line, are preserved and are not renumbered when an early cue is removed.
- WebVTT requires a WEBVTT first line, uses a full stop before milliseconds and may omit the hours component while it is zero. Existing hours notation is retained, and hours are added if a shifted timestamp crosses 60 minutes.
- WebVTT NOTE, STYLE, REGION, cue identifiers and settings are kept byte for byte apart from their surviving line endings. A cue containing an inline WebVTT timestamp tag is refused because changing only its outer times would corrupt karaoke-style internal timing.
- Cues may overlap before or after the shift; applying one offset preserves that relationship. This tool validates timing syntax and direction but does not decide whether an overlap was intended.
- Input is capped at 20 MB and 250,000 cues. The worker yields while scanning a long file so progress and Cancel remain responsive.

## Inputs

| Name | Label | Type | Default | Range |
| --- | --- | --- | --- | --- |
| `source` | Subtitle file | file | chosen on your device | application/x-subrip, text/vtt, text/plain, up to 20 MB |
| `direction` | Move every cue | select | later |  |
| `offsetSeconds` | Offset (seconds) | number | 2 | 0.001 to 86400 |
| `beforeZero` | When an earlier cue crosses zero | select | clamp |  |

## Outputs

- `cuesShifted` — Cues shifted (integer), primary
- `cuesRemoved` — Cues removed (integer)
- `format` — Subtitle format (text)
- `offsetApplied` — Offset applied (seconds) (number)

## Questions

### Is the subtitle file uploaded while its timestamps are changed?

No. The file is decoded, checked and rewritten inside a worker in this browser tab. The generated browser test loads a real subtitle file and fails if using the tool sends a request away from this site.

### What does moving subtitles later by two seconds do?

It adds exactly 2,000 milliseconds to every recognised cue start and end. A cue from 00:01.250 to 00:03.500 therefore becomes 00:03.250 to 00:05.500 without changing its duration or text.

### Why did an early subtitle start at zero or disappear?

Media time cannot be negative. A cue shifted wholly to zero or earlier is removed; if only its start crosses zero, the default keeps the visible remainder from 00:00, while the advanced setting can remove the whole cue instead.

### Are WebVTT cue positions, comments and styles preserved?

Yes. Cue settings after the end time and separate NOTE, STYLE and REGION blocks are carried through unchanged. The tool changes recognised outer timing lines and refuses inline timestamp tags rather than editing only part of a more complex cue.

### Why was a subtitle in an older text encoding refused?

SRT has historically been saved in several code pages, and there is no reliable way to infer all of them from the bytes alone. Guessing could silently change names or dialogue, so this tool accepts UTF-8 and asks you to re-save UTF-16 or another encoding first.

### Will a constant subtitle offset repair frame-rate drift?

No. An offset corrects the same early or late error at every point. When the difference grows over time, the timestamps need rescaling against the correct duration or frame rate rather than the same number added to each cue.

## Sources

- [WebVTT: The Web Video Text Tracks Format](https://www.w3.org/TR/webvtt1/) — World Wide Web Consortium, applies to Candidate Recommendation Draft, 20 May 2026. Retrieved 2026-08-01.
- [SubRip Subtitle format (SRT)](https://www.loc.gov/preservation/digital/formats/fdd/fdd000569.shtml) — Library of Congress, applies to format description updated 27 May 2026. Retrieved 2026-08-01.
- [Encoding Standard](https://encoding.spec.whatwg.org/) — WHATWG, applies to Living Standard, 2026. Retrieved 2026-08-01.

## Variants

- [How do I shift every SRT subtitle by 2 seconds?](https://tessalor.com/en/text/subtitle-time-shifter/shift-srt-subtitles-by-2-seconds)
- [How do I fix subtitles that are out of sync with the audio?](https://tessalor.com/en/text/subtitle-time-shifter/fix-subtitles-out-of-sync-with-audio)

---

Estimate, not advice. See https://tessalor.com/en/disclaimer.
Machine-readable catalogue: https://tessalor.com/api/tools.json
