JSON formatter

Paste JSON, get it pretty-printed. Runs locally in your browser.

Paste any JSON below and it will be reformatted with proper indentation. Nothing is uploaded; the formatter calls your browser's built-in JSON.parse and JSON.stringify, so the output is identical to what your own Node or browser code would produce.



Last updated June 2026 · Maintained by the JSONNeat author

Why I built this

I format JSON dozens of times a week and I'd grown tired of the alternatives. Most online formatters either bury the editor under intrusive ads, send what you paste to a remote server, or take five seconds to load on a phone. I wanted a third option — fast, local, and small enough to fit in a browser tab without feeling like a product. JSONNeat is what I came up with.

The formatter is the page you're on now. Paste anything, get it back pretty-printed. The same engine powers the validator, minifier and the CSV converter on the other pages. None of it touches a server.

How it works under the hood

The whole formatter is two function calls: JSON.parse on what you pasted, thenJSON.stringify with the indent size you chose. That's it. The parser is the one that ships with your browser, which is the same parser your Node backend or your application code calls, so whatever JSONNeat accepts your runtime will accept too. No whitespace heuristics, no key reordering, no escape-sequence quirks.

How to use it

  1. Paste raw, minified or messy JSON into the editor.
  2. Pick 2 or 4 space indentation in the toolbar.
  3. Copy or download the formatted result.

What you can do with it

  • Pretty-print with 2 or 4 space indentation.
  • See the line and column of any syntax error as you type.
  • Get key count, nesting depth and byte size at the bottom of the editor.
  • Works offline once the page has loaded.
  • Companion tools: validator, minifier,JSON to CSV, escape and unescape.

How fast is it

I tested on a 2023 M2 MacBook Air with a 4.2 MB minified JSON file (one of the GitHub events archive files from gharchive.org). Cold paste-to-formatted output took roughly 380 ms; re-typing or pasting a new document of similar size took 220-260 ms because the JIT had warmed up. Files under a megabyte are instant. Anything multi-gigabyte should go through jq in a terminal — a browser tab is not the right tool for that.

The most common JSON formatting mistakes

Half the time someone reaches for a JSON formatter, the document won't parse. Here are the offenders that show up most often, in roughly the order you'll encounter them:

  1. Trailing commas. JavaScript and Python both forgive them. JSON does not. Strip the comma before any closing } or ].
  2. Single quotes around strings or keys. JSON requires double quotes. If your input came from a JavaScript console ({a: 'b'}) you have a JS literal, not JSON.
  3. Unquoted keys. Same root cause as above — paste from a JS object literal, expect a parse error.
  4. Comments. // like this or /* like this */ are not legal JSON. If you need comments in a config file, you have JSONC (used by VS Code) or JSON5, both of which need a special parser.
  5. Smart quotes. Curly and pasted from a word processor or a chat app look identical to straight quotes at a glance and break parsing instantly.
  6. Raw newlines inside strings. A string value cannot contain a literal newline. Use\n instead.
  7. Windows paths with single backslashes. "C:\Users\me" needs double backslashes: "C:\\Users\\me".

Reading deeply nested JSON without losing your mind

The stats line at the bottom of the editor is the underrated feature here. If you paste a document that you expect to be three levels deep and the depth reads as nine, something has gone wrong — usually an ORM or serializer has wrapped each value in an envelope object. I added the depth counter after the third time I'd been bitten by that. It saves me a few minutes a week.

For genuinely complex documents — Kubernetes manifests, OpenAPI schemas — I paste the formatter's output into VS Code, fold every top-level value with Cmd+K Cmd+1, and open one branch at a time. JSONNeat's job is to get you to that point quickly.

Privacy

Everything happens in your browser tab. The JSON you paste is never uploaded or logged. The only network requests this page makes are for static assets (HTML, CSS, JS, fonts) and the ad scripts in the side rail; none of them see what's inside the editor.

Frequently asked questions

What does a JSON formatter do?
A JSON formatter parses your JSON and re-emits it with consistent indentation, line breaks between values, and a space after every colon. The result is identical data, just laid out so a human can read the structure at a glance instead of squinting at a wall of text.
What is the difference between formatting, validating and minifying?
Formatting adds whitespace for readability. Minifying removes whitespace for size. Validating reports whether the document is parseable JSON without changing it. JSONNeat does all three in the same engine, so a successful format is also implicit proof that the JSON is valid.
Is JSONNeat free to use?
Yes. JSONNeat is 100% free, requires no signup, and all formatting happens locally in your browser — your JSON is never uploaded to a server.
Is my data safe?
Yes. The formatter runs entirely in your browser using JavaScript's built-in JSON.parse and JSON.stringify. Nothing is sent to our servers, logged, or stored. The same guarantee applies whether you paste a public schema or a production API response.
Can I format very large JSON files?
Yes — JSONNeat handles multi-megabyte JSON documents. Performance depends on your device, but most files under ~50 MB format instantly. For files over a few hundred MB, a streaming pretty-printer like jq is more appropriate because browser-based parsers load the full document into memory.
Why is two-space indentation the default?
Two spaces is the most common JSON style in package.json, tsconfig.json, ESLint and the npm ecosystem generally. It produces enough visual hierarchy to see nesting while staying compact enough to read deeply nested documents without horizontal scrolling. Four-space is also popular, especially in older Java and .NET code, and is available with one click.
How do I fix a JSON parsing error?
Common errors include trailing commas, unquoted keys, single quotes instead of double quotes, JavaScript-style comments, unescaped control characters in strings, and curly "smart" quotes pasted from a word processor. JSONNeat highlights the line and column of the first syntax error so you can fix it without scanning the whole document.
Does formatting change my data?
No semantic change. Numbers may be re-rendered in their shortest round-trip form (1.0 becomes 1, 1e2 becomes 100), but the parsed value is identical. Object key order is preserved. Duplicate keys are collapsed to the last value, per the JavaScript spec.
Can I sort keys alphabetically?
Not directly — JSONNeat preserves the original key order to avoid surprising diffs. For deterministic output, post-process with a tool like jq -S, or use a JSON stable-stringify library in your code.
Does this work offline?
Yes. Once the page has loaded once, the formatter, validator, minifier and converters all work without an internet connection because they run as plain JavaScript in your tab.
How does this compare to Prettier or VS Code's built-in formatter?
For a quick paste-and-go pretty-print they are equivalent. Prettier offers more configuration (line width, quote style, array wrapping) and integrates into your editor. JSONNeat is faster when you only need a one-off format on data from outside your project, or when you don't want to install anything.