Burrows Wheeler Transform Calculator

Enter text and build sorted rotation tables quickly. Decode outputs with the saved primary index. Export results, tables, and formula notes for careful review.

Calculator

Example Data Table

Input Sentinel Working String Transform Primary Index
BANANA $ BANANA$ ANNB$AA 4
ABRACADABRA $ ABRACADABRA$ ARD$RCAAAABB 3
MISSISSIPPI $ MISSISSIPPI$ IPSSM$PISSII 5

Formula Used

Let S be the working string with length n. Build rotations Ri = S[i..n-1] + S[0..i-1]. Sort all rotations. The transformed string L is made from the last character of each sorted row. The primary index p is the sorted row where Ri equals the original working string.

For inverse work, sort L to form the first column F. Matching repeated character occurrences connects L rows to F rows. This calculator uses the visible table rebuilding method for clarity.

How to Use This Calculator

  1. Select encode text or decode transform.
  2. Enter the source text or the transformed string.
  3. Choose a sentinel that does not appear in the source.
  4. Enter the primary index when decoding.
  5. Set the matrix row limit for the preview table.
  6. Press calculate, then review the result above the form.
  7. Use CSV or PDF buttons to save the result.

Understanding Burrows Wheeler Transform

The Burrows Wheeler Transform, often called BWT, rearranges text without losing data. It does not compress data by itself. It prepares repeated characters and nearby patterns for stronger compression steps. That makes it useful before run length coding, move to front coding, and entropy coding.

Why This Calculator Helps

This calculator shows the transform in a clear, practical way. You can enter plain text, choose a sentinel symbol, and create the transformed string. You can also reverse a known transform by entering the last column and its primary index. The result block appears above the form, so the answer is easy to review before changing inputs.

How The Transform Works

BWT builds every cyclic rotation of the input. It then sorts those rotations in lexicographic order. The last character of each sorted row becomes the transformed output. The row that contains the original text gives the primary index. A unique sentinel is usually added, because it marks the true end of the string.

Reverse Transform Idea

The inverse method uses the relationship between the first column and last column. The first column is the sorted version of the transformed text. Repeated sorting can rebuild the rotation table for learning purposes. Efficient production tools use last first mapping, but the visible table method is easier to inspect.

Practical Uses

BWT is common in compression pipelines. It groups similar symbols together, which can create long runs. Those runs are easier to encode with later methods. The transform is also reversible, so the original text can be restored exactly when the correct index is known.

Good Input Tips

Use short text when you want to inspect all rotations. Long strings create large tables. Choose a sentinel that does not appear in the original input. The dollar sign is common, but any unique character can work. For decoding, copy the transformed string exactly. Also enter the primary index from the encoding result. Small changes can produce a different output.

Final Notes

This tool is designed for study, checking homework, testing examples, and building intuition. It keeps the steps visible and gives export options for records. Use the CSV button for spreadsheet work. Use the PDF button for printable summaries too.

FAQs

What is the Burrows Wheeler Transform?

It is a reversible text rearrangement method. It sorts all cyclic rotations of a string and reads the last column. The result often groups repeated characters, which helps later compression stages.

Does this transform compress text?

No. The transform only rearranges characters. Compression usually happens after it, using methods such as move to front coding, run length coding, or entropy coding.

Why is a sentinel needed?

A sentinel marks the true end of the string. It should be unique. This removes ambiguity when rotations are sorted and makes decoding easier to confirm.

What is the primary index?

The primary index is the row number of the original working string after all rotations are sorted. It is required to reverse the transform correctly.

Can I decode without the index?

Usually no. The transformed string alone may not identify the original rotation. Use the index shown during encoding, or decoding can return the wrong rotation.

Why are long inputs limited?

The visible learning method builds rotation tables. Large inputs need much more memory and time. The limit keeps the page responsive and easier to inspect.

Can I use spaces and punctuation?

Yes. Spaces, punctuation, and digits are treated as normal characters. Make sure the chosen sentinel does not already appear in the original input.

What do the export buttons save?

The CSV and PDF options save the main result, input settings, length, index, sentinel, and available matrix preview rows for documentation.

Related Calculators

Paver Sand Bedding Calculator (depth-based)Paver Edge Restraint Length & Cost CalculatorPaver Sealer Quantity & Cost CalculatorExcavation Hauling Loads Calculator (truck loads)Soil Disposal Fee CalculatorSite Leveling Cost CalculatorCompaction Passes Time & Cost CalculatorPlate Compactor Rental Cost CalculatorGravel Volume Calculator (yards/tons)Gravel Weight Calculator (by material type)

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.