Emergency server help: get in touch

JSON Formatter and Validator

Pretty-print, minify and validate JSON with exact error positions, right in your browser.

Where it runs
Runs in your browser
Last updated
October 9, 2026

Paste JSON or open a file in this JSON formatter to check it and make it readable. The formatter shows the exact line and column of any syntax error, pretty-prints with 2 spaces, 4 spaces or tabs, minifies, and can sort keys. It works on files up to 5 MB and runs entirely in your browser, so nothing you paste is uploaded.

Loading the tool… It runs in your browser and needs JavaScript.

How to use the JSON formatter

Paste JSON into the box or open a .json file. Results update as you type for inputs up to 1 MB; for larger files press Format. Choose Pretty-print or Minify, pick the indent, and tick Sort keys A to Z if you want a stable key order (useful before comparing two files with a diff tool). The tiles show the size before and after, so you can see how much minifying saves.

Unlike many formatters, this one does not run your data through JSON.parse and back. It keeps every number and string exactly as written, so 1.50 stays 1.50, escapes such as \u00e9 are not rewritten, and a 20-digit ID is not rounded.

Common JSON errors and how to fix them

When the input is not valid, the tool names the problem and points at it with a caret. The usual causes are:

  • Trailing comma after the last item, as in [1, 2,]. JSON does not allow it.
  • Single quotes around strings or keys. JSON needs double quotes.
  • Unquoted keys such as {name: "x"}, copied from JavaScript code.
  • Comments (// or /* */). Strict JSON has none; remove them or use a format that allows them.
  • Python values True, False and None instead of true, false and null.
  • Raw line breaks or tabs inside a string. Write them as \n and \t.
  • Leading zeros such as 007. Quote the value if it is really a code, not a number.

Duplicate keys and very large numbers

RFC 8259 says the names within an object SHOULD be unique, but parsers disagree about what to do when they are not: most keep the last value, some keep the first, some fail. The formatter accepts duplicates but warns you with the line and column so you can decide which one is meant.

Most JSON parsers store numbers as IEEE 754 double-precision values, which hold integers exactly only up to 9,007,199,254,740,991. Larger IDs, for example 64-bit database keys, get silently rounded. The formatter flags such numbers. If they must survive other tools, send them as strings.

For server admins: the same jobs on the command line

On a server, jq and Python cover the same ground. These are handy in scripts and for checking config files before a reload:

jq . config.json                 # pretty-print
jq -c . config.json              # minify to one line
jq -S . config.json              # sort keys
jq empty config.json && echo OK  # validate only (exit code 0 if valid)
python3 -m json.tool --sort-keys config.json

Unlike this page, jq converts numbers to doubles, so very large integers may change. Run a quick check here when exact values matter.

JSON Formatter at a glance

JSON Formatter – short answer
In short: Pretty-print, minify and validate JSON with exact error positions, right in your browser.
JSON Formatter – what this tool covers
JSON Formatter: what this tool covers.
JSON Formatter – questions answered
JSON Formatter: the questions this tool answers.

Related tools: JSON to YAML Converter (and YAML to JSON) · JSON to CSV Converter (and CSV to JSON) · JWT Decoder and Verifier · curl Command Converter.

Official documentation (checked 9 October 2026): RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format · JSON.parse() – JavaScript | MDN

Frequently asked questions

Is my JSON uploaded anywhere?

No. Parsing and formatting happen in your browser with JavaScript, and nothing is sent to a server.

Why does my JSON fail with “Trailing comma”?

JSON does not allow a comma after the last item in an object or array. Delete that comma and the error goes away.

What is the size limit?

Up to 5 MB. Results update live up to 1 MB; for bigger inputs press Format. For larger files use jq on the server.

Share this tool

Free website test

Is your website set up right?

Check SSL, security headers, redirects, robots.txt, sitemap, llms.txt and security.txt in one test. It takes about 30 seconds.