# File Type Identifier

> ファイルの本当の形式をマジックナンバーから判別：拡張子ではなく真の形式、MIMEタイプ、コンテナ対応の検出（docx/apk/jarはZIP）。アップロード不要。

- URL: https://bytescope.dev/ja/file-type/
- Locale: ja · Also: [en](https://bytescope.dev/en/file-type.md) · [zh-Hant](https://bytescope.dev/zh-Hant/file-type.md)
- Runs: ファイルはブラウザから送信されません — 処理はすべてローカルで行われます。
- Requires: Any modern browser (Chrome, Edge, Firefox, Safari), desktop and mobile.
- Updated: 2026-09-08

## What it does

あらゆるファイル — 特に拡張子が欠けている、間違っている、または不明なもの — をドロップすると、このツールは先頭のバイト（必要に応じて末尾も）を読み取り、マジックナンバーの署名から本当の形式を判別します。検出された形式、そのMIMEタイプ、正しい拡張子、そしてその形式が実際に何であるかの1行説明が得られます。すべてブラウザ内で動作します。ファイルはアップロードされないので、信頼できないファイルにも安全です。

拡張子は嘘をつきます。それこそがこのツールの狙いです：実はPNGである`.jpg`、名前を変えたドキュメントの中に隠れた`.exe`、あるいは拡張子がまったくない謎のダウンロード。検出された形式が拡張子と一致しない場合、その不一致が推奨される正しい名前とともに目立つようにフラグ表示されます。コンテナ形式はもう一段調べます — docx、xlsx、pptx、apk、jar、epubはすべて中身がZIPファイルなので、ツールはコンテナのディレクトリを開いてそれらを区別し、RIFFファミリー（WAV、AVI、WebP）にも同じことを行います。

テキストファイルには独自の分析が付きます：エンコーディング（UTF-8/16、BOMの有無）、改行コード（LF対CRLF）、そして紛れ込んだNULバイトがバイナリの混入を示唆していないか。バッチモードは多数のファイルを一度に判別し、判別できないものは先頭64バイトをhexで表示し、ワンクリックでHexエディタに移って手動で検査できます。

## Limits

Does not open, convert or repair the file; it identifies the real format from the magic bytes.

## Machine output

Copy JSON copies an envelope `{ tool, url, generatedAt, userAgentHint, result }`. `tool` is `"file-type"`; `result` is the magic-byte identification below. The file name and any leftover file bytes (hex dump) are omitted.

- `identified` (boolean) — `false` = no detector matched (unidentified). `true` = a detector matched a known format. There is no "unknown format" id.
- `formatId` (string | null) — Stable format id (e.g. `"png"`). `null` = unidentified.
- `formatName` (string | null) — Display name. `null` = unidentified.
- `mime` (string | null) — Detected MIME type. `null` = unidentified.
- `extensions` (string[]) — Canonical extensions without a leading dot, on-screen order. Empty when unidentified or the type has none.
- `description` (string | null) — One-line format description. `null` = unidentified.
- `confidence` (string | null) — `"certain"` | `"likely"` | `"weak"`. `null` = unidentified.
- `extensionStatus` (string) — `"match"` | `"mismatch"` | `"no-extension"` | `"unknown"`.
- `extensionActual` (string | null) — Lowercase extension from the name, no dot. `null` = the name had no extension.
- `suggestedExtension` (string | null) — Canonical extension to rename to. `null` unless status is `"mismatch"`.
- `isDangerousMismatch` (boolean) — Executable content with a mismatched extension.
- `textEncoding` (string | null) — `"utf-8"` | `"utf-8-bom"` | `"utf-16le-bom"` | `"utf-16be-bom"` | `"ascii"` | `"unknown-binary"`. `null` = not classified as text, so encoding was not analysed. `"unknown-binary"` = analysed, charset unnamed.
- `lineEndings` (string | null) — `"lf"` | `"crlf"` | `"cr"` | `"mixed"` | `"none"`. `null` = not analysed.
- `hasNulBytes` (boolean | null) — `null` = not analysed; `false` = analysed, no NUL; `true` = NULs present.
- `byteLength` (number | null) — File size in bytes. `null` = size was not supplied.

## FAQ

### 判別のためにファイルはアップロードされますか？

いいえ。署名データベースと照合するために、先頭の数キロバイト（一部のコンテナ形式では末尾も）だけがブラウザ内でローカルに読み取られます。ファイルがデバイスから出ることはありません — 疑わしいファイルを確認するときにまさに求めることです。

### マジックナンバーとは何ですか？

ほとんどのファイル形式は固定のバイト署名で始まります — PNGファイルは 89 50 4E 47、ZIPアーカイブは 50 4B で始まります。これらの「マジックナンバー」はファイル名に関係なく本当の形式を識別し、それによってこのツール（およびUnixの`file`コマンド）は誤ってラベル付けされたファイルを捉えられます。

### .docxがZIPファイルとして表示されるのはなぜですか？

実際にそうだからです — docx、xlsx、pptx、apk、jar、epubはすべて特定の中身を持つZIPコンテナです。ツールはZIPディレクトリの中を見て、それと分かるエントリ（Office向けの[Content_Types].xml、APK向けのAndroidManifest.xml）を探し、単なる「ZIP」ではなく具体的な形式を報告します。

### ファイルが危険かどうか教えてくれますか？

よくある偽装の手口 — ドキュメントに見せかけるために名前を変えた実行ファイル — は、本当の形式を明らかにすることで捉えられます。それは有用な初期チェックですが、マルウェアスキャンではありません：形式が正当なファイルでも悪意あるコンテンツを含みうるからです。

### ファイルが判別できない場合はどうなりますか？

不明なファイルは先頭64バイトをhexで表示するので、自分で構造を検査でき、Hexエディタへワンクリックで引き渡せます。署名は時間とともに追加されるので、判別できない形式は、こちらがデータベースを拡張するきっかけにもなります。
