KANZI(1)
π KANZI(1) β the manual, but make it cute β¨
okay bestie, gather round, because this is the page for kanzi, a User Commands situation, and she is that girl. π
πΈ NAME πΈ
kanzi β Compress and decompress .knz files π
π¦ SYNOPSIS π¦
kanzi [OPTIONS] [-i INPUT-FILE] [-o OUTPUT-FILE]
β¨ DESCRIPTION β¨
Kanzi is a modern, modular, portable and efficient lossless data compressor. iconic behavior honestly.
Modern algorithms are implemented and multi-core CPUs can take advantage of the built-in multi-threading. An entropy codec and a combination of transforms can be provided at runtime to best match the kind of data to compress. The code is optimized for efficiency (trade-off between compression ratio and speed). β¨
Unlike the most common lossless data compressors, Kanzi uses a variety of different compression algorithms and supports a wider range of compression ratios as a result. She's versatile like that. π
Kanzi is multithreaded by design and uses several threads by default to compress or decompress blocks concurrently. It is not compatible with standard compression formats such as zip, gz, zstd, br, lz4, xz. Kanzi is a lossless data compressor, not an archiver. It uses checksums (optional but recommended) to validate data integrity but does not have a mechanism for data recovery. It also lacks data deduplication across files. so yeah, know that going in, no cap. π
Kanzi generates a bitstream that is seekable (one or several consecutive blocks can be decompressed without the need for the whole bitstream to be decompressed). lowkey iconic. π
π OPTIONS π
π Operation Mode
π«Ά Help.
-h,--helpβ display this message. the little "hi bestie, here's ur menu" moment. π
π₯ Compression mode.
-i,--input=<inputName>β Mandatory name of the input file or directory or'stdin'. When the source is a directory, all files in it will be processed. Provide/.at the end of the directory name to avoid recursion (e.g.,myDir/.=> no recursion). π-o,--output=<outputName>β Optional name of the output file or directory (defaults to<inputName.knz>) or'none'or'stdout'.'stdout'is not valid when the number of jobs is greater than 1. π-b,--block=<size>β Size of blocks (default4|8|16|32 MBbased on level, max1 GB, min1 KB).'auto'means that the compressor derives the best value based on input size (when available) and number of jobs. π-l,--level=<compression>β Set the compression level[0..9]. Providing this option forces the entropy codec and transform. See the definitions of the transforms and entropy codecs in the last section.
0 = NONE&NONE (store)
1 = LZX&NONE
2 = DNA+LZ&HUFFMAN
3 = TEXT+UTF+PACK+MM+LZX&HUFFMAN
4 = TEXT+UTF+EXE+PACK+MM+ROLZ&NONE
5 = TEXT+UTF+BWT+RANK+ZRLT&ANS0
6 = TEXT+UTF+BWT+SRT+ZRLT&FPAQ
7 = LZP+TEXT+UTF+BWT+LZP&CM
8 = EXE+RLT+TEXT+UTF+DNA&TPAQ
9 = EXE+RLT+TEXT+UTF+DNA&TPAQX
-e,--entropy=<codec>β entropy codec[None|Huffman|ANS0|ANS1|Range|FPAQ|TPAQ|TPAQX|CM]π-t,--transform=<codec>β transform:
[None|BWT|BWTS|LZ|LZX|LZP|ROLZ|ROLZX|RLT|ZRLT]
[MTFT|RANK|SRT|TEXT|MM|EXE|UTF|PACK]
e.g., BWT+RANK or BWTS+MTFT (default is BWT+RANK+ZRLT) β¨
-x,-x32,-x64,--checksum=<size>β Enable block checksum (32 or 64 bits). During decompression data is verified against the checksum in each block.-xis equivalent to-x32. π-s,--skipβ copy blocks with high entropy instead of compressing them. sometimes the move is literally do nothing, and that's valid. π--rmβ Remove the input file after successful (de)compression. If the input is a directory, all processed files under the directory are removed. π
π Decompression mode.
-i,--input=<inputName>β Mandatory name of the input file or directory or'stdin'. When the source is a directory, all files in it will be processed. Provide/.at the end of the directory name to avoid recursion (e.g.,myDir/.=> no recursion). π¦-o,--output=<outputName>β Optional name of the output file or directory (defaults to<inputName.bak>) or'none'or'stdout'.'stdout'is not valid when the number of jobs is greater than 1. π--from=blockIdβ Decompress starting from the provided block (included). The first block ID is1.--to=blockIdβ Decompress ending at the provided block (excluded).--rmβ Remove the input file after successful (de)compression. If the input is a directory, all processed files under the directory are removed. π
π§ Info mode.
-i,--input=<inputName>β Mandatory name of the compressed input file. When the source is a directory, all files in it will be processed. Provide/.at the end of the directory name to avoid recursion (e.g.,myDir/.=> no recursion). πΈ
β Operation modifiers.
-j,--jobs=<jobs>β Maximum number of jobs the program may start concurrently (default is half the available cores, maximum is64). π«Ά-v,--verbose=<level>β0=silent,1=default,2=display details,3=display configuration,4=display block size and timings,5=display extra information. Verbosity is reduced to1when files are processed concurrently. Verbosity is reduced to0when the output is'stdout'. π¬-f,--forceβ Overwrite the output file if it already exists. no hesitation, just send it. π₯--skip-linksβ Skip symbolic links.--skip-dot-filesβ Skip dotfiles.
π Examples
Compress recursively all files under 'dir' in test mode (no output file) using a 4 MB block, compression level 4, and extra verbosity.
kanzi -c -i dir -o none -b 4m -l 4 -v 3
Compress foo.txt to foo.txt.knz (overwrite it if it already exists) using the BWT, MTFT, and ZRLT transforms, the FPAQ entropy codec, and 4 threads; generate a checksum for each 4 MB block.
kanzi -c -i foo.txt -f -t BWT+MTFT+ZRLT -b 4m -e FPAQ -j 4 -x
Compress from stdin (--input option is omitted) to foo.knz using compression level 2, 64 KB blocks, and the default number of threads.
cat foo.txt | kanzi -c -o foo.knz -l 2 -b 64k
Decompress foo.txt.knz to foo.txt.knz.bak using 2 threads.
kanzi -d -i foo.txt.knz -j 2
Decompress foo.txt.knz to stdout and delete the compressed file.
kanzi -d -i foo.txt.knz -o stdout --rm
Decompress foo.txt.knz to foo.txt (overwrite it if it already exists) from block 5 to block 11, using 8 threads and extra verbosity.
kanzi -d -i foo.txt.knz -o foo.txt -f -j 8 --from=5 --to=11 -v 4
π§ Transforms
- BWT β Burrows-Wheeler Transform is a transform that reorders symbols in a reversible way that is more amenable to entropy coding. This implementation uses a linear time forward transform and parallel inverse transform. β¨
- BWTS β Burrows-Wheeler Transform by Scott is a bijective variant of the BWT.
- LZ β Lempel-Ziv implementation of the dictionary-based
LZ77transform that removes redundancy in the data. - LZX β Lempel-Ziv Extra. Same as above with a bigger hash table and more match searches.
- LZP β Lempel-Ziv Prediction can be described as an LZ implementation with only one possible match (no offset is emitted).
- RLT β Run-Length Transform is a simple transform that replaces runs of similar symbols with a compact representation.
- ZRLT β Zero Run-Length Transform. Similar to
RLTbut only processes runs of0. Usually used post-BWT. - MTFT β Move-To-Front Transform is a transform that reduces entropy by assigning shorter symbols to recent data (like an LRU cache). Usually used post-
BWT. - RANK β Rank Transform is a transform that reduces entropy by assigning shorter symbols based on symbol frequency ranks. Usually used post-
BWT. - EXE β A transform that reduces the entropy of executable files (X86 & ARM64) by replacing relative jump addresses with absolute ones. π
- TEXT β A text transform that uses a dictionary to replace common words with their dictionary index.
- ROLZ β Reduced Offset Lempel-Ziv is an implementation of LZ that replaces match offsets with indexes, creating a more compact output with slower decoding speeds.
- ROLZX β Extended
ROLZwith more match searches and a more compact encoding. - SRT β Sorted Rank Transform is a transform that reduces entropy by assigning shorter symbols based on symbol frequency ranks. Usually used post-
BWT. - MM β Multimedia transform is a fast transform that removes redundancy in correlated channels in some multimedia files (e.g.,
wav,pnm). - UTF β A fast transform replacing UTF-8 codewords with aliases based on frequencies.
- PACK β A fast transform replacing unused symbols with aliases based on frequencies.
- DNA β Same as
PACKbut triggered only when DNA data is detected. π§¬
π Entropy codecs
- Huffman β A fast implementation of canonical Huffman. Both encoder and decoder use code tables and multiple streams to improve performance.
- RANGE β A fast implementation of a static range codec.
- ANS β Based on Range Asymmetric Numeral Systems by Jarek Duda (specifically an implementation by Fabian Giesen). Works in a similar fashion to the Range codec but uses only one state instead of two, and encodes in reverse byte order.
- FPAQ β A binary arithmetic codec based on
FPAQ1by Matt Mahoney. Uses a simple adaptive order0predictor based on frequencies. - CM β A binary arithmetic codec derived from
BCMby Ilya Muravyov. Uses context mixing of counters to generate a prediction of the next bit value. - TPAQ β A binary arithmetic codec based initially on Tangelo
2.4(itself derived fromFPAQ8). Uses context mixing of predictions produced by one-layer neural networks. The initial code has been heavily tuned to improve compression ratio and speed. Slow but usually excellent compression ratio. π’β¨ - TPAQX β Extended
TPAQwith more predictions and more memory usage. Slowest but usually the best compression ratio. π
π BUGS π
Found a bug? Report it at: https://github.com/flanglet/kanzi-cpp/issues β pls do, she wants to hear it fr fr. π«Ά
πΈ AUTHOR πΈ
Frederic Langlet π
π REPORTING BUGS π
https://github.com/flanglet/kanzi-cpp
and that's the whole page, bestie!! π this is kanzi version 2.5, and the page is dated Feb 2026. go forth, compress stuff, slay. π
β¨π¦
π¦ where this page comes from
- ubuntu stonking: kanzi 2.5.3+git20260504+ds-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms