Developer Tools
JSON Minifier
Minify JSON in your browser. Validate, compact, sort keys, and copy a JS string literal. See bytes saved live, no upload required.
Parsing and minification run entirely in your browser using the native JSON parser. Nothing is uploaded.
How to use
- Paste any valid JSON into the input area. Use Load sample if you just want to try the tool.
- Read the green status line for size before and after, plus the percentage of bytes saved.
- Optionally turn on Sort object keys alphabetically to produce deterministic, diff-friendly output.
- Copy the minified JSON, or copy it as a JavaScript string literal ready to paste into source code.
- If the parser reports an error, fix the line and column it points to and the output updates instantly.
About this tool
JSON Minifier compacts a JSON document into the smallest valid form your browser can produce. It runs the native JSON parser to confirm the input is valid, then re-serializes the parsed value with no whitespace between tokens. The result is byte-identical across browsers and ready to embed in API payloads, log lines, environment variables, or test fixtures where every byte counts. The tool reports four numbers you can act on: original UTF-8 byte size, minified UTF-8 byte size, bytes saved, and savings as a percentage. Bytes are measured with TextEncoder so multi-byte characters in non-ASCII strings are counted correctly, not approximated by character length. A short structure summary lists how many objects, keys, arrays, strings, numbers, booleans, and nulls the document contains, which is useful for sanity-checking pasted snippets before they ship. Two outputs are produced for every successful run. The minified JSON itself is shown in a scrollable code block with a one-click copy button, and a JavaScript string literal version (already escaped with JSON.stringify) is provided right below so you can paste the payload directly into a JS or TS source file without manually escaping quotes or backslashes. An optional Sort object keys alphabetically toggle reorders every object key recursively before serialization. This produces deterministic output that diffs cleanly across runs, plays nicely with snapshot tests, and gives the same hash for two semantically equal documents. When parsing fails, the error panel shows the parser message and, when the engine reports a position, the exact line and column in your input so you can find the typo quickly. There is also a Replace with minified action that loads the minified version back into the editor for chained passes (for example, minify then sort keys then minify again). Everything happens in the browser using the JSON parser bundled with V8, SpiderMonkey, or JavaScriptCore, so the API payloads, configs, and log samples you paste here never leave your device.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
JSON Formatter
Format, minify, and validate JSON in your browser.
Open tool
DeveloperJSON Diff Checker
Structural compare with paths for added, removed, and changed values.
Open tool
DeveloperJSON Escape / Unescape
Escape text into a JSON string literal or decode an escaped JSON string back to plain text.
Open tool
DeveloperCSS Minifier
Compress CSS with comment, whitespace, hex, and zero-unit optimizations and a live byte-savings readout.
Open tool