# Archive Inspector

> 在瀏覽器中檢視 ZIP、tar.gz、gzip、7z 與 RAR 壓縮檔而不必解壓縮：附大小與壓縮比的檔案樹、安全的單檔預覽、巢狀壓縮檔與路徑穿越警示。

- URL: https://bytescope.dev/zh-Hant/archive-inspector/
- Locale: zh-Hant · Also: [en](https://bytescope.dev/en/archive-inspector.md) · [ja](https://bytescope.dev/ja/archive-inspector.md)
- Runs: 檔案不會離開你的瀏覽器 — 全部在本機處理。
- Requires: Any modern browser (Chrome, Edge, Firefox, Safari), desktop and mobile.
- Updated: 2026-09-08

## What it does

拖入一個 ZIP（包含 docx、apk、jar 等以 ZIP 為基礎的格式）、tar、tar.gz、gzip、7z 或 RAR 檔，即可立即瀏覽其內容。檢視器絕不會把整個壓縮檔解開：對 ZIP，它只讀取 central directory — 也就是位於檔案尾端的目錄清單 — 這正是為什麼數 GB 的壓縮檔能在一秒內開啟，也是為什麼 zip bomb 在這裡無害。只有當你預覽某個單一檔案時，它才會只解壓縮那一個項目。7z 與 RAR 由編譯成 WebAssembly 的 libarchive 處理，並在你第一次開啟這類檔案時才按需載入，因此工具的其餘部分依然輕量。

樹狀檢視會顯示每個項目的原始與壓縮後大小、壓縮比、修改時間、CRC，以及在適用時的加密鎖頭圖示，另外還有一個統計面板：總檔案數、總大小、整體壓縮比，以及最大的前 10 個檔案。點一個文字檔可以閱讀、點一張圖片可以檢視、點其他任何東西則會以 hex 顯示它的前幾個位元組；單一項目可個別下載，巢狀壓縮檔（zip 裡的 zip）也能就地開啟。

它也對「這個 ZIP 安全嗎？」給出初步判讀：名稱含路徑穿越（../）的項目與可執行檔都會被標示出來。一切都在你的瀏覽器本機進行 — 壓縮檔絕不會被上傳，而這對於你還不信任的壓縮檔正是關鍵。

## Limits

Does not extract the whole archive or open password-protected entries; use extract-archive to unpack.

## Machine output

Copy JSON copies an envelope `{ tool, url, generatedAt, userAgentHint, result }`. `tool` is `"archive-inspector"`; `result` is the on-screen listing below. The dropped archive's own file name is omitted. Inner entry paths are included. Entry bytes, previews, and thumbnails are omitted.

- `kind` (string | null) — Container format: `"zip"` | `"tar"` | `"tar.gz"` | `"gzip"` | `"7z"` | `"rar"`. `null` = kind was not supplied.
- `zip64` (boolean) — ZIP64 records were used.
- `comment` (string | null) — Archive comment (or gzip inner name as shown). `null` = none on screen.
- `fileCount` (number) — File members (not directories).
- `dirCount` (number) — Directory members.
- `originalBytes` (number) — Sum of known uncompressed file sizes.
- `compressedBytes` (number | null) — Sum of per-entry compressed sizes, or the archive file size for 7z/RAR. `null` = not reported on screen (tar).
- `ratioSaved` (number | null) — Fraction saved (0..1). `null` = ratio was not shown.
- `encryptedEntryCount` (number) — Members with the encrypted flag. `0` = none encrypted (distinct from encrypted members whose contents were not read — contents are never copied).
- `pathTraversalCount` (number) — Members whose path escapes the archive root.
- `executableCount` (number) — Members flagged as executables on screen.
- `entries` (array of objects) — Listing in archive order, capped at 200. Each: `name` (inner path), `isDir`, `size` (or `null` if unknown), `encrypted`, `pathTraversal`, `executable`, `mtime` (ISO 8601 UTC or `null`), `crcHex` (8-digit lowercase hex or `null`).
- `truncated` (boolean) — `true` when more members exist than were copied, including when the parser itself capped the listing.
- `totalEntries` (number) — Real member count reported by the archive, not the copied length.

## FAQ

### 它怎麼能這麼快就開啟超大的壓縮檔？

因為它不解壓縮任何東西。ZIP 檔的結尾有一份列出每個項目的 central directory — 檢視器透過隨機存取只讀取那一部分（即使是巨大的壓縮檔也只有幾 KB）。檔案資料只有在你預覽某個特定項目時才會被解壓縮，而且只解那一個項目。

### 在這裡開啟一個可疑的 ZIP 安全嗎？

比解壓縮它更安全：不會有任何東西寫入磁碟、不會有程式碼執行，而且 zip bomb 不會引爆，因為壓縮檔從不會被完整解開。檢視器也會標示路徑穿越的項目（名稱含 ../、解壓縮時會覆寫目標資料夾外檔案的那種）與可執行檔，讓你在真正解壓縮之前就先知道。

### 它能開啟有密碼保護的壓縮檔嗎？

它會顯示加密 ZIP 的檔案清單（名稱與大小通常不會被加密），並在受保護的項目上顯示鎖頭圖示，但無法解密或預覽其內容 — 目前不支援以密碼解壓縮。7z 與 RAR 也一樣：內容被加密的壓縮檔仍可列出清單，但當你嘗試預覽某個項目時，它會明確回報該項目已加密，而不是無聲失敗；至於連標頭一併加密的 7z（連檔名都被隱藏），則根本無法列出，會以清楚的訊息婉拒。

### 為什麼它能開啟我的 .docx／.apk／.jar？

那些格式骨子裡就是 ZIP 壓縮檔 — 檢視它們會顯示其真正的內部結構（word/ 文件、AndroidManifest.xml、.class 檔），在你除錯這類檔案時往往正是你想看的。

### 支援哪些格式？

ZIP（包含 ZIP64 以及所有以 ZIP 為基礎的格式，如 docx/xlsx/apk/jar/epub）、tar、tar.gz/tgz 與獨立的 gzip 都以原生讀取器處理；7z 與 RAR（RAR4 與 RAR5 皆可）則由 WebAssembly 版的 libarchive 處理，並按需下載。對 7z/RAR，這個函式庫能列出項目並解壓縮單一檔案，但不會回報每個項目的壓縮後大小或修改時間（會顯示為「—」），也不支援多卷（multi-volume）的 RAR 檔組。這個 WebAssembly 解碼器（gzip 後約 0.5 MB）只有在你實際開啟 7z 或 RAR 檔時才會載入，因此絕不會拖累工具的其餘部分。
