Skip to content
Aback Tools Logo

PDF Header Validator

Drop any file to instantly check whether it starts with the correct %PDF- magic bytes required by the PDF specification. The validator reads only the first few bytes of your file - no upload to any server - and shows the detected PDF version, byte offset, file type identification, and a hex dump of the opening bytes.

PDF Header Validator
Drop any file to validate its PDF header structure - the %PDF- magic byte signature, version number (PDF 1.0-2.0), binary comment, %%EOF marker, and startxref keyword. Displays the raw hex and ASCII bytes for the first 16 bytes of the file with a full pass/fail report for every required and recommended PDF specification check. Zero server uploads - all validation runs locally in your browser.

Drop any file here, or click to browse

PDF, image, archive, text - any file type accepted

Why Use Our PDF Header Validator?

6-Point Structural Validation

The PDF header validator checks every required and recommended PDF header element: the %PDF- magic bytes, version number (1.0-2.0), binary comment line, %%EOF marker, startxref keyword, and file extension - with a clear pass/fail result and severity label for each.

Raw Hex and ASCII Byte Display

The pdf header validator shows the first 16 bytes of your file as formatted hex pairs and ASCII characters, plus the binary comment hex sequence - so you see exactly what the PDF reader sees when it opens the file, with no ambiguity.

100% Private - No Upload Required

All header validation runs entirely in your browser. Your file is never uploaded to any server, never stored, and never transmitted over a network. The pdf header validator reads only the first 1 KB and last 512 bytes - nothing is sent externally.

Instant Results on Any File

The pdf header validator accepts any file - .pdf, .PDF, renamed files, files with no extension - and returns results instantly. No waiting, no file size limits, no signup required. 100% free for unlimited validations.

Common Use Cases for PDF Header Validator

Diagnosing "Invalid PDF" Errors

When a PDF reader reports "not a valid PDF file" or refuses to open a document, use the pdf header validator first - it instantly confirms whether the %PDF- signature and required structural markers are present, narrowing down the cause of the failure.

File Upload Validation Pipelines

Use the pdf header validator as a quick pre-check before passing a PDF through more expensive processing - OCR, compression, or conversion. Catching invalid headers early prevents downstream failures and saves processing resources.

Detecting Renamed or Disguised Files

Files renamed to .pdf that are actually JPEG images, ZIP archives, or other formats will fail the %PDF- header check immediately. The pdf header validator catches this mismatch before the file reaches any processing pipeline.

PDF Library Development & Testing

When building or testing PDF generation code, use the pdf header validator to confirm that your output files have a correct header, valid version byte, binary comment, and properly terminated %%EOF marker - catching output defects before deployment.

Checking Recovered or Repaired PDFs

PDFs recovered from corruption, partial downloads, or disk recovery tools may have a damaged header. The pdf header validator confirms whether the %PDF- signature, startxref, and %%EOF survived the recovery before you spend time processing the file.

PDF Specification Compliance Learning

The pdf header validator makes the PDF specification header requirements tangible - showing exactly which bytes are required, their hex values, and whether your file conforms. Useful for developers learning the PDF format or preparing for PDF/A compliance work.

Understanding the PDF Header Structure

What is the PDF Header?

Every valid PDF file must start with a specific sequence of bytes called the PDF header. The first line is the %PDF- signature (hex: 25 50 44 46 2D) immediately followed by the version number - for example %PDF-1.7 or %PDF-2.0. This signature tells PDF readers, operating systems, and content-type detectors that the file is a PDF document. The PDF specification (ISO 32000) requires this signature to appear at byte offset 0 - there must be no bytes before it. The header is also the basis for MIME type detection: a file whose first bytes match %PDF- has MIME type application/pdf regardless of its file extension.

How Our PDF Header Validator Works

  1. Upload Your File: Drop any file - .pdf, renamed files, or any other extension - into the drop zone. The pdf header validator reads only the first 1 KB and last 512 bytes of your file locally in your browser. No data is uploaded to any server.
  2. Structural Analysis: The tool checks six header elements in order: (1) the %PDF- magic byte signature at offset 0, (2) the PDF version number (1.0-2.0), (3) the optional binary comment on the second line, (4) the %%EOF marker near the end of file, (5) the startxref keyword and byte offset, and (6) the file extension. Each check is labelled Required, Recommended, or Info and returns pass/fail with the actual byte values found.
  3. Results: A verdict banner (Valid / Warning / Invalid) summarises the outcome. The full raw hex and ASCII bytes for the first 16 bytes of the file are displayed alongside the individual check results so you can see exactly what is in the file at the byte level.

What Gets Validated

  • %PDF- signature (Required): Bytes 0-4 must be 25 50 44 46 2D. Absence means the file is not a PDF.
  • PDF version number (Required): Bytes 5-7 encode the version (e.g. 31 2E 37= "1.7"). Valid versions: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.0.
  • Binary comment - second header line (Recommended): A line starting with %containing bytes > 127, signals binary content to FTP clients and some proxies. Required by PDF/A.
  • %%EOF marker and startxref (Required): The %%EOF end-of-file marker and preceding startxref keyword are required for valid PDF structure. Missing values indicate truncation or corruption.

Privacy, Limitations & Availability

The pdf header validator reads only the first 1,024 bytes and last 512 bytes of your file - it does not load the entire document into memory. All processing runs client-side in your browser using JavaScript; your file is never transmitted to any server. The tool validates the PDF header structure only - it does not check the completeness of the cross-reference table, the validity of individual PDF objects, or document-level conformance (PDF/A, PDF/UA, PDF/X). For full structural validation use the PDF Inspector or PDF Preflight Checker. The tool is 100% free with no file size limits and no signup required.

Frequently Asked Questions About PDF Header Validator

The PDF header is the first line of every PDF file. It must start with the 5-byte sequence %PDF- (hex: 25 50 44 46 2D) followed by the PDF version number (e.g. 1.7 or 2.0). A file that does not start with these bytes is not a valid PDF, regardless of its file extension.

%PDF- is the magic byte signature that identifies a file as a PDF document. The % character marks a comment in PDF syntax, and PDF follows immediately. The version number follows - for example a PDF 1.7 file starts with %PDF-1.7. The PDF specification requires this signature at byte offset 0.

The second line of a well-formed PDF is a comment (starting with %) that contains at least four bytes with values ≥ 128. This binary comment signals to FTP clients that the file contains binary data and should be transferred in binary mode. Its absence is flagged as a recommendation - not a hard error - by the pdf header validator.

%%EOF is the end-of-file marker required by the PDF specification. It must appear near the end of the file after the cross-reference table and trailer. Its absence indicates the PDF is truncated or corrupted. Some PDFs have multiple %%EOF markers due to incremental saves.

startxref is a keyword in the PDF trailer section that specifies the byte offset of the cross-reference table from the beginning of the file. The PDF reader uses this offset to locate the xref table, which maps object numbers to their byte positions. Missing or incorrect startxref values cause PDF readers to fail to open the file.

Yes, completely. The PDF header validator reads only a small number of bytes from the beginning and end of your file entirely in your browser. Your file is never uploaded to any server, never stored, and never transmitted over a network.

Yes, 100% free. No signup, no premium tier, no file size limits, and no restrictions on how many files you validate. The pdf header validator runs entirely client-side with zero server costs.

The pdf header validator recognises all standard PDF versions: PDF 1.0 through PDF 1.7 and PDF 2.0. Files with a version string outside this range are flagged as non-standard. PDF 2.0 (ISO 32000-2) is the current specification published in 2017.