toolo.dev

JSON Formatter & Validator

Format, validate and minify JSON online. See errors by line and column, browse a tree view, and keep big numbers and duplicate keys exactly as written.

After you click or type in the editor, the Tab key indents. Press Escape, then Tab, to move to the next field.
Paste JSON on the left, or load the sample, to format and validate it.

About the JSON Formatter

Paste JSON into this JSON formatter to pretty-print it, minify it or check that it's valid. If it's broken, you get the line and column of the problem. Big numbers like 12345678901234567890 and duplicate keys stay exactly as you wrote them, because the formatter re-indents your text and never rebuilds it from parsed values.

APIs, log shippers and build tools usually write JSON on one long line, which suits a program and not a person. Formatting adds line breaks and indentation, so you can see where an object ends or spot the field that's missing from a response. Minify goes the other way, for a request body or an environment variable. Both run in your browser.

  1. Paste your JSON into Input JSON, or click Load sample to try a product record that contains 9007199254740993 and 59.90. The output refreshes about a quarter of a second after you stop typing.
  2. Check the label above the output. Good input shows Valid JSON and the output size, for example Valid JSON · 206 B. Broken input shows an Invalid JSON box under the editor with the message, the line and column, and the line itself with a ^ under the problem. The line number in the editor turns red as well.
  3. Pick Format or Minify. Format uses the Indent menu (2 spaces, 4 spaces or Tab); the menu is grayed out while Minify is on.
  4. Turn on Sort keys only when you need keys in A to Z order, for example to compare two responses. A note under the switch counts any integers it will round.
  5. In Code View, click Copy, or Download .json to save formatted.json (minified.json when Minify is on). Output longer than 200,000 characters is shown without colors so the page stays responsive.
  6. Open Tree View to browse the structure. Each object and array shows how many keys or items it holds; click one to open or close it, or use Expand all and Collapse all. Levels with more than 500 entries show the first 500 and a Show all link.
  7. Inside Input JSON, the Tab key indents the selected lines and Shift+Tab removes one level. Press Escape first when you want Tab to move to the next control. Clear empties the editor.