Skip to content

UUencoded BASE64 file (.b64)

.b64 file signature | application/octet-stream

A UUencoded BASE64 file is a plain-text interchange format that represents binary data as Base64 text, derived from Unix uuencode conventions and maintained through common mail and archive tools. It is used to embed attachments in messages, package small binaries in scripts or configuration files, and transfer data through systems that accept only text. Because it is an encoding rather than an executable format, it is generally safe, though decoded content should still be treated cautiously; the format is largely legacy in modern workflows.

Safe

Magic Bytes

Offset 0
62 65 67 69 6E 2D 62 61 73 65 36 34

Sources: Gary Kessler

Extension

.b64

MIME Type

application/octet-stream

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .b64 files in Python

Python
def is_b64(file_path: str) -> bool:
    """Check if file is a valid B64 by magic bytes."""
    signature = bytes([0x62, 0x65, 0x67, 0x69, 0x6E, 0x2D, 0x62, 0x61, 0x73, 0x65, 0x36, 0x34])
    with open(file_path, "rb") as f:
        return f.read(12) == signature

How to validate .b64 files in Node.js

Node.js
function isB64(buffer: Buffer): boolean {
  const signature = Buffer.from([0x62, 0x65, 0x67, 0x69, 0x6E, 0x2D, 0x62, 0x61, 0x73, 0x65, 0x36, 0x34]);
  return buffer.subarray(0, 12).equals(signature);
}

How to validate .b64 files in Go

Go
func IsB64(data []byte) bool {
    signature := []byte{0x62, 0x65, 0x67, 0x69, 0x6E, 0x2D, 0x62, 0x61, 0x73, 0x65, 0x36, 0x34}
    if len(data) < 12 {
        return false
    }
    return bytes.Equal(data[:12], signature)
}

API Endpoint

GET /api/v1/b64
curl https://filesignature.org/api/v1/b64

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .b64 file?

A .b64 file is a UUencoded BASE64 file file. A UUencoded BASE64 file is a plain-text interchange format that represents binary data as Base64 text, derived from Unix uuencode conventions and maintained through common mail and archive tools. It is used to embed attachments in messages, package small binaries in scripts or configuration files, and transfer data through systems that accept only text. Because it is an encoding rather than an executable format, it is generally safe, though decoded content should still be treated cautiously; the format is largely legacy in modern workflows.

What are the magic bytes for .b64 files?

The magic bytes for UUencoded BASE64 file files are 62 65 67 69 6E 2D 62 61 73 65 36 34 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .b64 file?

To validate a .b64 file, read the first bytes of the file and compare them against the known magic bytes (62 65 67 69 6E 2D 62 61 73 65 36 34) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .b64 files?

There is no officially registered MIME type for .b64 files. Systems typically use application/octet-stream as a generic fallback when handling this format.

Is it safe to open .b64 files?

UUencoded BASE64 file (.b64) 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.