keptlocal
Files never leave your browser

JSON Formatter & Validator — Free, No Upload

Format, validate, and minify JSON free in your browser — no signup, nothing uploaded. Paste malformed JSON and get a readable, indented structure with clear error locations.

Paste JSON above and click Format.

How to format and validate JSON

  1. Paste your JSON into the input box — a full API response, a config file, or a single object.
  2. Choose an indent width (2 spaces, 4 spaces, or tabs) to match your project's style.
  3. Click Format & validate. Valid JSON is reprinted with consistent indentation; invalid JSON shows exactly where parsing failed.
  4. Need a compact version instead? Click Minify to strip all whitespace.
  5. Click Copy result to grab the output.

Formatting and validation both run through the browser's native JSON.parse and JSON.stringify — the same engine your code will use to consume the data. Nothing is uploaded.

Why JSON errors are hard to find by eye

A single missing comma, an extra trailing comma, or an unescaped quote inside a string can make an entire JSON document unparseable — and the failure is often several lines away from where the mistake actually is, because the parser doesn't know it's broken until it hits something that can't possibly follow. Scanning a 200-line minified API response by eye for a missing brace is slow and error-prone.

This tool surfaces the browser's native parse error along with a line and column number, so instead of scanning the whole document you can jump straight to the problem. The most common culprits, in order of frequency:

  • Trailing commas — {"a": 1, "b": 2,} — valid in JavaScript object literals, invalid in strict JSON.
  • Single quotes — JSON strings must use double quotes. {'key': 'value'} is not valid JSON, even though it's valid JavaScript.
  • Unquoted keys — {key: "value"} is JavaScript object shorthand, not JSON. Keys must be quoted strings.
  • Unescaped control characters or quotes inside strings — a literal " inside a string value needs to be escaped as \".
  • Comments — JSON has no comment syntax. // like this or /* like this */ will fail to parse, even though some JSON-adjacent formats (JSON5, JSONC) allow them.

Format vs. minify: when to use each

Formatted (indented) JSON is for humans — reading API responses during debugging, reviewing config files in a pull request, or writing documentation examples. The extra whitespace costs nothing when a human is going to read it once and move on.

Minified JSON is for machines and networks. Every space and newline is a byte that has to be transmitted and parsed; stripping them shrinks payload size, which matters at scale — a public API serving millions of requests a day saves real bandwidth by minifying responses. It also shows up as the default output of most JSON.stringify() calls with no arguments, and as what you'll see in browser network tabs and log files. Minify here to see exactly what a compact payload will look like, or to shrink a formatted file back down before pasting it somewhere space-constrained (an environment variable, a URL parameter, a database column with a size limit).

JSON vs. JSON5 vs. JSONC

Strict JSON (RFC 8259) — what this tool validates — is deliberately minimal: it has no comments, no trailing commas, no unquoted keys, and no single-quoted strings. That minimalism is a feature: it's what makes JSON parseable identically in every language with almost no ambiguity, which is why it won as the universal data-interchange format.

Some tools accept relaxed variants — JSON5 adds comments, trailing commas, and unquoted keys for hand-written config files; JSONC (JSON with Comments) is what VS Code uses for its own settings files. If your input is one of these relaxed formats rather than strict JSON, this tool will correctly flag it as invalid — because it isn't valid JSON, even if a specific tool happens to accept it.

Privacy: what happens to your data

JSON often contains sensitive data — API keys, auth tokens, customer records, internal config. This tool never sends what you paste anywhere; parsing and formatting happen with browser-native functions, locally, in the tab. Open DevTools → Network while using it and you'll see no requests fire. Nothing is logged, cached remotely, or stored beyond your current browser session.

Frequently asked questions

Is my JSON data sent anywhere?
No. Formatting and validation run entirely in your browser using the native JSON.parse and JSON.stringify functions. Nothing is uploaded, logged, or sent to a server — this matters if your JSON contains API keys, tokens, or customer data.
What happens if my JSON is invalid?
The tool shows the specific parse error, including the line and character position where parsing failed, so you can find and fix the problem instead of guessing.
What's the difference between format and minify?
Format (beautify) adds indentation and line breaks for readability — use it while debugging. Minify strips all unnecessary whitespace to produce the smallest possible payload — use it before sending JSON over a network.
Can it handle large JSON files?
Yes, into the tens of megabytes — the practical limit is your browser tab's available memory, not the tool itself. Very large files (100MB+) may briefly freeze the tab while parsing.
Does it support JSON5 or comments?
No, this tool validates strict JSON (RFC 8259) — the format most APIs and config files actually require. JSON does not support comments or trailing commas; if your input has them, the validator will flag them as errors.