i

File MIME Type Inspector

Inspect file extensions, MIME types, sizes, and signatures

File MIME Type Inspector — what it does

Select files and see what they really are: the extension they claim, the MIME type the browser assigns, the size, and the magic-number signature read from the first bytes of the content itself. When the signature and the extension disagree, you have found a mislabelled — or disguised — file.

Worked example

Four files from a shared drive, one of which (banner.jpg) is really a PNG that was renamed.

FileMIME (from the name)Size (bytes)Detected signature
Q3-report.pdfapplication/pdf1164PDF
logo.pngimage/png125430PNG
contacts.csvtext/csv3296E 61 6D 65 2C 65 6D 61 69 6C 2C 64
banner.jpgimage/jpeg109681PNG

The page also shows an Extension column (pdf, png, csv, jpg). contacts.csv has no known signature, so its first 12 bytes are printed in hex — they spell name,email,d — while banner.jpg's signature exposes the mislabelled PNG.

When this tool helps

  • Identifying a file that arrived with no extension or a generic .dat name.
  • Checking that an upload rejected as "wrong type" actually is what its name claims.
  • Screening a batch of files for extension-content mismatches before processing them.

How to use it

  1. Choose the files to inspect.
  2. Run the inspection.
  3. Compare each file's extension, MIME type and content signature.
  4. Investigate any file where they disagree.

Accuracy, limits, and good practice

  • Magic numbers are the honest witness: a PNG starts with its signature bytes no matter what the filename says.
  • Office formats like DOCX and XLSX show a ZIP signature — correct, since they are ZIP containers by specification.
  • Plain text formats such as CSV and JSON have no signature; identifying those relies on extension and content inspection.

Frequently asked questions

Can a file fake its signature?

Bytes can be crafted, so a signature is strong evidence rather than proof. For security decisions, use dedicated scanning.

Why does renaming a file not convert it?

The extension is a label; the bytes are the format. Conversion requires re-encoding the content, not renaming it.

Are my files read locally?

Yes, only the leading bytes are read, in the browser, to match signatures — nothing is uploaded.

Which signatures does it recognise?

Five: PDF (%PDF), PNG, JPEG (FF D8 FF), GIF (GIF8) and the ZIP header 50 4B 03 04, labelled ZIP / Office because DOCX, XLSX and PPTX share it. Anything else shows its first 12 bytes in hex, and an empty file shows Unknown. Only the first 16 bytes of each file are read.

Where does the MIME column come from, and why is it sometimes unknown?

From the browser's extension-to-type table, not from the content: rename a PNG to .jpg and it says image/jpeg. Extensions the browser does not know (.md, .log, .parquet, or none at all) show unknown, and the Extension column shows a dash for a name without a dot. The table lists at most 200 files.

Related tools on this site

Everything above runs inside this page. File MIME Type Inspector needs no account, no upload, and no server round trip — close the tab and nothing is left behind.

檔案 MIME 類型檢視器能做什麼

選取檔案,看清它們的真面目:檔名聲稱的副檔名、瀏覽器判定的 MIME 類型、大小,以及從內容開頭位元組讀出的魔術數字簽章。當簽章與副檔名對不上,你就抓到了一個貼錯標籤——或刻意偽裝——的檔案。

實際範例

共享磁碟上的四個檔案,其中 banner.jpg 其實是改了名的 PNG。

檔案MIME(依檔名)大小(位元組)偵測到的簽章
Q3-report.pdfapplication/pdf1164PDF
logo.pngimage/png125430PNG
contacts.csvtext/csv3296E 61 6D 65 2C 65 6D 61 69 6C 2C 64
banner.jpgimage/jpeg109681PNG

頁面上還有一欄副檔名(pdf、png、csv、jpg)。contacts.csv 沒有已知簽章,所以印前 12 個位元組的十六進位,正好是 name,email,d;banner.jpg 的簽章則揭穿了它是改名的 PNG。

什麼時候用得上

  • 辨識沒有副檔名、或只有 .dat 這種通用名稱的檔案。
  • 檢查被系統以「類型錯誤」拒收的上傳檔,是否真如其名。
  • 批次處理前,篩查一批檔案有無副檔名與內容不符的情況。

使用步驟

  1. 選擇要檢查的檔案。
  2. 執行檢測。
  3. 比對各檔案的副檔名、MIME 類型與內容簽章。
  4. 調查任何三者不一致的檔案。

精確度、限制與實務建議

  • 魔術數字是誠實的證人:PNG 的開頭永遠是它的簽章位元組,檔名怎麼寫都一樣。
  • DOCX、XLSX 等 Office 格式會顯示 ZIP 簽章——這是對的,規格上它們本來就是 ZIP 容器。
  • CSV、JSON 等純文字格式沒有簽章,辨識它們得靠副檔名與內容檢視。

常見問題

簽章可以造假嗎?

位元組可以被刻意構造,簽章是強力證據而非鐵證。涉及安全決策請用專門的掃描工具。

為什麼改副檔名不等於轉檔?

副檔名只是標籤,位元組才是格式。轉檔需要重新編碼內容,不是改名。

檔案是在本機讀取的嗎?

是,只讀取開頭位元組在瀏覽器中比對簽章——不會上傳任何內容。

能辨識哪些簽章?

五種:PDF(%PDF)、PNG、JPEG(FF D8 FF)、GIF(GIF8),以及 ZIP 檔頭 50 4B 03 04,標示為 ZIP / Office,因為 DOCX、XLSX、PPTX 的檔頭都一樣。其他檔案會印前 12 個位元組的十六進位,空檔案則顯示 Unknown。每個檔案只讀前 16 個位元組。

MIME 欄位從哪裡來?為什麼有時是 unknown?

來自瀏覽器的副檔名對照表,而不是檔案內容:把 PNG 改名成 .jpg 就會顯示 image/jpeg。瀏覽器不認得的副檔名(.md、.log、.parquet 或根本沒有副檔名)會顯示 unknown,沒有句點的檔名在副檔名欄會顯示一個破折號。表格最多列 200 個檔案。

本站相關工具

以上步驟全部在這個頁面內完成,檔案 MIME 類型檢視器 不需要註冊、不上傳檔案、也不經過伺服器,關閉分頁後不會留下任何資料。