Skip to content

SAP (.sap)

.sap file signature | audio/x-sap

The SAP file format is an audio module format used for Atari 8-bit computer music, documented and maintained by the Atari SAP community. It is used to store chiptune recordings and game music for playback in emulators, media players, and archival collections. The format is legacy and generally safe, though untrusted files should be opened with software that validates headers and emulates the original hardware correctly.

Safe

Magic Bytes

Offset 0
53 41 50 0D 0A

Sources: Apache Tika

Extension

.sap

MIME Type

audio/x-sap

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .sap files in Python

Python
def is_sap(file_path: str) -> bool:
    """Check if file is a valid SAP by magic bytes."""
    signature = bytes([0x53, 0x41, 0x50, 0x0D, 0x0A])
    with open(file_path, "rb") as f:
        return f.read(5) == signature

How to validate .sap files in Node.js

Node.js
function isSAP(buffer: Buffer): boolean {
  const signature = Buffer.from([0x53, 0x41, 0x50, 0x0D, 0x0A]);
  return buffer.subarray(0, 5).equals(signature);
}

How to validate .sap files in Go

Go
func IsSAP(data []byte) bool {
    signature := []byte{0x53, 0x41, 0x50, 0x0D, 0x0A}
    if len(data) < 5 {
        return false
    }
    return bytes.Equal(data[:5], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .sap file?

A .sap file is identified by the magic bytes 53 41 50 0D 0A at byte offset 0. The SAP file format is an audio module format used for Atari 8-bit computer music, documented and maintained by the Atari SAP community. It is used to store chiptune recordings and game music for playback in emulators, media players, and archival collections. The format is legacy and generally safe, though untrusted files should be opened with software that validates headers and emulates the original hardware correctly.

What are the magic bytes for .sap files?

The magic bytes for SAP files are 53 41 50 0D 0A at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .sap file?

To validate a .sap file, read the first bytes of the file and compare them against the known magic bytes (53 41 50 0D 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 .sap files?

The primary MIME type for .sap files is audio/x-sap.

Is it safe to open .sap files?

SAP (.sap) 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.