Free tool

Text compression test

Paste any text. Your browser compresses it with gzip and with a small predictive model, and shows which characters cost the most bits. The best compressors, such as the Transformer compressor tufazip, use the same principle with a much larger model. Your text stays in your browser. We do not send it or store it.

Samples:

Why a better prediction gives a smaller file

A compressor of this kind has two parts. A model reads the text so far and gives a probability for each possible next symbol. An arithmetic coder then writes the real next symbol with −log2(p) bits, where p is the probability that the model gave it. A symbol that the model expected with a probability of 1/2 costs 1 bit. A symbol that it expected with a probability of 1/256 costs 8 bits. So the size of the file is the total surprise of the model, and a model that predicts better makes a smaller file.

The decoder runs the same model. It sees the same text in the same order, so it makes the same predictions, and it can read the bits back into symbols. The model itself does not need to go into the file.

gzipFinds repeated strings and points back to them. It does not predict, so it cannot learn grammar.
Frequencies onlyPredicts each byte from how often it has appeared. "e" is cheap, "q" is expensive, and the context does not matter.
Context mixingPredicts each bit from the last 1 to 5 bytes and the current word, and learns which context to trust. This is the model in this page.
tufazipA 163M-parameter Transformer predicts the next token from the last 192 tokens.

How tufazip works

tufazip is a lossless compressor by Tommy He at Tufa Labs, published on 2026-10-14. It splits the text into tokens from a vocabulary of 4K words. A 12-layer Transformer with 163M parameters predicts each next token, and an arithmetic coder writes it.

The model learns while it compresses. The encoder and the decoder start from the same weights and make the same updates in the same order. So the weights that it learns never go into the file. In version 2, the model starts from a 34M-parameter model that was trained in advance. That model is quantized to 4.33 MB and ships with the decoder. Each update must be fully deterministic. If one floating-point result were different on the decoder, every later prediction would be wrong.

100,958,324compressed enwik9, bytes
4,430,029decoder with weights, bytes
105,388,353total, the ranked size
7.5 daysto decode enwik9 on 2 NVIDIA B200

That is about 1,549 bytes per second. gzip decodes hundreds of megabytes per second. The best results on this benchmark come from models that learn, and they are slow. We cannot run tufazip on this site, because we have no GPUs. The model on this page is far simpler: it counts contexts and has no neural network. It shows the same principle.

enwik9 results

CompressorMethod enwik9 bytesBits/charRatio
gzip -9 LZ77 with Huffman codes (1992) 322,591,995 2.581 3.1x
bzip2 -9 Burrows-Wheeler transform 253,977,839 2.032 3.9x
zstd -22 --ultra LZ77 with a large window 215,674,670 1.725 4.6x
xz -9e LZMA with a 1 GiB dictionary 197,331,816 1.579 5.1x
paq8px Context mixing of hundreds of models 124,696,410 0.998 8.0x
cmix v21 Context mixing plus an LSTM 107,963,380 0.864 9.3x
nncp v3.2 Transformer trained while it reads 106,632,363 0.853 9.4x
tufazip v2 Transformer with a trained prior 100,958,324 0.808 9.9x
fx2-cmix-transformer cmix with a Transformer model 96,996,198 0.776 10.3x

A selection from the Large Text Compression Benchmark (updated 2026-11-19, checked 2026-11-23). The benchmark ranks by the compressed size plus the size of the decompressor, and the full table has more entries. tufazip figures are from its README and write-up.

Prediction is also what a language model does. If you want next-token prediction for your own app, the DreamPrompting API gives free access to open models through an OpenAI-compatible endpoint.