vCard file (.vcf)
.vcf file signature | text/vcard
vCard file
Magic Bytes
Offset 0
42 45 47 49 4E 3A 56 43 41 52 44
Sources: Apache Tika, Neil Harvey FileSignatures
All Known Signatures
2 signature variants are documented for .vcf files across multiple sources.
| Hex Signature | Offset | Sources |
|---|---|---|
| 42 45 47 49 4E 3A 56 43 41 52 44 | 0 | Apache Tika, Neil Harvey FileSignatures |
| 42 45 47 49 4E 3A 56 43 41 52 44 0D 0A | 0 | Gary Kessler |
Extension
.vcf
MIME Type
text/vcard, text/x-vcard
Byte Offset
0
Risk Level
Safe
Validation Code
How to validate .vcf files in Python
def is_vcf(file_path: str) -> bool:
"""Check if file is a valid VCF by magic bytes."""
signature = bytes([0x42, 0x45, 0x47, 0x49, 0x4E, 0x3A, 0x56, 0x43, 0x41, 0x52, 0x44])
with open(file_path, "rb") as f:
return f.read(11) == signature
How to validate .vcf files in Node.js
function isVCF(buffer: Buffer): boolean {
const signature = Buffer.from([0x42, 0x45, 0x47, 0x49, 0x4E, 0x3A, 0x56, 0x43, 0x41, 0x52, 0x44]);
return buffer.subarray(0, 11).equals(signature);
}
How to validate .vcf files in Go
func IsVCF(data []byte) bool {
signature := []byte{0x42, 0x45, 0x47, 0x49, 0x4E, 0x3A, 0x56, 0x43, 0x41, 0x52, 0x44}
if len(data) < 11 {
return false
}
return bytes.Equal(data[:11], signature)
}
API Endpoint
/api/v1/vcf
curl https://filesignature.org/api/v1/vcf
See the full API documentation for all endpoints and parameters.
Frequently Asked Questions
What is a .vcf file?
A .vcf file is a vCard file file. vCard file
What are the magic bytes for .vcf files?
The magic bytes for vCard file files are 42 45 47 49 4E 3A 56 43 41 52 44 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .vcf file?
To validate a .vcf file, read the first bytes of the file and compare them against the known magic bytes (42 45 47 49 4E 3A 56 43 41 52 44) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .vcf files?
The primary MIME type for .vcf files is text/vcard. Additional MIME types include: text/vcard, text/x-vcard.
Is it safe to open .vcf files?
vCard file (.vcf) 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.