LZ-String Compressor & Decompressor

LZ-String Compressor & Decompressor: Applies LZ-based dictionary compression designed by pieroxy for compact browser storage.

Loading tool module...

About this lz-string compressor & decompressor

LZ-String Compressor & Decompressor — browser-based utility.

How this tool works

Implements client-side LZ-String Compressor & Decompressor operations. Applies LZ-based dictionary compression designed by pieroxy for compact browser storage specifically designed for a developer compresses a large javascript state object into an lz-based utf-16 string for url hash storage.

  1. Stream Byte Decoding: Converts input text into UTF-8 binary octet arrays via native TextEncoder / Uint8Array APIs.
  2. Bit Manipulation & Sextet Packing: Slices binary byte streams into 6-bit chunks, translating them against Base64 index lookup tables.
  3. Lempel-Ziv / Huffman Encoding: Applies LZ77 sliding-window dictionary compression and Huffman trees for DEFLATE/GZIP payloads.
  4. Integrity Verification: Validates complete round-trip reversibility, verifying that decoded bytes match original inputs byte-for-byte.

Worked example

Scenario: Inspect the URI-safe LZ-String representation returned for a short state value.

Sample input:

{"operation":"compress","text":"CZOA"}

Processing: Parses the request object and calls compressToEncodedURIComponent for the text.

Illustrative output:

JSON containing algorithm LZ-String URI-safe and a nonempty URI-safe value; no fixed reduction percentage is reported.

Limits and verification

Rejects malformed Base64 containing invalid characters or incorrect padding lengths. In URL decoding, rejects incomplete or truncated percent sequences (such as '%2' or '%ZZ').

Examples demonstrate an expected workflow; they do not prove every input or every branch of an external specification. Check important results with an independent source before using them for money, security, compliance, safety, or irreversible file changes.

Browser processing boundary

Tool input is processed by code running in the browser and is not intentionally sent to a CZOA processing API. The page can still request ordinary site assets, analytics, or advertising when those services are enabled. Browser extensions and managed-device software remain outside this tool's control.

Relevant references

These references govern or help explain the format, protocol, or calculation used here. Listing a reference does not claim certification or complete implementation of every optional feature.

  • LZ-String format by Pieroxy (implementation-specific; no RFC/ISO standard)

Content owner: CZOA Tools · Last reviewed: 2026-09-15 · Review methodology

How to use it

  1. Enter, paste, or select your input data into the LZ-String Compressor & Decompressor workspace controls.
  2. Review available parameter fields, units, formats, or options configured for your task.
  3. Click the action button or observe immediate live calculations rendered in your browser runtime.
  4. Inspect the resulting output and any diagnostic messages, then copy or download the result if needed.

Frequently asked questions

Which LZ-String operation is selected by default?+

It parses a JSON object. Unless operation is decompress, it takes text and returns a JSON object using LZ-String URI-safe compression.

What value is returned by compression?+

The output names algorithm LZ-String URI-safe and places the encoded value in value. It is not claimed to be Base64, UTF-16 output, or a fixed compression ratio.

How does decompression receive its input?+

Set operation to decompress and provide the encoded string in value. The tool returns the decoded string, or an empty string when the library cannot decode that value.

What did the browser fixture prove?+

A compress request for CZOA returned a nonempty URI-safe encoded value and the LZ-String URI-safe algorithm label. It did not measure storage savings.