Skip to content

PostScript file (.ps)

.ps file signature | application/postscript

PostScript document

Safe

Magic Bytes

Offset 0
25 21

Sources: Apache Tika

All Known Signatures

6 signature variants are documented for .ps files across multiple sources.

Hex Signature Offset Sources
25 21 0 Apache Tika
04 25 21 0 Apache Tika
C5 D0 D3 C6 0 Apache Tika
25 21 50 53 2D 41 64 6F 62 65 2D 33 2E 30 20 45 50 53 46 2D 33 2E 30 0 Apache Tika
25 21 50 53 0 Wikipedia
25 21 50 53 2D 41 64 6F 62 65 2D 0 Gary Kessler

Extension

.ps

MIME Type

application/postscript

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .ps files in Python

Python
def is_ps(file_path: str) -> bool:
    """Check if file is a valid PS by magic bytes."""
    signature = bytes([0x25, 0x21])
    with open(file_path, "rb") as f:
        return f.read(2) == signature

How to validate .ps files in Node.js

Node.js
function isPS(buffer: Buffer): boolean {
  const signature = Buffer.from([0x25, 0x21]);
  return buffer.subarray(0, 2).equals(signature);
}

How to validate .ps files in Go

Go
func IsPS(data []byte) bool {
    signature := []byte{0x25, 0x21}
    if len(data) < 2 {
        return false
    }
    return bytes.Equal(data[:2], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .ps file?

A .ps file is a PostScript file file. PostScript document

What are the magic bytes for .ps files?

The magic bytes for PostScript file files are 25 21 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .ps file?

To validate a .ps file, read the first bytes of the file and compare them against the known magic bytes (25 21) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .ps files?

The primary MIME type for .ps files is application/postscript.

Is it safe to open .ps files?

PostScript file (.ps) 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.