Compression Demos
Simple lossless compression that replaces runs of repeated characters with the character followed by the count. Example: "aaabbc" becomes "a3b2c1".
Encode / Decode tabs at the top.Input box — the result updates live in the OUTPUT area.Encode mode, each run becomes a character plus its count, so aaabbc becomes a3b2c1.Decode mode, paste an RLE string like a3b2c1 to expand it back to the original text.Original Size, Encoded Size, Compression Ratio, and Runs Found — and watch the color-coded run chips.Copy Output to copy the result, or Clear to reset the input.Color-coded chips break the input into runs of character + count, so the encoding is visible at a glance.
RLE is the basis of formats like PCX, BMP, TIFF, and fax compression. See the exact mechanics without reading a spec.
The Compression Ratio stat reports "smaller" or "larger", since RLE only helps data with many repeated characters.
Paste an encoded string into Decode mode to expand it and confirm each count is correct.
Spaces, tabs, and newlines are encoded like any other character and rendered as ␣, \t, and \n in the run chips.
Everything runs locally in your browser. Nothing is uploaded, logged, or sent to a server.
RLE is a lossless compression scheme that replaces runs of identical characters with the character followed by the count. For example, aaabbc becomes a3b2c1.
Yes. Every run records its exact character and count, so the original text is reconstructed perfectly on decode — no data is lost.
This tool writes a count after every character, even a run of one, so abc becomes a1b1c1. On data with few repeats, RLE can expand it — the Compression Ratio stat will show "larger".
A run of ten or more uses a multi-digit count, so ten a characters encode as a10. Decoding reads all consecutive digits after a character as its count.
Yes. Whitespace is treated like any other character and is encoded as a normal run. In the visual display, spaces appear as ␣, tabs as \t, and newlines as \n.
A sequence of runs, each a character immediately followed by its count as digits — for example a3b2c1. A character with no following digits is ignored.
Never. All encoding and decoding happens locally in JavaScript, and your input is not sent to, stored on, or logged by any server.