JSON Minifier
Minify JSON to shrink API payloads and config files, beautify it with 2 or 4-space indentation, or validate it with exact error positions. Live byte counts show precisely how much you save. Free, no sign-up, runs entirely in your browser.
Parsing and re-serialising use the browser's built-in JSON engine. Nothing is uploaded or logged.
Minify and Beautify re-serialise the parsed document, so the output is guaranteed valid whenever the input parses.
Why minify JSON?
JSON is the default format for API responses, webhook payloads, config files and fixture data, and a great deal of it travels with generous indentation that no parser needs. Minifying removes newlines, indentation and the spaces around colons, commas and braces, typically shrinking a pretty-printed payload by 15 to 40 percent. On a busy endpoint that saving multiplies across every request: smaller responses mean lower bandwidth bills, faster time-to-first-byte on slow connections and quicker mobile startup. This JSON minifier shows input size, output size and the exact percentage saved as you type, so you can measure the win on your own payloads instead of guessing. Because the tool parses the input first and re-serialises it with JSON.stringify, the minified output is guaranteed to be valid JSON whenever the input is.
Beautify and validate when humans need to read it
The same engine works in the other direction: paste a minified API response and Beautify expands it with 2 or 4-space indentation so nested objects and arrays are easy to scan. Validate only mode reports whether the document parses without rewriting it at all. When JSON.parse rejects your input, you get the parser's own message and, where the browser provides it, the exact character position converted into a line and column. That pinpoints the usual suspects: trailing commas, single-quoted strings, unquoted keys, comments (JSON has none) and stray text outside the document.
How to use this JSON minifier
Paste JSON into the input box, click Load example for a sample nested document, or upload a .json file (it is read locally, never sent anywhere). Pick Minify, Beautify or Validate only, choose an indent width for beautify, and the output updates instantly with validation status and byte counts. Then copy the result or download it as a .json file. The whole tool is one static page of JavaScript, so it handles large files without a server and keeps working offline after the page loads.
Frequently asked questions
What does JSON minification do?
JSON minification removes every character that is not needed by a parser: newlines, indentation and the spaces around colons, commas and braces. The data itself, including all keys, values and string content, is byte-for-byte identical. Because the tool re-serialises the parsed document with JSON.stringify, the output is guaranteed to be valid JSON whenever the input is.
How much smaller does minified JSON get?
Pretty-printed JSON typically shrinks by 15 to 40 percent when minified, depending on how deeply it is indented and how much whitespace it carries. The tool shows input size, output size and the exact percentage saved, so you can measure the effect on your own API responses, config files or fixture data rather than guessing.
Why does my JSON fail to validate?
The most common causes are trailing commas after the last item, single-quoted strings, unquoted keys, comments (JSON has none), and stray text before or after the document. When JSON.parse rejects your input, this tool shows the parser's message and, where the browser reports it, the exact character position converted into a line and column so you can jump straight to the problem.
What is the difference between 2-space and 4-space beautify?
Only the indent width. Two spaces is the convention in most JavaScript, Node.js and npm projects and keeps deeply nested documents narrow. Four spaces matches many Python and C-style codebases and can be easier to scan at a glance. Both produce equally valid JSON; pick whichever matches the project you are pasting into.
Is my JSON uploaded anywhere?
No. Parsing, minifying and beautifying all run locally in your browser with JavaScript's built-in JSON engine. Your data never leaves your device, there is no server round-trip, and the page keeps working if you disconnect from the internet after it loads.