JSON

JSON Formatter & Validator

Pretty-print, minify, and validate JSON instantly — with the exact line and column of any syntax error.

Your JSON is processed locally in your browser. It is never uploaded to our servers.

1
Paste your JSON here, e.g. {"key": "value"}
Result
Formatted or minified output appears here

How to use

  1. Paste your JSON into the input box (or click Load sample to try it out).
  2. Click Format to pretty-print it with 2-space indentation, or Minify to strip all whitespace.
  3. Click Validate if you only want to check syntax without changing the text.
  4. If the JSON is invalid, the error message shows the exact line and column to fix.
  5. Use Copy to grab the formatted result.

What is JSON, and what does formatting do?

JSON (JavaScript Object Notation) is the most common data-interchange format on the web: APIs return it, config files use it, and databases store it. A JSON document is built from a small set of structures — objects { }, arrays [ ], strings, numbers, booleans, and null.

The syntax is strict: keys must be double-quoted strings, trailing commas are not allowed, and single quotes or unquoted identifiers make the document invalid. Formatting adds indentation and line breaks so humans can read it; minifying removes every unnecessary character so it takes less space on the wire. Neither changes the data itself — a formatter and a minifier produce semantically identical documents.

This tool parses your input with the browser's native JSON parser, so the validation rules match exactly what JavaScript runtimes accept. Since everything runs client-side, it is also safe for private data such as API responses, credentials files, or production configs.

Examples

Debugging an API response

Your API returns a compact one-line JSON blob. Paste it in, click Format, and the nested structure becomes readable in seconds.

Fixing a broken config file

Your app fails to start with a JSON parse error. Paste the config here — the validator reports the exact line and column of the missing comma or quote.

Preparing a request payload

Write a readable, indented payload, then Minify it before pasting into curl or a request body where whitespace should be minimal.

Diffing two versions

Format both versions with the same 2-space indentation first — line-based diff tools only give meaningful results on consistently formatted JSON.

Frequently Asked Questions

Is my JSON uploaded anywhere?+
No. Parsing and formatting happen entirely in your browser using JavaScript's built-in JSON parser. Nothing is sent over the network.
What's the difference between Format and Minify?+
Format adds indentation and newlines for readability. Minify removes all unnecessary whitespace to shrink the payload. The underlying data is identical either way.
Why does my JSON fail validation?+
The most common causes are trailing commas, single quotes instead of double quotes, unquoted keys, and comments — none of which standard JSON allows. The error message points you to the exact position.
Does it support JSON with comments (JSONC)?+
No. Comments are not part of the JSON specification. Strip // and /* */ comments before pasting, for example with a regex — our Regex Tester can help with that.
Is there a size limit?+
There is no hard limit — the only constraint is your browser's memory. Documents of several megabytes format without problems on a typical machine.
How do I validate a JWT's JSON payload?+
Decode the token first with our JWT Decoder & Analyzer — it shows the payload as formatted JSON and runs extra security checks on the claims.

Related Tools

Looking for something else? Browse all tools