Skip to content

SPSS Statistics (.sav)

.sav file signature | application/octet-stream

SPSS Statistics (née Statistical Package for the Social Sciences, thenStatistical Product and Service Solutions) data file

Safe

Magic Bytes

Offset 0
24 46 4C 32 40 28 23 29 20 53 50 53 53 20 44 41 54 41 20 46 49 4C 45

Sources: Gary Kessler

Extension

.sav

MIME Type

application/octet-stream

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .sav files in Python

Python
def is_sav(file_path: str) -> bool:
    """Check if file is a valid SAV by magic bytes."""
    signature = bytes([0x24, 0x46, 0x4C, 0x32, 0x40, 0x28, 0x23, 0x29, 0x20, 0x53, 0x50, 0x53, 0x53, 0x20, 0x44, 0x41, 0x54, 0x41, 0x20, 0x46, 0x49, 0x4C, 0x45])
    with open(file_path, "rb") as f:
        return f.read(23) == signature

How to validate .sav files in Node.js

Node.js
function isSAV(buffer: Buffer): boolean {
  const signature = Buffer.from([0x24, 0x46, 0x4C, 0x32, 0x40, 0x28, 0x23, 0x29, 0x20, 0x53, 0x50, 0x53, 0x53, 0x20, 0x44, 0x41, 0x54, 0x41, 0x20, 0x46, 0x49, 0x4C, 0x45]);
  return buffer.subarray(0, 23).equals(signature);
}

How to validate .sav files in Go

Go
func IsSAV(data []byte) bool {
    signature := []byte{0x24, 0x46, 0x4C, 0x32, 0x40, 0x28, 0x23, 0x29, 0x20, 0x53, 0x50, 0x53, 0x53, 0x20, 0x44, 0x41, 0x54, 0x41, 0x20, 0x46, 0x49, 0x4C, 0x45}
    if len(data) < 23 {
        return false
    }
    return bytes.Equal(data[:23], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .sav file?

A .sav file is a SPSS Statistics file. SPSS Statistics (née Statistical Package for the Social Sciences, thenStatistical Product and Service Solutions) data file

What are the magic bytes for .sav files?

The magic bytes for SPSS Statistics files are 24 46 4C 32 40 28 23 29 20 53 50 53 53 20 44 41 54 41 20 46 49 4C 45 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .sav file?

To validate a .sav file, read the first bytes of the file and compare them against the known magic bytes (24 46 4C 32 40 28 23 29 20 53 50 53 53 20 44 41 54 41 20 46 49 4C 45) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .sav files?

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

Is it safe to open .sav files?

SPSS Statistics (.sav) 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.