LOCAL TOOL · DEV

JSON Formatter & Validator

Format, validate and minify JSON without uploading it — your data stays in your browser.

How to use

  1. Paste your JSON into the input box.
  2. Click Format to pretty-print it (choose 2 spaces, 4 spaces or tabs), Minify to compress it, or Validate to check it.
  3. If the JSON is invalid, the error is shown with its line and column so you can fix it quickly.

Examples

Debug an API response

Paste a one-line API response and click Format — nested objects and arrays become readable with proper indentation.

Shrink a config file

Click Minify to remove all whitespace: {"a": 1, "b": 2} becomes {"a":1,"b":2}, ready to embed or transmit.

Reading an API response

A response returned as one long line becomes readable once indented, and the structure — which fields are nested inside which — is what you usually needed to see. Formatting first and reading second is faster than scanning a minified payload for a closing brace.

Finding the exact position of a syntax error

A parser that reports an error at character 4,210 is describing a spot you cannot find by eye in a single-line document. Formatting turns that offset into a line you can look at, and the actual mistake is almost always a trailing comma, a single quote, or an unescaped quote inside a string.

Preparing JSON for a commit

Configuration files that live in version control are much easier to review when consistently indented, because a diff then shows the changed value rather than the whole reformatted line. Formatting before committing keeps later reviews focused on what actually changed.

FAQ

Is my JSON uploaded to a server?

No. Parsing, formatting and validation run entirely in your browser using the built-in JSON engine. Your data never leaves your device.

What JSON errors can it detect?

Anything the strict JSON specification rejects: trailing commas, single quotes, unquoted keys, comments, and truncated documents. The error message includes the line and column where parsing failed.

Does formatting change my data?

Formatting only changes whitespace and key ordering is preserved as-is. Note that like all standard JSON tools, duplicate keys are collapsed to the last value and very large numbers are limited by JavaScript number precision.

Why is JSON with comments rejected?

Comments are not part of the JSON standard. Formats like JSONC (used by some editors and config files) allow them, but a strict validator must reject them.

How large can the JSON be?

The practical limit is your browser’s memory — documents of several megabytes format fine on a typical device.

Why is my single-quoted JSON rejected?

Because JSON requires double quotes for both keys and string values. Single quotes are valid JavaScript object syntax but not valid JSON, which is the single most common reason a snippet copied out of code fails to parse. The same applies to unquoted keys.

What is a trailing comma and why does it break parsing?

A comma after the last item in an object or array — valid in modern JavaScript, invalid in JSON. Editors that reformat code often add them silently. If a file parses in your editor but fails in a strict parser, a trailing comma is the first thing to look for.

Does formatting change numbers or key order?

Key order is preserved as written, and values are not recalculated. Very large integers are the one thing to watch: JSON has no integer type distinct from floating point, so a value beyond the safe integer range can lose precision when parsed by any tool, not just this one. Keep such identifiers as strings.