Unknown File Extension: How to Identify a File Safely (and Why Renaming Isn't Converting)
iLoveConverter Team 5 min read
On this page
scan_2026.dat. A download with no extension at all. invoice.pdf.exe, with Windows hiding the tail. An archive split into .zip.001 parts. Files like these ask one question — what are you, actually? — and the answer decides whether you open them, rename them, convert them, or delete them.
The extension is a label, not the file
The extension is everything after the last dot in the name. The operating system uses it to decide which app to launch; it is metadata, not content. Rename report.pdf to report.bin and not one byte inside changes — the file is still a PDF, just one your OS no longer knows what to do with. Conversely, renaming something else to .pdf does not make it a PDF.
The real identity lives in the file’s own bytes. Most formats announce themselves with a magic number: a fixed byte pattern at offset 0 (or at a known position) that decoders check before anything else.
The real identity: magic numbers
| Bytes (hex) | As text | Format |
|---|---|---|
FF D8 FF | — | JPEG image |
89 50 4E 47 | .PNG | PNG image |
47 49 46 38 | GIF8 | GIF image |
25 50 44 46 | %PDF | PDF document |
50 4B 03 04 | PK.. | ZIP container — see next section |
52 61 72 21 | Rar! | RAR archive |
49 44 33 | ID3 | MP3 (or FF FB frame sync) |
66 74 79 70 at offset 4 | ftyp | MP4 / MOV family |
4D 5A | MZ | Windows executable |
7F 45 4C 46 | — | Linux executable (ELF) |
Text-based formats are the exception: they simply start with text. An SVG starts with <?xml or <svg — open it in a plain text editor and you can read it; if you want the full picture, see what is SVG.
The ZIP family trap
One signature deserves special attention: 50 4B 03 04 — the letters PK (for Phil Katz, creator of the ZIP format). Everything built on ZIP starts with it:
.zip— archives.docx,.xlsx,.pptx— Office 2007+ documents (OOXML), internally ZIPs holdingword/document.xml, sheet XMLs, slide XMLs, plus a[Content_Types].xml.jar— Java archives: a ZIP with aMETA-INF/MANIFEST.MFand compiled.classfiles.apk— Android packages: a ZIP holdingAndroidManifest.xmlandclasses.dex.odt,.ods,.epub,.cbz— OpenDocument, e-books, comics
This is why an extension check alone cannot tell these formats apart, and why the folk remedy “just rename it to .zip” works in exactly one direction: rename a .docx to .zip and any unzipper opens it; rename an arbitrary ZIP to .docx and Word refuses — the internal structure is wrong. The signature identifies the container family, not the specific format.
Why renaming is not converting
Conversion and renaming are different operations that people keep conflating:
- Converting = decode the content, re-encode it in the target format. New bytes, new structure.
- Renaming = changing the label. Zero content change.
Consequences you can predict from those two lines:
- A
.datrenamed to.pdfis still not a PDF. Serious upload validators check the signature and reject it; PDF readers show an error or garbage. - Renaming can hide a dangerous type:
invoice.pdf.exeis an executable that relies on Windows hiding known extensions by default. The.pdfin the middle is decoration. - When renaming is the right move: you identified the true format from the signature and the file was mislabeled. Correcting the extension to match the actual format is fixing metadata — do it on a copy, keep the original.
- When you need a real format change, convert: for the two formats people most often need to work with, start from the PDF format overview and the ZIP format overview.
Safe identification steps
- Do not double-click. Especially anything executable or script-like:
.exe,.msi,.scr,.bat,.cmd,.js,.lnk,.hta. Opening is the moment of risk; identification happens before it. - Check the provenance. Who sent it, from where, why — an unknown file from a known person is still an unknown file.
- See the full name. Enable extension display in Explorer (View → Show → File name extensions) or Finder settings, so
.pdf.exestops pretending. - Read the first bytes.
- macOS / Linux: run
file scan_2026.dat— thefilecommand does signature detection for you and prints the answer. - Windows PowerShell:
Format-Hex -Path .\scan_2026.dat— read the first line of hex output and compare with the table above.
- macOS / Linux: run
- Match against the signature table.
FF D8 FF→ JPEG;%PDF→ PDF;PK→ ZIP family;MZ→ Windows executable — stop and treat as untrusted. - If it is ZIP-family, look inside. Copy the file, rename the copy to
.zip, and list the contents:word/document.xml→ it is a.docx;META-INF/MANIFEST.MF→ a.jar;AndroidManifest.xml→ an.apk. Inspecting a listing is safe; launching an extracted executable is not. - Rename a copy to the identified extension and open it with the matching app. Keep the original untouched until the copy behaves.
- Executables and scripts from untrusted sources: scan with antivirus, or delete. Identification answers what a file is; only trust answers whether to run it — and you rarely have that.
FAQ
Can I convert a file by renaming the extension?
No. Renaming changes which app the OS picks; it changes no byte of content. A renamed file fails as soon as anything reads it properly. Convert instead.
Why do .docx, .xlsx, .jar and .apk all start with PK?
Because they are all ZIP archives internally — Office’s OOXML, Java archives and Android packages are ZIP containers with different internal structure. PK stands for Phil Katz, who created ZIP.
Is a file without an extension dangerous?
Not by itself — the danger is content, not naming. Identify it by its magic number before opening; plenty of harmless downloads lose their extension on the way.
How do I see a file’s first bytes on Windows?
PowerShell: Format-Hex -Path .\file and read the first line. macOS and Linux have it easier: file ./file prints the detected type directly.
A site told me “wrong format” but the extension looks right — now what?
The extension and the actual content disagree — the file is mislabeled. Identify it by signature (step 4 above), then convert it into the format the site actually expects rather than renaming it.
What about files ending in .001, .part or .crdownload?
Split archives and incomplete downloads. Finish the download or reassemble the split parts first — identifying a half-file tells you nothing useful.
Try it yourself — free, right in your browser
Everything mentioned in this guide runs locally on this site: no upload, no watermark, no sign-up.
Format deep-dives: PDF (.pdf) , ZIP (.zip) , SVG (.svg)