Skip to content

SAS Transport File (.xpt)

.xpt file signature | application/x-sas-xport

SAS Transport File (XPT) is a platform-independent data exchange format created and maintained by SAS Institute for moving datasets between SAS systems and other software. It is used in statistical analysis, clinical research, and regulatory data submissions, including exchanges with the U.S. Food and Drug Administration. The format is legacy but still supported; it stores tabular data only and does not contain executable content, so it is generally safe to handle.

Safe

Magic Bytes

Offset 0
48 45 41 44 45 52 20 52 45 43 4F 52 44 2A 2A 2A

Sources: Gary Kessler

All Known Signatures

3 signature variants are documented for .xpt files across multiple sources.

Hex Signature Offset Sources
48 45 41 44 45 52 20 52 45 43 4F 52 44 2A 2A 2A 0 Gary Kessler
50 4B 03 04 0 Gary Kessler
58 50 43 4F 4D 0A 54 79 70 65 4C 69 62 0 Gary Kessler

Extension

.xpt

MIME Type

application/x-sas-xport

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .xpt files in Python

Python
def is_xpt(file_path: str) -> bool:
    """Check if file is a valid XPT by magic bytes."""
    signature = bytes([0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x20, 0x52, 0x45, 0x43, 0x4F, 0x52, 0x44, 0x2A, 0x2A, 0x2A])
    with open(file_path, "rb") as f:
        return f.read(16) == signature

How to validate .xpt files in Node.js

Node.js
function isXPT(buffer: Buffer): boolean {
  const signature = Buffer.from([0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x20, 0x52, 0x45, 0x43, 0x4F, 0x52, 0x44, 0x2A, 0x2A, 0x2A]);
  return buffer.subarray(0, 16).equals(signature);
}

How to validate .xpt files in Go

Go
func IsXPT(data []byte) bool {
    signature := []byte{0x48, 0x45, 0x41, 0x44, 0x45, 0x52, 0x20, 0x52, 0x45, 0x43, 0x4F, 0x52, 0x44, 0x2A, 0x2A, 0x2A}
    if len(data) < 16 {
        return false
    }
    return bytes.Equal(data[:16], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .xpt file?

A .xpt file is a SAS Transport File file. SAS Transport File (XPT) is a platform-independent data exchange format created and maintained by SAS Institute for moving datasets between SAS systems and other software. It is used in statistical analysis, clinical research, and regulatory data submissions, including exchanges with the U.S. Food and Drug Administration. The format is legacy but still supported; it stores tabular data only and does not contain executable content, so it is generally safe to handle.

What are the magic bytes for .xpt files?

The magic bytes for SAS Transport File files are 48 45 41 44 45 52 20 52 45 43 4F 52 44 2A 2A 2A at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .xpt file?

To validate a .xpt file, read the first bytes of the file and compare them against the known magic bytes (48 45 41 44 45 52 20 52 45 43 4F 52 44 2A 2A 2A) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .xpt files?

The primary MIME type for .xpt files is application/x-sas-xport.

Is it safe to open .xpt files?

SAS Transport File (.xpt) 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.