Skip to content
ToolsOnDuty - free online tools
File ToolsNovember 6, 2026

How to Inspect File Signatures Without Trusting Extensions

Inspect the first 4 KiB of a local file, reproduce a PNG-to-PDF filename mismatch and understand why header markers do not establish file safety.

By ToolsOnDuty Editorial Team

File Signature Inspector warning that a file named with a PDF extension has a PNG header marker.

A filename extension is a label, not proof of the bytes inside a file. A download can be mislabeled, an attachment can have the wrong suffix, and several different package formats can share the same container signature. Header inspection helps gather evidence about those situations without automatically opening the file as a document.

This guide uses the ToolsOnDuty File Signature Inspector with an original PNG image we created and a renamed copy. The screenshots show the actual compatible and mismatch results. The tool checks limited header markers locally; it is not antivirus software, a full format validator or permission to open an untrusted file.

Know what the inspector reads and what it leaves alone

Open File Signature Inspector and select a local file. The workspace reads only the first 4 KiB, or 4,096 bytes, rather than loading the entire file. It displays up to the first 256 bytes as hexadecimal and printable ASCII. It does not execute, decompress or render the selected file as a document.

This narrow scope is useful for identifying common starting markers, but it means most of a large file is never examined. A correct-looking header can be followed by damaged, unexpected or malicious content. Treat the result as one observation in a larger troubleshooting process, not as a verdict that the file is valid or safe.

Start with an image you created yourself

For a reproducible harmless example, save a small original PNG image as owned-diagram.png. Our demonstration image is 320 x 180 pixels and its file contains 4,169 bytes. Select the file and wait for the inspection result rather than trying this experiment with an unknown attachment.

The inspector reports the .png extension, a PNG image marker at offset 0 and a compatible-extension message. The associated MIME is image/png. That compatibility wording is deliberately cautious: it confirms that the filename is associated with a detected marker, not that every PNG chunk is valid or that the image has been fully decoded.

Inspection of owned-diagram.png with a compatible PNG extension and PNG image marker at offset zero.
Actual inspection of the original PNG. The marker and filename extension are compatible.

Rename a copy to reproduce a mismatch

Keep the original unchanged. Make a copy and change its filename to wrong-extension.pdf, ensuring that your file manager is showing the actual extension. Renaming the copy changes its label but does not convert PNG image bytes into a PDF document. No document-opening step is needed for this experiment.

Select the renamed copy in the inspector. Our test still found a PNG image marker, but the comparison changed to Possible extension mismatch because .pdf is not an associated extension for that marker. The file size and initial bytes were unchanged. This is an example of why a label should not be treated as a verified content type.

wrong-extension.pdf has a PNG marker and an extension mismatch warning despite a browser-declared PDF MIME type.
Verified mismatch: the copied file is named .pdf, but its bytes still begin with a PNG marker.

Separate declared MIME, associated MIME and validated structure

The renamed sample's Browser-declared MIME field showed application/pdf, while the detected marker's Associated MIME was image/png. The browser-declared value is not independently verified and can depend on the filename or platform. The marker-associated value is also indicative; it does not prove the entire file conforms to the format.

These labels answer different questions. A filename says what someone called the file, a declared MIME says how a platform described it, and a header marker says which recognizable starting bytes were present. A format-aware parser would still need to examine the actual structure. None of these observations alone establishes authenticity, ownership or malware absence.

Read hex offsets without assuming the whole file is shown

The first PNG marker bytes are 89 50 4e 47 0d 0a 1a 0a in hexadecimal. In the ASCII column, printable bytes spell PNG while nonprintable bytes appear as dots. The left column is a byte offset within the displayed header, with rows arranged in groups of up to sixteen bytes.

Only 256 bytes appear in this preview, although the inspector read 4,096 bytes of our 4,169-byte sample. The remaining 73 file bytes were outside the inspection window. Do not infer that an omitted area is empty or safe. Header bytes can also contain private readable text in other formats, so consider the preview sensitive when appropriate.

text
89 50 4e 47 0d 0a 1a 0a
PNG signature at byte offset 0

Understand container families and unknown results

Some results identify a family rather than an exact subtype. ZIP, Office Open XML documents, EPUB and other packages can share ZIP-family starting markers. A compatible .docx extension therefore does not prove that the archive contains a valid Word document; this inspector does not inspect the internal package structure.

An unknown result is also meaningful only within the tool's supported markers and reading window. Plain text, CSV, JSON, XML, unsupported formats and truncated files may not have a recognized marker. Unknown does not automatically mean corrupt or unsafe, just as a recognized marker does not automatically mean valid. Multiple detected markers require further interpretation rather than trusting the first one.

Download the report only when you need to retain it

Download inspection report saves file-inspection.json. We verified that the renamed sample's report contained extensionStatus mismatch, the PNG match and inspectedBytes 4096. It also includes the filename, size, declared MIME and displayed header text, plus a notice explaining that the report is not a validity or malware assessment.

Review the JSON before sharing it with a colleague or support service. Filenames and header text can reveal private information even though the complete original file is not uploaded by this operation. If a small anonymized screenshot is sufficient, avoid distributing additional raw header data unnecessarily, and retain reports only for a clear purpose.

Choose the right next action instead of blindly renaming files

For the harmless owned image, restoring .png corrects a misleading label; it does not repair or transform the data. If your goal is to create a PDF, use an appropriate conversion workflow and verify its output. Renaming a suffix alone cannot perform that conversion.

For an unexpected real-world attachment, confirm its source and use the appropriate platform security checks and format-aware tooling. Do not open it merely because the header seems familiar. An empty file has no header bytes and produces an error rather than a format result. Preserve an important original before troubleshooting and avoid guessing a new type from insufficient evidence.

Apply the steps from this guide directly in your browser.

Frequently asked questions

Does a matching signature prove a file is safe?

No. Markers can be forged and most of the file is not examined. This tool does not scan for malware or validate the complete structure.

Does changing .png to .pdf convert an image to PDF?

No. It changes the filename only. Our renamed sample retained its PNG bytes and produced an extension-mismatch warning.

Why does a DOCX file show a ZIP-family result?

DOCX and several other packages use ZIP containers. A family marker does not prove the required internal document structure is present.

What does an unknown result mean?

No supported marker was found in the inspected bytes. It does not, by itself, establish corruption, danger or a particular alternative file type.