A tar archive (“tape archive”) is the standard way to bundle many files on Unix systems, often gzip-compressed as .tar.gz or .tgz. Unlike a ZIP file, a tar archive has no central index at the end — it is simply a flat stream of file headers followed by data blocks. This inspector reads those headers in your browser so you can see everything inside, including Unix-specific metadata like file mode and owner, and extract individual files without unpacking the whole archive.
How it works
Tar stores each entry as a 512-byte USTAR header block immediately followed by the file’s data, padded up to the next 512-byte boundary. The tool reads the stream block by block, interpreting fixed-offset fields within each header:
| Header offset | Field | Format |
|---|---|---|
| 0–99 | File name | NUL-terminated ASCII |
| 100–107 | File mode | Octal string |
| 108–115 | Owner UID | Octal string |
| 116–123 | Owner GID | Octal string |
| 124–135 | File size | Octal string |
| 136–147 | Modification time | Octal Unix timestamp |
| 156 | Type flag | Single ASCII character |
| 265–499 | USTAR name prefix | NUL-terminated ASCII |
The USTAR prefix field (bytes 265–499) is concatenated with the name field to reconstruct paths longer than 100 characters. Sizes and timestamps are stored as octal text — a detail that trips up naive byte parsers and causes silent misreads when not handled.
If the file begins with the gzip magic bytes 0x1f 0x8b, the tool first decompresses it using the browser’s native DecompressionStream('gzip') and then parses the resulting tar stream. To extract an individual file, it slices the data bytes that immediately follow that entry’s header without re-reading any other part of the archive.
Type flags and what they mean
The type flag byte distinguishes entry types. Common values:
| Flag | Meaning |
|---|---|
0 or \0 | Regular file |
1 | Hard link |
2 | Symbolic link |
5 | Directory |
3 / 4 | Character / block device |
6 | Named pipe (FIFO) |
L | GNU long name extension |
x / g | PAX extended headers |
Only regular files can be extracted to download. Directories, symlinks, and device entries are listed for inspection but contain no extractable data bytes.
Notes and practical tips
- Two consecutive all-zero 512-byte blocks mark the end of the archive; the tool stops there and ignores padding beyond that point.
- GNU long-name (
L) and PAX extended headers are recognised, so paths longer than 100 characters display correctly. - The file mode shows Unix permission bits in octal (for example
0755= rwxr-xr-x). These matter if you restore the archive on a Unix system — the tool shows them so you can verify that scripts and executables have the right permissions before extraction. - Extraction is entirely local; downloaded file bytes never touch a server.