JSON Formatter

Validate, pretty-print, minify, sort or repair JSON, with the exact line and column of any error.

Format, validate, minify and repair JSON online

JSON that comes out of a log, a web service response or a config file is often one long line, or almost valid but not quite. The JSON Formatter does the four jobs that come up every day: it validates the text and tells you the exact line and column of any mistake, pretty-prints it with 2 spaces, 4 spaces or tabs, minifies it for transmission, and optionally sorts the keys so two files can be compared by eye.

Paste the JSON or drop a .json file. When repair is on, the most common paste mistakes are fixed before validation: comments, trailing commas, single-quoted strings, unquoted keys, capitalised True, False and None, NaN and Infinity, a stray byte-order mark and Markdown code fences around the text. The result tells you when a repair was applied, so you know the input was not strict JSON. Nothing else is changed: numbers keep their precision, key order is preserved unless you ask for sorting, and Unicode is written as it is rather than escaped.

The formatted file is downloaded with a name that says what happened to it. The same validator runs inside every JSON tool on this site, so a file that passes here converts everywhere. For a structural comparison of two files use Compare JSON, and to move the data into a spreadsheet use JSON to Excel or JSON to CSV.

How to use the JSON Formatter tool

  1. Type or paste your JSON, or open a file.
  2. Set your options: Output, Sort keys alphabetically, Repair common mistakes (comments, trailing commas, single quotes).
  3. Click “Process JSON Formatter” and download your result.

Common questions

Is JSON Formatter free?

Yes. JSON Formatter is free for light use with no signup needed. Anonymous visitors get 10 free tasks per day, and creating a free account makes daily use unlimited. A paid Pro plan removes ads and raises file-size limits for heavier work.

Is my file safe?

Yes. Your file is sent over HTTPS, processed by self-hosted open-source software on our servers (no third-party AI or cloud APIs), and deleted within 60 minutes at the latest, usually right after your result is ready.

What file formats does JSON Formatter accept?

JSON Formatter accepts JSON, TXT files. Convert other formats to a supported one first; the related tools below can usually do it.

Related tools

Browse all 110+ free PDF, image, Markdown and JSON tools →