0A

PCX file signature

Magic number at the start of the file

0A

A PCX image starts with the single ZSoft marker byte 0x0A, immediately followed by a version byte (0, 2, 3, 4 or 5) and the encoding field.

Hex signature
0A
Offset
0 (start of file)
Length
1 byte

What this magic number means

A magic number is a short, fixed run of bytes at a known position that tells a program what a file really is, no matter what the filename says. If a file starts with the bytes 0A, the file might be a PCX, and that is as far as one byte can take you. 0x0A on its own is a line feed, so any text file whose first line is empty starts with exactly this byte. A PCX is only confirmed by the three bytes that follow it.

One byte is a weak signature by any standard: 1 file in 256 of random binary data starts with it, and every text file that opens with a blank line does too. PCX predates the convention of a long, deliberately improbable magic number, and its own specification admits the identifier has no meaning beyond marking the file as ZSoft's.

Readers therefore validate the first four bytes of the 128-byte header together, not just the first one. Byte 0 must be 0A. Byte 1, the version, must be 0, 2, 3, 4 or 5. Byte 2, the encoding, is 1 in every PCX in practice, run-length encoding being the only scheme the format supports. Byte 3, the bit depth, must be 1, 2, 4 or 8. A file that passes all four is almost certainly a PCX; a file that only passes the first is almost certainly not.

There is a second cross-check further in: bytes 65 to 127 of the header are reserved and specified as zero, so a genuine PCX has a run of nulls where a text file would have ordinary characters.

What each byte of 0A means

Here is the signature byte by byte, the way a hex editor shows it: the position in the file, the value in hex and in decimal, and the character that value stands for in ASCII. Bytes with no printable character show a dot.

Byte offsetHexDecimalASCII
00A10.

Formats that use the 0A signature

These file types in our database carry this signature:

How to check a file's signature

You can read the bytes of any file yourself. They are shown in hex, the same way this page lists them.

Linux & macOS

  • xxd -l 16 example.pcx
  • hexdump -C -n 16 example.pcx
  • file example.pcx

Windows (PowerShell)

  • Format-Hex -Path example.pcx -Count 16

Python

  • open("example.pcx","rb").read(1).hex()

In your browser

Frequently asked questions

What is the PCX file signature?

The first byte of a PCX file is 0x0A, the ZSoft identifier. It is followed by a version byte (0, 2, 3, 4 or 5), an encoding byte (1 for run-length encoding) and a bit-depth byte (1, 2, 4 or 8), all inside a fixed 128-byte header.

Does a file starting with 0A mean it is a PCX?

No. 0x0A is the line feed character, so any text file that begins with a blank line starts with the same byte. On its own it proves nothing. Check bytes 1 to 3 as well: version 0, 2, 3, 4 or 5, encoding 1, bit depth 1, 2, 4 or 8.

How do I check a PCX file's header?

Read the first four bytes: xxd -l 4 example.pcx on Linux or macOS, or Format-Hex -Path example.pcx -Count 4 in Windows PowerShell. A typical 256-colour PCX shows 0A 05 01 08, meaning ZSoft, version 5, RLE encoding, 8 bits per pixel.

Why is the PCX signature so short?

PCX dates from 1985 and PC Paintbrush, before long improbable magic numbers became normal practice. The specification itself notes the identifier byte has no meaning other than indicating a ZSoft PCX file, and it was never widened as later versions of the format appeared.

Related signatures

Sources

Reuse this signature

This entry is part of the WhatFileType file signature reference, published under a CC BY 4.0 licence with the full provenance for every entry, a copy-paste embed and a JSON export. Credit WhatFileType and the data is yours to republish.