BIB magic bytes (.bib)
.bib file signature: 25 20 42 69 62 54 65 58 20 60 | application/x-bibtex-text-file
BibTeX Bibliography File (BIB) is a plain-text bibliographic database format created by Oren Patashnik for use with the BibTeX tool and maintained through the TeX community. It is used to store references for academic papers, books, theses, and other scholarly documents, typically in conjunction with LaTeX. The format is legacy but remains widely supported; as plain text, it poses little security risk beyond untrusted content in downstream processing.
Magic Bytes
Offset 0
25 20 42 69 62 54 65 58 20 60
Sources: Apache Tika
All Known Signatures
5 signature variants are documented for .bib files across multiple sources.
| Hex Signature | Offset | Sources |
|---|---|---|
| 25 20 42 69 62 54 65 58 20 60 | 0 | Apache Tika |
| 25 25 25 20 20 | 73 | Apache Tika |
| 25 20 42 69 62 54 65 58 20 73 74 61 6E 64 61 72 64 20 62 69 62 6C 69 6F 67 72 61 70 68 79 20 | 0 | Apache Tika |
| 25 25 25 20 20 40 42 69 62 54 65 58 2D 73 74 79 6C 65 2D 66 69 6C 65 7B | 73 | Apache Tika |
| 25 | 0 | Apache Tika |
Validation Code
How to validate .bib files in Python
def is_bib(file_path: str) -> bool:
"""Check if file is a valid BIB by magic bytes."""
signature = bytes([0x25, 0x20, 0x42, 0x69, 0x62, 0x54, 0x65, 0x58, 0x20, 0x60])
with open(file_path, "rb") as f:
return f.read(10) == signature
How to validate .bib files in Node.js
function isBIB(buffer: Buffer): boolean {
const signature = Buffer.from([0x25, 0x20, 0x42, 0x69, 0x62, 0x54, 0x65, 0x58, 0x20, 0x60]);
return buffer.subarray(0, 10).equals(signature);
}
How to validate .bib files in Go
func IsBIB(data []byte) bool {
signature := []byte{0x25, 0x20, 0x42, 0x69, 0x62, 0x54, 0x65, 0x58, 0x20, 0x60}
if len(data) < 10 {
return false
}
return bytes.Equal(data[:10], signature)
}
API Endpoint
/api/v1/bib
curl https://filesignature.org/api/v1/bib
See the full API documentation for all endpoints and parameters.
Related Formats
Frequently Asked Questions
What is a .bib file?
A .bib file is identified by the magic bytes 25 20 42 69 62 54 65 58 20 60 at byte offset 0. BibTeX Bibliography File (BIB) is a plain-text bibliographic database format created by Oren Patashnik for use with the BibTeX tool and maintained through the TeX community. It is used to store references for academic papers, books, theses, and other scholarly documents, typically in conjunction with LaTeX. The format is legacy but remains widely supported; as plain text, it poses little security risk beyond untrusted content in downstream processing.
What are the magic bytes for .bib files?
The magic bytes for BIB (.bib) files are 25 20 42 69 62 54 65 58 20 60 at byte offset 0. These bytes identify the file format more reliably than the extension alone.
How do I validate a .bib file?
To validate a .bib file, read the first bytes of the file and compare them against the known magic bytes (25 20 42 69 62 54 65 58 20 60) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .bib files?
The primary MIME type for .bib files is application/x-bibtex-text-file.
Is it safe to open .bib files?
BIB (.bib) 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.