Play n Tools

Free tools & games for everyone

Free · No sign-up · No accounts

JSON formatter

Check, tidy and shrink JSON in your browser. Errors are shown with the exact line and column; keys can be sorted. Nothing is uploaded.

How to use

  1. Paste JSON into the top box, or open a .json file (it is read on your device, not uploaded).
  2. Format makes it readable with indents; Minify removes all spaces; Check only just tells you if it is valid.
  3. If something is wrong, you see what and where (line and column), and the cursor jumps to that spot.
  4. Tick Sort keys to put every object's keys in A–Z order, handy for comparing two files.

Keyboard and touch

Ctrl+Enter in the inputFormat
Ctrl+A, Ctrl+C in the resultSelect and copy
TabLeave a text box and move to the buttons

Tips

  • The most common mistakes: a comma after the last item, single quotes instead of double quotes, and comments. JSON allows none of them.
  • Keys must always be in double quotes: {"age": 7}, not {age: 7}.
  • Very big numbers (more than about 15 digits) can lose precision in any JavaScript tool; store long IDs as text.
  • If two keys in one object have the same name, the last one wins, as in browsers.

About this tool

The text is checked by our own strict reader that follows the JSON standard (RFC 8259), so the error message can say exactly what went wrong and where. The formatted result is written by your browser's built-in JSON writer. Files up to 5 MB are handled; everything stays in this page and nothing is uploaded, saved or logged.

See you tomorrow!

A fresh daily puzzle every morning, and new tools added every month.

Browse every product