JSON Formatter & Validator

Paste JSON from an API response, config file or log and get it neatly indented – or squeezed onto one line. If something is wrong, you see what and where: line, column and a pointer to the character.

How to use JSON Formatter & Validator

  1. Paste your JSON into the input box. It is checked as you type.
  2. Choose “Format” with 2 spaces, 4 spaces or tabs, or “Minify” for the smallest output.
  3. If the JSON is invalid, read the message and press “Show in input” to jump to the problem.
  4. Optionally sort keys or switch to the tree view, then copy or download the result.

About this tool

The validator follows RFC 8259 strictly and explains the mistakes people actually make: trailing commas, single quotes, unquoted property names, comments, missing commas between items, leading zeros, and Python-style True/None values. JSON looks like JavaScript, but it is deliberately stricter: no comments, no trailing commas, and strings must use double quotes.

Unlike many formatters, this one never changes your values. Numbers are kept exactly as written, so a 20-digit ID such as 12345678901234567890 is not silently rounded to 12345678901234567000 (which is what JavaScript’s JSON.parse does, because it stores numbers as 64-bit floats). Escape sequences in strings are preserved too.

Sorting keys alphabetically makes two JSON documents easy to compare with the Text Diff tool, since the order of keys in an object carries no meaning in JSON.

Frequently asked questions

Is my JSON sent to a server?

No. Parsing and formatting happen in your browser, so it is safe to paste API responses that contain tokens or personal data.

Why are comments and trailing commas errors?

Standard JSON does not allow them. Formats such as JSON5 and JSONC do, but most JSON parsers – including those in web APIs – will reject them.

What does minify do?

It removes all spaces and line breaks that are not inside strings. The data is identical but smaller, which saves bandwidth when sending it over a network.

How large a file can I format?

Several megabytes format in well under a second. The tree view shows the first few thousand nodes; the text view always shows everything.

Is this tool really free?

Yes. There is no sign-up, no daily limit, no watermark and no paid tier. The site is supported by advertising shown on the page, not by charging for the tools.