Structured Data
JSON Minifier
Minify JSON or JSON Lines in your browser. Only whitespace between tokens is removed; long numbers, key order, and spaces in strings stay exact.
This tool runs open-source code from OmniTools (MIT License). See open-source credits.
JSON Minifier deletes the spaces, tabs, and line breaks between JSON tokens. It never changes characters inside strings. Numbers keep their exact text, so 9007199254740993 does not become 9007199254740992. If the input holds several JSON values on separate lines, each line is minified as a JSON Lines record.
One JSON document becomes a single line. JSON Lines input keeps one compact record per line, and blank lines are removed.
- Put a JSON config into an environment variable or a one-line log field.
- Compact each record of an NDJSON log export while keeping one record per line.
- Remove formatting differences before comparing the size of two JSON payloads.
Instructions
- Paste one JSON value, or JSON Lines with one complete value per line.
- The tool has no settings. Read the compact result in the output panel.
- If a JSON Lines record is broken, the error names its line, for example Invalid JSON at line 2.
- Compare a long ID or string in the result with the source, then copy or download it.
Example
Input: { "id": 9007199254740993, "note": "two spaces", "tags": [ "a", "b" ] }
Settings: None. This tool has no options.
Result: {"id":9007199254740993,"note":"two spaces","tags":["a","b"]}
The id keeps its final digit 3, and the double space inside note stays. Only whitespace between tokens is removed.
Limits
- The parser accepts strict JSON only. Comments and trailing commas cause an error; the minifier does not strip them.
- Duplicate keys stay in the output. The minifier does not detect or merge them.
- Minifying removes whitespace only. It does not shorten keys, drop null values, or compress the data.
- A JSON Lines error reports the line number only, not the column. Format that line alone to find the exact position.