with open('output.srt', 'w', encoding='utf-8') as f: for index, row in df.iterrows(): # Write cue number f.write(str(row['Cue']) + '\n') # Write timestamp (ensure comma for milliseconds) start = row['Start Time'].replace('.', ',') end = row['End Time'].replace('.', ',') f.write(start + ' --> ' + end + '\n') # Write text f.write(row['Text'] + '\n') # Write blank line f.write('\n')
| Use Case | Excel Template Columns Needed | |----------|-------------------------------| | YouTube captions | Index, Start, End, Dialogue | | Translated subtitles | + Original text, Translated text | | Lecture transcription | Speaker label, Timestamp, Text | | Karaoke-style lyrics | Line index, Timecode, Lyrics line |
To save time and avoid headaches, follow these professional rules:
A unique integer for each subtitle (e.g., 1, 2, 3).
Software like (free), Aegisub , or MacCaption allows importing CSV/Excel files.
: SRT files require a very specific format ( HH:MM:SS,mmm ).
Your goal when converting Excel to SRT is to arrange your data so it mirrors this structure.
Manually typing an .srt file is tedious and error-prone. Fortunately, if you know how to use conversion, you can turn rows of data into professional subtitles in seconds.
You can use Excel formulas to concatenate the SRT format into a single column, then paste it into Notepad.








