gizmobench
BrowseDaily

Burrows–Wheeler Transform

Explore the Burrows–Wheeler transform using an explicit sentinel or primary-index convention. Enter source text to inspect its sorted cyclic rotations and last column, or reverse a transformed string to recover the original. Copy or download the output and keep the displayed primary index when using index mode.

Include exactly one sentinel at the end of the source text. The transformed text retains it; inverse mode derives the original row from its last-column position. Sorting uses Unicode codepoint values, with no locale collation or normalization.

Primary index: 4

7 Unicode codepoints. Indexing starts at zero.

The TXT download contains the output only. In index mode, save primary index 4 separately.

Sorted rotations and last column

Read the last column from top to bottom to obtain the forward transform. The highlighted row is the original sequence. Equal rotations retain source-offset order.

RowRotationLast
0$banana"a"
1a$banan"n"
2ana$ban"n"
3anana$b"b"
4 (original)banana$"$"
5na$bana"a"
6nana$ba"a"

An exact reversible rearrangement under the displayed convention, not encryption or compression by itself. Processing stays in this browser and inputs are not saved.

Common questions

How does the forward Burrows–Wheeler algorithm work?
The forward algorithm sorts cyclic rotations of your input, then reads the last column from top to bottom. The primary index identifies the original rotation. Longer inputs are sorted by repeatedly doubling the compared prefix length, rather than building a full rotation table.
How does inverse BWT reconstruct a string?
The inverse algorithm sorts the last column to obtain the first column. It matches each character occurrence in the last column to the same occurrence in the first column, then follows those row links from the primary index to rebuild the original text from right to left. An inconsistent last-column/index pair is rejected.
How is BWT used in data compression?
BWT rearranges symbols without reducing the number of codepoints. It can group repeated characters, which may help a later compression stage. This tool does not create compressed archives or encrypted text.
What is the banana example?
With a unique trailing $ sentinel, banana$ transforms to annb$aa. Its original rotation is row 4 when rows start at zero. Inverting annb$aa under the same convention returns banana$.
How do sentinel and index modes differ?
Sentinel mode requires exactly one chosen codepoint, placed at the end of the source. It remains in the transformed text and identifies the original row during inversion. Index mode adds no sentinel; save the displayed zero-based primary index with the last column. TXT downloads contain only output text.
How are Unicode and repeated rotations sorted?
Sorting compares Unicode codepoint values, without locale collation or normalization. Emoji codepoints stay intact, but multi-codepoint grapheme clusters can be separated. Equal rotations use source-offset order; inverse mode rejects noncanonical primary indices for identical rotations.
Why is the rotation table sometimes omitted?
The table appears for inputs up to 64 codepoints. Longer input still transforms exactly up to 4,096 codepoints, but the full quadratic display is omitted to limit memory and screen use.
Does the tool save or upload text?
Processing stays in your browser. Inputs are not saved. Copy and TXT download are available after a valid result; malformed sentinel or index inputs produce an explicit error.
Can I use it for bioinformatics or positional BWT?
You can rearrange a short DNA letter string as plain text, but the tool does not parse sequence files, align short or long reads to a reference, or implement positional BWT across multiple sequences.
Can I download a Python or Java implementation?
No Python or Java implementation is supplied. This page runs in a browser; its download control exports a result rather than an implementation.

An exact reversible rearrangement under the displayed convention, not encryption or compression by itself.