JSON Formatter
Pretty-print messy or minified JSON with 2-space indents.
Minify JSON to one compact line by stripping all insignificant whitespace in your browser. It parses the JSON, so it catches invalid input.
Your browser is preparing the tool. It runs 100% locally.
Paste JSON and the tool removes every space, tab and line break that is not inside a string, collapsing the data to one compact line. Unlike a regex tidier, it genuinely parses the JSON first, so the output is guaranteed valid and any malformed input is rejected with an error. Use it to shrink a config or an API payload for transfer. The JSON Minifier runs in your browser and uploads nothing.
This tool takes formatted, indented JSON and compresses it into the smallest equivalent text: a single line with no insignificant whitespace. The data is identical; only the spacing used to make it readable is removed.
Minify JSON wherever size matters: an API request body, a config embedded in code, a cache value, or a query parameter, where indentation is wasted bytes.
The tool parses your text into a real data structure and then serialises it straight back out with no spacer between keys, values and elements. Because it round-trips through a real parse, the result is always valid JSON, and whitespace that was only there for readability is not written back.
That parse step is the important difference from a regex stripper. The tool understands strings, so spaces inside a string value are preserved, while the spacing between structural tokens is dropped. If the input is not valid JSON, the parse fails and the tool reports the error rather than producing broken output.
parse the text into data, then serialise with no spacer
• drop spaces, tabs and newlines between tokens
• keep all whitespace inside string values
• invalid JSON is rejected, not guessedBefore: { "id": 7, "tags": [ "pdf", "image" ] }
After: {"id":7,"tags":["pdf","image"]}The data is unchanged; only readability whitespace goes. Because it parses, a comment, a trailing comma or a single-quoted key (none of which are valid JSON) makes it report an error instead of minifying.
Your browser parses and minifies the JSON without a network request, so it stays on your device.
Because the work is local, you can safely minify payloads or configs that contain tokens, keys or internal data without them being stored or sent anywhere.
Nothing carries over between visits. Close the tab and the input and output are gone.
Because it parses and re-serialises, the output is always valid JSON representing the same data. Unlike a regex-based stripper, it cannot turn valid input into broken output.
Validity is enforced, so anything that is not strict JSON is rejected. JSON with comments or trailing commas (sometimes called JSONC or JSON5) will not minify here; remove those first or use a tool that supports them.
Very large integers can shift. Numbers beyond the safe integer range are stored as floating point, so a 20-digit identifier may come back rounded. Keep such values as strings if exactness matters.
Duplicate keys collapse to the last one, because the parser builds an object where each key appears once. That matches how JSON parsers behave generally, but it means a minified object can have fewer keys than the text you pasted.
Compress a request or response body to save bytes over the wire.
Inline a compact config without multi-line indentation.
Store JSON compactly in a cache, cookie or database field.
Catch invalid JSON, since the tool parses before it compresses.
To go the other way and indent JSON for reading, use a JSON formatter. For JSON with comments or trailing commas, strip those or use a JSON5-aware tool. To keep huge identifiers exact, store them as strings before minifying.
Minifies by parsing the JSON and re-serialising it with no spaces, so it also validates as a side effect. It shares the parse-level limits of any JSON tool.
Pretty-print messy or minified JSON with 2-space indents.
Paste JSON and find out whether it parses.
Standard Base64 for any text, emoji included.
MD5, SHA-1 and the SHA-2 hashes of any text, as you type.
Up to 500 random version 4 UUIDs at once.
Strips comments and whitespace to put a stylesheet on one line.
Paste, run and copy. The code stays in your browser and you don't need an account.