Radiance High Dynamic Range image file (.hdr)
.hdr file signature | application/octet-stream
Header file of a .hdr/.img pair inNIfTIformat, used extensively in biomedical imaging.
Magic Bytes
Offset 0
23 3F 52 41 44 49 41 4E 43 45 0A
Sources: Wikipedia, Gary Kessler
All Known Signatures
3 signature variants are documented for .hdr files across multiple sources.
| Hex Signature | Offset | Sources |
|---|---|---|
| 23 3F 52 41 44 49 41 4E 43 45 0A | 0 | Wikipedia, Gary Kessler |
| 6E 69 31 00 | 344 | Wikipedia |
| 49 53 63 28 | 0 | Gary Kessler |
Extension
.hdr
MIME Type
application/octet-stream
Byte Offset
0
Risk Level
Safe
Validation Code
How to validate .hdr files in Python
def is_hdr(file_path: str) -> bool:
"""Check if file is a valid HDR by magic bytes."""
signature = bytes([0x23, 0x3F, 0x52, 0x41, 0x44, 0x49, 0x41, 0x4E, 0x43, 0x45, 0x0A])
with open(file_path, "rb") as f:
return f.read(11) == signature
How to validate .hdr files in Node.js
function isHDR(buffer: Buffer): boolean {
const signature = Buffer.from([0x23, 0x3F, 0x52, 0x41, 0x44, 0x49, 0x41, 0x4E, 0x43, 0x45, 0x0A]);
return buffer.subarray(0, 11).equals(signature);
}
How to validate .hdr files in Go
func IsHDR(data []byte) bool {
signature := []byte{0x23, 0x3F, 0x52, 0x41, 0x44, 0x49, 0x41, 0x4E, 0x43, 0x45, 0x0A}
if len(data) < 11 {
return false
}
return bytes.Equal(data[:11], signature)
}
API Endpoint
/api/v1/hdr
curl https://filesignature.org/api/v1/hdr
See the full API documentation for all endpoints and parameters.
Frequently Asked Questions
What is a .hdr file?
A .hdr file is a Radiance High Dynamic Range image file file. Header file of a .hdr/.img pair inNIfTIformat, used extensively in biomedical imaging.
What are the magic bytes for .hdr files?
The magic bytes for Radiance High Dynamic Range image file files are 23 3F 52 41 44 49 41 4E 43 45 0A at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .hdr file?
To validate a .hdr file, read the first bytes of the file and compare them against the known magic bytes (23 3F 52 41 44 49 41 4E 43 45 0A) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .hdr files?
There is no officially registered MIME type for .hdr files. Systems typically use application/octet-stream as a generic fallback when handling this format.
Is it safe to open .hdr files?
Radiance High Dynamic Range image file (.hdr) 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.