SRT (.srt)
.srt file signature | application/x-subrip
Magic Bytes
Offset 0
31 0A 30 30
Sources: Apache Tika
All Known Signatures
6 signature variants are documented for .srt files across multiple sources.
| Hex Signature | Offset | Sources |
|---|---|---|
| 31 0A 30 30 | 0 | Apache Tika |
| 31 0D 30 30 | 0 | Apache Tika |
| 30 78 33 31 30 44 30 41 31 33 30 33 30 | 0 | Apache Tika |
| EF BB BF 31 0A 30 30 | 0 | Apache Tika |
| EF BB BF 31 0D 30 30 | 0 | Apache Tika |
| 30 78 45 46 42 42 42 46 33 31 30 44 30 41 31 33 30 33 30 | 0 | Apache Tika |
Extension
.srt
MIME Type
application/x-subrip
Byte Offset
0
Risk Level
Safe
Validation Code
How to validate .srt files in Python
def is_srt(file_path: str) -> bool:
"""Check if file is a valid SRT by magic bytes."""
signature = bytes([0x31, 0x0A, 0x30, 0x30])
with open(file_path, "rb") as f:
return f.read(4) == signature
How to validate .srt files in Node.js
function isSRT(buffer: Buffer): boolean {
const signature = Buffer.from([0x31, 0x0A, 0x30, 0x30]);
return buffer.subarray(0, 4).equals(signature);
}
How to validate .srt files in Go
func IsSRT(data []byte) bool {
signature := []byte{0x31, 0x0A, 0x30, 0x30}
if len(data) < 4 {
return false
}
return bytes.Equal(data[:4], signature)
}
API Endpoint
/api/v1/srt
curl https://filesignature.org/api/v1/srt
See the full API documentation for all endpoints and parameters.
Frequently Asked Questions
What is a .srt file?
A .srt file is a SRT file.
What are the magic bytes for .srt files?
The magic bytes for SRT files are 31 0A 30 30 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .srt file?
To validate a .srt file, read the first bytes of the file and compare them against the known magic bytes (31 0A 30 30) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .srt files?
The primary MIME type for .srt files is application/x-subrip.
Is it safe to open .srt files?
SRT (.srt) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.