JSON Formatter

Validate, pretty-print, minify and sort JSON

Waiting for input.

JSON Formatter: Validate, pretty-print, minify and sort JSON. Input: Text you type or paste, JSON, PLAIN files and values you enter. Output: Results shown on the page, a downloaded JSON file and text to copy. Privacy: Runs in your browser: inputs and files stay on your device and are not uploaded.

How to format JSON online

  1. Paste or type your JSON into the editor above.
  2. Click Format to pretty-print it with 2 spaces, 4 spaces or tabs, or Minify to strip all whitespace.
  3. Use Sort keys to order object keys alphabetically, which makes two JSON documents easy to compare, or Repair to fix broken JSON: trailing commas, single quotes, unquoted keys, comments, Python-style True/False/None and missing closing brackets.
  4. Copy the result or download it as a .json file.

Validation runs as you type. If the JSON is invalid, the formatter tells you the error and the exact line and column, and puts the cursor on the problem character. Common causes are trailing commas, single quotes instead of double quotes, and unquoted keys.

Is my data private?

Yes. This JSON formatter is written in plain JavaScript and runs entirely in your browser. Your JSON is never uploaded to a server, which makes it safe to use with API responses, config files and other sensitive data. Your last input is kept in your browser's local storage so it is still there when you come back.

What is the difference between formatting and minifying JSON?

Formatting (beautifying) adds line breaks and indentation so JSON is easy to read. Minifying removes all unnecessary whitespace so the file is as small as possible for sending over a network.

Why does my JSON say "Unexpected token"?

The parser found a character it did not expect. Check the reported line and column for a trailing comma, a missing quote, a single-quoted string or a comment, as none of these are allowed in standard JSON.

Can it handle large JSON files?

Yes. Use Open file for big files. Anything over 512 KB is parsed and formatted in a background thread, so the page stays responsive, and files of 50 MB and more work. Results over 8 MB are previewed (the first 1 MB) while Copy and Download use the whole document. Formatting keeps numbers exactly as written, including very large integers that JavaScript would round.

Made by BufferMint. We also design and build software products for founders. See our services →

Runs in your browser. Your files are not uploaded. We count anonymous visits, without cookies.