fileformer
search⌘KtranslateENexpand_moreupload_fileConvert
Converters8 file families · 44 direct conversions
What changes in a conversionarrow_forward
home / archives / tar

Convert TAR Archive Free

A .tar is 512-byte blocks: a header, the file, padding, repeat

Tape archive has no index and no compression: each file gets a 512-byte header written in ASCII octal, then its bytes rounded up to the next block, and the archive ends with two zero blocks. Names longer than 100 bytes, sizes over 8 GiB and Unicode needed extensions, so there are four dialects (v7, ustar, GNU, pax) that still mix in one file. Open a tar, or one of the three written here, to walk every block.

folder_openOpen .tar (or .tar.gz / .tgz)GNU tar samplepax with UTF-8 + xattrsHostile, broken ustardownloadDownload
demo-tool.tar: GNU format: directory, files, symlink, hard link, a 100+ byte name via ././@LongLink, padded to a 10 KB record

Every 512-byte block

20 blocks · 10.2 KB · 7 entries
headerfile datalast block, paddedpax extended header + recordsGNU long namezero blocksbad checksum / partial
blockname (after extensions)typemodeownersizemtimeformat
0demo-tool/directorydrwxr-xr-xada:ada (1000:1000)2026-09-30 14:05GNU
1demo-tool/README.mdfile-rw-r--r--ada:ada (1000:1000)63 B2026-09-30 14:05GNU
3demo-tool/bin/runfile-rwxr-xr-xada:ada (1000:1000)58 B2026-09-30 14:05GNU
5demo-tool/src/main.jsfile-rw-r--r--ada:ada (1000:1000)60 B2026-09-30 14:05GNU
7demo-tool/latest → src/main.jssymlinklrwxrwxrwxada:ada (1000:1000)2026-09-30 14:05GNU
8demo-tool/README.copy ⇒ demo-tool/README.mdhard link-rw-r--r--ada:ada (1000:1000)2026-09-30 14:05GNU
9↳ GNU long name (104 B)L
11demo-tool/docs/architecture/decisions/2026-09-30-why-we-store-very-long-file-names-in-our-repository.mdfile-rw-r--r--ada:ada (1000:1000)36 B2026-09-30 14:05GNU
header of block 1 · demo-tool/README.md32 bytes per row · hover a byte
Dim cells are NUL bytes. GNU headers reuse the ustar prefix area for atime, ctime and sparse maps.
0name64 65 6D 6F 2D 74 6F 6F …“demo-tool/README.md”
100mode30 30 30 30 36 34 34 00octal 0000644 = 420 → -rw-r--r--
108uid30 30 30 31 37 35 30 00octal 0001750 = 1,000
116gid30 30 30 31 37 35 30 00octal 0001750 = 1,000
124size30 30 30 30 30 30 30 30 …octal 00000000077 = 63 bytes
136mtime31 35 32 35 37 32 31 33 …octal 15257213430 = 1,790,777,112 → 2026-09-30T14:05:12Z
148chksum30 31 32 32 37 36 00 20stored 5310 · unsigned sum 5310 ✓
156typeflag30“0” = file
157linkname00 00 00 00 00 00 00 00 …(empty)
257magic75 73 74 61 72 20“ustar ” → GNU
263version20 00“ \0”
265uname61 64 61 00 00 00 00 00 …“ada”
297gname61 64 61 00 00 00 00 00 …“ada”
329devmajor00 00 00 00 00 00 00 00(empty)
337devminor00 00 00 00 00 00 00 00(empty)
345atime (GNU)00 00 00 00 00 00 00 00 …(empty)
357ctime (GNU)00 00 00 00 00 00 00 00 …(empty)
369offset (GNU)00 00 00 00 00 00 00 00 …(empty)
381longnames00 00 00 00(empty)
386sparse map (GNU)00 00 00 00 00 00 00 00 …(empty)
482isextended00(empty)
483realsize00 00 00 00 00 00 00 00 …(empty)
check_circleFormat: GNU.GNU extensions: ././@LongLink for long names, base-256 numbers, atime/ctime.
check_circleAll header checksums match.Sum of the 512 header bytes with the checksum field read as spaces.
check_circleEnd of archive at block 13.Two zero blocks, as required.
infoOwner names stored: ada.tar records the creator’s user and group; --owner=0 --group=0 --numeric-owner removes them.
check_circleGNU ././@LongLink entries.A pseudo-file whose data is the real name; readers without GNU support extract a file literally called ././@LongLink.
number field lab

Why ustar stops at 8 GiB, 2097151 and the year 2242

Numbers are written as ASCII octal digits followed by a NUL or space, so a 12-byte size field holds at most 11 digits: 8¹¹ − 1 bytes. When a value doesn’t fit, GNU tar sets the top bit of the first byte and stores the number in binary (“base-256”), and pax writes it as decimal text in an extended header instead.

size (12 B)mtime (12 B)uid (8 B)mode (8 B)
8 GiB − 110 GB4 KB
ustar: 11 octal digits + NULdoes not fit (max 8,589,934,591)
????????????
Too large for 11 digits: a plain ustar writer must refuse.
GNU base-256: top bit set, then big-endian binaryfits up to 2^88 − 1
800000000000000280000000
Understood by GNU tar, bsdtar and star; ustar-only readers see garbage.
pax: a decimal record in an extended header20-byte record
20␠size=10737418240\n
Self-delimiting: the leading number is the record’s total length in bytes, including itself. No limit beyond the reader’s integer size.
reproducible archive lab · real tars written here

Same five files, two machines, one hash?

Machine A and machine B have identical file contents but list directories in different orders, check out files at different times, and belong to different users with different umasks. Switch on the options a reproducible build uses and watch the two SHA-256s converge.

check_box_outline_blank--sort=namestore entries in name order, not directory-listing ordercheck_box_outline_blank--mtime=@SOURCE_DATE_EPOCHclamp every timestamp to a fixed datecheck_box_outline_blank--owner=0 --group=0 --numeric-ownerdrop user and group names and idscheck_box_outline_blank--mode=go-w (umask-independent)normalise permission bitscheck_box_outline_blank--pax-option=delete=atime,delete=ctimeleave out access and change times (pax only)
ustarGNUpax
machine A · ada, umask 022download
sha256 5174928f95af1d534a6b3c639a65959ca069216b1a3a46576ce0bcb14c03879220.5 KB · directory order
machine B · bob, umask 002, checked out 2 days laterdownload
sha256 5c3294993d8a23cd7332d4fd986ddf1a2ca247efb44e10effda8b6617070c07720.5 KB · files listed in a different order
Different. first difference at byte 13 (block 0), pax record of PaxHeaders.0/README.md.
tar --format=posix -cf app.tar app/

Reference

flagtypenotes
0fileregular file; data follows
1hard linkno data; linkname names the earlier entry to link to
2symlinkno data; linkname is the target path
3char devicedevmajor/devminor
4block devicedevmajor/devminor
5directoryname ends with /
6FIFOnamed pipe
7contiguous filetreated as a regular file
\0file (v7)regular file in pre-POSIX archives
xpax extended headerrecords apply to the next entry
gpax global headerrecords apply to all following entries
LGNU long namedata is the next entry’s full name
KGNU long linkdata is the next entry’s full link target
SGNU sparse fileholes described by a sparse map
DGNU dump dirdirectory listing for incremental dumps
MGNU multivolumecontinuation from the previous volume
v7ustarGNUpax
name100 B155 + 100 Bunlimited (L)unlimited (path)
size8 GiB8 GiBbase-256unlimited
uid/gid2,097,1512,097,151base-256unlimited
mtimesecondssecondsseconds, + atime/ctimenanoseconds
user namesnouname/gnameyesyes, UTF-8
encodingbytesbytesbytesUTF-8
xattrs / ACLsnononoSCHILY / LIBARCHIVE records
standardUnix V7POSIX.1-1988GNU tar onlyPOSIX.1-2001
MIMEapplication/x-tar; compressed: application/gzip (.tar.gz/.tgz), application/x-xz, application/zstd
Magic bytes“ustar\0” “00” at offset 257 (POSIX) or “ustar \0” (GNU); v7 has none, only a valid checksum
Block / recordblocks of 512 bytes, written in records of 20 blocks (10,240 bytes) by default
End markertwo 512-byte zero blocks; readers given -i ignore them to read concatenated archives
No indexlisting or extracting one file means reading every header up to it; with gzip on top, decompressing everything
Used byDocker/OCI image layers, npm packages (.tgz), Python sdists, Debian data.tar, source releases
1979Unix V7 tarTape archiver with the 100-byte name header.
1988POSIX ustarIEEE 1003.1 adds magic, user/group names, prefix and device fields.
1990sGNU extensions././@LongLink, base-256 numbers, sparse files, incremental dumps.
2001paxPOSIX.1-2001 extended headers: anything as key=value text.
2004libarchivebsdtar reads every dialect; later the default tar on FreeBSD, macOS and Windows.
2013DockerContainer image layers ship as tar files, making reproducibility and safe extraction critical again.

Around tar