JSON Formatter

Format, validate and minify JSON, with the exact line and column of any error.

How to use JSON Formatter

  1. Paste your JSON into the input box (or click Load sample).
  2. Click Format to pretty print it, Minify to compress it, or Validate to just check it.
  3. Copy the result or download it as a .json file. Fix any error at the line and column shown.

About this tool

API responses and log files often arrive as one long line of JSON that is impossible to read. Paste it into this JSON formatter and it is pretty printed with clear indentation in an instant – choose 2 spaces, 4 spaces or tabs. Click Minify to do the reverse and strip every unnecessary space before sending JSON over the network.

It is a JSON beautifier and a JSON validator in one: it checks the syntax as it works. If the JSON is broken – a missing comma, a trailing comma, single quotes or an unclosed bracket – you get the error message with its line and column, and the cursor jumps to the problem. Optional key sorting puts every object's keys in A–Z order, which makes two JSON documents much easier to compare. A summary shows the size, number of keys and nesting depth. Your data is processed in your browser and never uploaded.

Frequently asked questions

It usually means a missing comma between items, a trailing comma after the last item, single quotes instead of double quotes, or an unquoted key. The JSON formatter shows the line and column – look just before that point.

Formatting (pretty printing) adds line breaks and indentation for people to read. Minifying removes all optional whitespace to make the file as small as possible for machines. The data is the same either way.

No. Values and their order are kept exactly, unless you tick "Sort keys A–Z", which only reorders object keys. Very large numbers beyond JavaScript precision may be rounded.

Yes. The JSON formatter runs entirely in your browser – nothing you paste is sent to our servers.