ToolsCrateAll tools

LZString Compressor and Decompressor

LZString is the compressor RPG Maker and countless HTML5 games use for saves and localStorage. Paste or drop data and the variant is detected for you.

Or load a file

LZString is a dictionary compressor, not encryption — it takes no key, because the dictionary is rebuilt from the data itself. RPG Maker MV and MZ use the Base64 variant for their saves, and many HTML5 games use it for localStorage. The four variants differ only in which characters the output is packed into.

Frequently Asked Questions

What is LZString?

A JavaScript compression library based on LZW, designed to pack data into strings that fit in localStorage. It is compression, not encryption, and needs no key — the dictionary is rebuilt from the data itself.

Which variant should I choose?

Leave it on automatic and the right one is detected. Base64 is what RPG Maker saves use; URI-safe appears in URLs; UTF-16 packs more per character for localStorage; raw is the plain form. Base64 and URI-safe differ only in three characters, so a payload using none of them decodes identically either way.

Why did my data fail to decompress?

Most often the string was truncated on copy — LZString needs the whole payload. It can also mean the data is not LZString at all; the File Inspector will tell you what it actually is.

Is the output identical to the official library?

Yes. This implementation is tested against lz-string 1.5.0 across hundreds of inputs in both directions, producing byte-identical output for all four variants.