ToolHome

Home / Tools / Text Run-Length Encoder

Free browser utility

Text Run-Length Encoder

Encode consecutive repeated Unicode characters as JSON count pairs or decode those pairs back into the original text locally.

Encode consecutive repeated characters

Encode converts text into JSON pairs of a character and a count. For example, aaabb becomes [["a",3],["b",2]]. Only adjacent identical characters are combined. Select Decode and paste the JSON pairs to restore the original text.

Unicode and exact restoration

Characters are Unicode code points, so an emoji code point is kept whole. A visible symbol composed of multiple code points may span several pairs. Spaces, tabs and newlines are preserved through JSON escaping. Empty text encodes as an empty array. Decoding an empty array returns empty text.

Format, limits and privacy

Each pair must contain one Unicode code point and a positive integer count. Input and decoded output are limited to 100,000 UTF-16 code units; encoded JSON may be larger. This is an educational and data inspection format, not a general file compressor. Processing happens locally in your browser.

Related tools