How to Convert TB2 to TB2 (Recompress, Merge, or Split)
- Upload Your TB2 File(s): Click "+ Add Files" or drag and drop one or more
.tb2archives onto the dropzone. Drop several at once if you want to merge them into a single output archive. - Pick the Combine Mode: Under "Combine?" choose Single Archive to merge every uploaded archive's contents into one new TB2, or Individual Archives to repack each input as its own TB2. When the source is already an archive, the default is Individual Archives.
- Confirm Output Format (Optional): The output extension is locked to
.tb2(tar + bzip2). If you want stronger compression, see TB2 to TAR.XZ (LZMA2) or TB2 to 7z. For Windows-native sharing, use TB2 to ZIP, or strip compression entirely with TB2 to TAR. - Convert and Download: Click "Convert." The bzip2 layer is decompressed, the tar is unpacked, the contents are re-packed with
tar, then recompressed withbzip2and delivered to your browser. No watermark, no sign-up, no email.
Why Convert TB2 to TB2?
A TB2-to-TB2 pass is not a no-op. The tool decompresses the bzip2 stream, unpacks the tar, then writes a brand-new tar stream and recompresses it with bzip2 — so the bzip2 header, the BWT block structure, the tar headers, and the file ordering inside the archive are all freshly written. That matters in several specific cases:
- Normalize the bzip2 block size. bzip2's
-1through-9flags set the BWT block size from 100k to 900k bytes (-9is the default). The block size used for compression is stored in the file's header, so flags during decompression are ignored — the only way to switch from a-1-compressed.tb2to a-9-compressed.tb2is to decompress and recompress, exactly what this conversion does. - Defragment a concatenated multi-stream
.tb2. Per the bzip2 manual,bunzip2will correctly decompress a file that is the concatenation of two or more.bz2streams (a feature since version 0.9.0). Repacking emits one clean, single-stream.tb2that older tools, embedded extractors, and some parallel decompressors handle without quirks. - Merge multiple TB2 files into one. Drop several
.tb2files in, pick Single Archive, and the contents are extracted and combined into one output.tb2. Avoids the manualtar -xjf a.tb2 && tar -xjf b.tb2 && tar -cjf merged.tb2 .shell loop. - Split one TB2 into per-entry archives. Use Individual Archives when the source contains many independent top-level items — each becomes its own
.tb2, useful for parallel CI fetch or bulk distribution where each recipient only needs one folder. - Fix a broken tar header chain. When a
.tb2was produced by a tool that wrote non-standard tar header padding (some legacy Java archive libraries, certain container snapshot exporters), repacking throughbzip2+ GNUtarproduces a stream that every BSD tar, GNU tar, and 7-Zip can read. - Normalize the tar member format. A
.tb2may have been written in v7, ustar (POSIX.1-1988), GNU (withL-block long names), or PAX (POSIX.1-2001) format. Repacking emits a single consistent format that downstream tools handle predictably.
.tb2 vs .tar.bz2 — Are They Different?
| Property | .tb2 |
.tar.bz2 |
|---|---|---|
| Underlying format | tar stream compressed with bzip2 | tar stream compressed with bzip2 |
| Byte-for-byte identical for same content? | Yes | Yes |
| Origin of shorthand | DOS/Windows 8.3 filename limit (1980s-90s) | Native Unix long filename |
| Other valid shorthands | .tbz, .tbz2, .tz2 |
n/a |
| MIME type | application/x-bzip2 |
application/x-bzip2 |
| Tooling | tar -xjf, bunzip2 + tar -xf |
Identical |
| Magic bytes inside file | 42 5A 68 ("BZh") |
42 5A 68 ("BZh") |
There is no technical difference. Renaming archive.tar.bz2 to archive.tb2 (or vice versa) does not change a single byte inside the file. Use whichever extension your downstream tool or convention expects.
bzip2 Compression Level Quick Guide
| Level | Block size | Compression RAM | Decompression RAM | Typical use |
|---|---|---|---|---|
-1 |
100k | ~1,200 KB | ~500 KB | Memory-constrained embedded systems, very small inputs |
-5 |
500k | ~4,400 KB | ~2,100 KB | Mid-range balance, rarely the right pick |
-9 (default) |
900k | ~7,600 KB | ~3,700 KB | General use — the GNU bzip2 default and the assumed setting on Linux distros |
The default block size is -9 (900k) — unlike gzip, bzip2's default is its maximum setting. Memory figures are from the upstream bzip2 manual at sourceware.org/bzip2. Because the block size is recorded in the file header, you cannot change it without a full decompress/recompress cycle, which is what this tool does.
For files where the last few percent matters, switching format usually beats raising the bzip2 level — bzip2 caps at 900k blocks, so the BWT cannot find correlations beyond a single block. See TB2 to TAR.XZ for LZMA2 (often 10-25% smaller than bzip2 on source code) or TB2 to 7z for the LZMA2 + 7z container.
Frequently Asked Questions
Will my TB2 actually get smaller after repacking?
Usually only by a small amount. bzip2 is deterministic, so re-running the same data through bzip2 at the same block size yields a similar file size. The realistic wins come from (a) upgrading from a non-default block size — for example, if the source was compressed with bzip2 -1 (100k blocks), repacking at the -9 default can shrink the archive by a meaningful percentage on text-heavy content, and (b) collapsing a concatenated multi-stream .tb2 back into a single stream. For larger gains on already-tight TB2s, switch format to .tar.xz (LZMA2) via TB2 to TAR.XZ.
What does "change the bzip2 block size" actually do?
bzip2 splits the input into blocks (100k to 900k bytes) and applies the Burrows-Wheeler Transform, move-to-front coding, RLE, then Huffman coding to each block independently. Larger blocks let the BWT find more repeated context within a single block, which generally improves the compression ratio at the cost of more RAM (400k + 8 × block size for compression per the bzip2 manual). Because the block size is encoded in the file's header at compress time, no bunzip2 flag can change it — the only way to switch is to fully decompress and recompress, which is exactly what this conversion does.
Can bzip2 streams really be concatenated, and why would I want to defragment that?
Yes. The bzip2 manual explicitly documents that bunzip2 will correctly decompress a file that is the concatenation of two or more compressed streams, supported since bzip2 0.9.0 (1999). This is how tools like pbzip2 (the parallel implementation) write output — many small streams glued together. The streams decompress fine but some older or embedded tools only handle the first stream, and parallel decompression of a single-stream .tb2 can be faster than seeking across stream boundaries. Repacking through this tool collapses everything into one clean stream.
Does converting TB2 to TB2 change the tar member format?
It can. GNU tar supports several on-disk formats — v7 (legacy, very long filenames truncated), ustar (POSIX.1-1988), GNU (with L-blocks for long names), and PAX/POSIX.1-2001 (extended headers). When the tool repacks, it writes a single consistent format that all modern tar implementations read. If your source TB2 used GNU's deprecated long-name encoding and a downstream tool only speaks PAX, repacking can fix the compatibility gap.
How do I merge multiple TB2 files into one?
Drag every .tb2 file into the upload area at once, or use successive "+ Add Files" clicks. Set "Combine?" to Single Archive. The tool extracts each input archive, combines the contents, and writes one merged output .tb2. If two source archives contain a file at the same relative path, the later one overwrites the earlier one — rename inside one of the archives before uploading if you need to keep both copies.
Will repacking preserve Unix file permissions and symlinks?
Yes. The tar format records POSIX permissions, ownership (UID/GID), and symbolic links inside the tar headers, and the repack writes them back unchanged. This is the main reason TB2 persists on Linux instead of being replaced by ZIP — ZIP's permission handling is convention-only and varies by tool, whereas tar's is standardized. If you need full xattrs (SELinux labels, capabilities, ACLs), make sure the source was created with tar --xattrs and the PAX format; otherwise those are stripped at archive time, not at repack time.
Why is the output size sometimes a few bytes different from the input?
Because the bzip2 stream is rebuilt from scratch. Even if the underlying tar bytes are identical, fresh Huffman tables, the BWT pointer for each block, and the end-of-stream 32-bit CRC are all recomputed, so a few hundred bytes near block boundaries and the trailer can shift. The actual file contents inside the archive are untouched.
Can I add encryption or a password to the output TB2?
Not natively. The .tb2 format has no built-in password layer — bzip2 and tar both predate consumer encryption as a standard archive feature. To encrypt, pipe through GPG (tar -cjf - dir | gpg -c > dir.tb2.gpg) or convert to a format that supports it: TB2 to 7z gives AES-256 with optional header encryption, and TB2 to ZIP supports AES-256 in tools that implement WinZip's spec.
When should I pick a different format instead of repacking TB2?
If you need broad compatibility with Windows users who'll double-click in File Explorer, use TB2 to ZIP — Windows has read-only .tar.bz2 support only via the bundled tar.exe (Windows 10 build 17063 and later) and the GUI still defaults to ZIP. If you need maximum compression, use TB2 to TAR.XZ (LZMA2) or TB2 to 7z — both routinely produce archives 10-25% smaller than bzip2 on source code, logs, and other text. If you just want the plain uncompressed tar to pipe through a different compressor, use TB2 to TAR. And if you only care about extracting the files (not re-archiving), use Extract TB2.