Skip to content

JSON Formatter & Validator

Pretty-print, minify and validate JSON, with clear error messages that point to the line and column.

Runs in your browser

Paste JSON, then choose Format. Shortcut: Ctrl + Enter (⌘ + Enter on a Mac).

How to use the JSON formatter

  1. Paste your JSON into the box, or choose Load example.
  2. Choose Format to indent it, Minify to remove every space and line break outside strings, or Validate only to check it without changing anything.
  3. Copy the result or download it as a .json file. Pick 2 spaces, 4 spaces or tabs, and turn on Sort keys to order every object’s keys alphabetically.

What counts as valid JSON

This tool follows the JSON standard (RFC 8259) strictly, as APIs and most parsers do. Valid JSON has exactly one top-level value; strings and property names use double quotes; true, false and null are lower case; and there are no comments or trailing commas. Formats such as JSON5 and JSONC (used by some editor configuration files) allow comments and trailing commas, so they are reported as errors here.

When something is wrong, the message says what was expected and where: the line and column, with a marker under the problem. Show the error in the input moves your cursor to it. Duplicate keys are valid JSON but are flagged, because most parsers silently keep only the last one.

Exact numbers

Numbers are printed exactly as you wrote them. Many tools reformat JSON with JavaScript’s JSON.parse, which rounds integers larger than 9,007,199,254,740,991 (253 − 1) and turns 1.0 into 1. That matters for 64-bit IDs and for amounts where the trailing zero is meaningful.

Your data stays in your browser

Formatting and validation happen on your device. The JSON you paste is not uploaded, stored or logged, and it is never run as code. Very large documents (up to 20 MB) work, but may take a moment on older phones.