Run-length encoding
Compress repeated characters into count-character pairs, and decode them back.
Run-length encoding
Run-length encoding replaces repeated characters with a count and the character itself: "aaabcc" becomes "3a1b2c" — three a's, one b, two c's. This tool encodes text that way, and decodes it straight back, entirely in your browser. It is the same principle behind fax compression, BMP's RLE variant and simple game-asset formats: repetitive data shrinks a lot, and text with no repetition barely changes size at all.
Two format options control how each run is written: count before the character (3a) or character before the count (a3). Turning on "only compress runs longer than 1" leaves single occurrences bare — "aaabcc" becomes "3ab2c" instead of "3a1b2c" — which reads closer to how RLE is taught, at the cost of needing a separator for text that also contains digits. A separator between runs (a comma, a space, anything you type) removes that ambiguity entirely, and is required reading for byte mode. "Process line by line" keeps runs from crossing line breaks, useful when each line is really its own record.
Byte mode treats the input as hex bytes instead of text characters — paste hex like "00 00 00 ff" (spaces are ignored) and it is grouped and compressed byte by byte, which is how RLE is actually used on binary data such as uncompressed image rows. Decoding mirrors every option: pick the same format, separator and byte-mode setting used to encode, and the original text or hex comes back exactly. The live tally shows input and output length plus the compression ratio, so you can see at a glance whether a given input is a good candidate for run-length encoding at all.
Everything runs locally in your browser — nothing you paste in is uploaded anywhere. Copy the result, download it as a .txt file, or send the output straight back into the input to switch direction and verify the round trip.