SRT to JSON Converter
Convert SubRip (.srt) subtitle files to structured JSON arrays instantly. Client-side parsing with timestamp-to-millisecond conversion.
About
This tool transforms raw SubRip (.srt) subtitle text into a structured JSON object usable in web applications, custom video players, or data analysis pipelines. Unlike simple text converters, this engine parses the specific timecode format of SRT files and calculates the absolute duration in milliseconds for every entry.
Video developers often face the risk of malformed subtitle parsing leading to desynchronized captions. This tool mitigates that risk by strictly validating the Index → Timecode → Text sequence. It handles the mathematical conversion of timestamps (e.g., 00:01:23,500) into computable integers, allowing for precise synchronization logic in JavaScript or Python environments.
Formulas
The parser breaks down the SRT structure and converts the sexagesimal time format into a linear millisecond value using the following logic:
Where h is hours, m is minutes, s is seconds, and ms is milliseconds extracted from the SRT timecode string.
Reference Data
| SRT Component | JSON Key | Data Type | Example Raw | Example Parsed |
|---|---|---|---|---|
| Sequence Index | id | Integer | 1 | 1 |
| Start Time | start | String | 00:00:20,000 | "00:00:20,000" |
| End Time | end | String | 00:00:24,400 | "00:00:24,400" |
| Duration (calc) | startMs | Integer | 20000 | 20000 |
| Content | text | String | Hello World! | "Hello World!" |