Burrows-Wheeler transform
Encode text into its Burrows-Wheeler transform, or decode it back to the original.
Burrows-Wheeler transform
The Burrows-Wheeler transform (BWT) rearranges the bytes of a message into runs of similar characters, without changing which bytes are present or losing any information needed to undo it. It is the preprocessing step inside bzip2 and other compressors, since grouping repeated bytes together makes the data far easier to compress afterward. This tool runs both directions: paste text, hex or a list of byte values to encode it, or paste a previous result back in to decode it and recover the original exactly.
Encoding sorts every cyclic rotation of the input and keeps the last column of that sorted list, plus the row number of the original — written out as "row index:data". Decoding reads that pair back and rebuilds the input byte-for-byte. Input and output formats are independent, so you can encode from text and read hex, or decode from bytes and view text. Hex and bytes round-trip any byte sequence exactly; text format only stays faithful on the transformed side when every byte is ASCII, since permuting multi-byte UTF-8 characters usually breaks them. Wrap long output at a fixed width, and choose whether the row index is zero-padded.
Short or repetitive input transforms fine but shows the effect less clearly than a longer, varied paragraph — try a few sentences to see the runs form. Sorting every rotation gets more expensive as the input grows, so this tool caps how much it will transform in one pass; split larger input into pieces if you hit that limit. The tally under the output reports byte counts on each side and, for encoding, the row index produced.
Everything runs locally in your browser — nothing you paste here is ever uploaded or stored on a server. Copy the result, download it as a .txt file, or send the output straight back into the input to try the reverse direction.