piapia123
en

JSON Formatter & Validator

Formatting

Everything runs locally in your browser — nothing is uploaded

Input
Output

Expand minified JSON into a readable structure, or strip it back down to a single line. When the syntax is broken you get the exact line and column plus a caret under the offending character, so you no longer have to count brackets by hand. Recursive key sorting makes two exports of the same data diffable.

Features

  • Format with 2-space, 4-space or tab indentation
  • Minify to remove all whitespace for request bodies or storage
  • Validate with the error pinpointed to an exact line and column
  • Sort keys recursively, leaving array order untouched
  • Large documents are handled without freezing the page

How to use

  1. Paste your JSON into the input box
  2. Pick the mode, indentation and other options
  3. Press Ctrl/⌘ + Enter, or click Run
  4. Click Copy to take the result

FAQ

Is my JSON uploaded anywhere?
No. Parsing and formatting happen entirely in your browser memory. The page makes no network requests and keeps working offline.
Why do I get "unexpected character after number"?
JSON has a stricter number grammar than JavaScript: it rejects +1, .5, 01, 1. and Infinity / NaN. Convert those to valid JSON numbers first.
Does sorting keys affect arrays?
No. Array order carries meaning and sorting would destroy it, so only object keys are sorted. Arrays are always left exactly as they were.
How large a document can it handle?
Several megabytes is fine. Past the input limit you get a clear message instead of an unresponsive page.

Related tools