LZ-String Compressor & Decompressor

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

Lz String Tool · Client runtimeSandboxed
Formatted results will render here in real time.

About this lz-string compressor & decompressor

Applies LZ-based dictionary compression designed by pieroxy for compact browser storage Runs entirely in-memory using Web Crypto primitives to keep sensitive tokens, certificates, and cryptographic keys secure from third-party interception.

Encoding & cryptographic principles

Executes standards-compliant binary-to-text encodings and client-side data compression. Base64 implements RFC 4648 mapping 3 octets (24 bits) into four 6-bit sextets with '=' padding, offering both standard ('+', '/') and URL-safe ('-', '_') alphabets. URL encoding conforms to RFC 3986 percent-encoding for reserved URI characters. Data compression utilizes DEFLATE (RFC 1951), GZIP (RFC 1952), and LZ-String algorithms to compress large text streams directly in browser memory.

Worked verification 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. This short input expands from four characters to nine encoded characters.

Illustrative output:

{ "algorithm": "LZ-String URI-safe", "value": "MILQ8ggkA" }

Security parameters & input constraints

This is LZ-String's URI-safe representation, not ZIP, gzip or encryption. A malformed compressed value can return an empty string, indistinguishable from a valid empty result; unknown operation names follow compression.

Cryptographic digests, encoded strings, and signatures generated by LZ-String Compressor & Decompressor should be verified against target authentication systems before production use.

Client-side Web Crypto boundary

Key derivation, hashing, and encoding in LZ-String Compressor & Decompressor execute in local memory using Web Crypto APIs without remote socket transmission.

Cryptographic specifications & RFC standards

Technical specifications and cryptographic RFC standards governing algorithms and key representations:

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

LZ-String Compressor & Decompressor verification · Audit standards

How to use it

  1. Enter JSON with text to compress; operation defaults to compress.
  2. Run LZ-String compressToEncodedURIComponent locally and read its URI-safe value in JSON.
  3. For decompression, enter operation decompress and the earlier value; read the returned plain text.

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 result should the documented example produce?+

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.