JSON Formatter & Validator

Runs entirely in your browser
Input JSON
0 chars0 lines
T
ALL TOOLS · THE CATALOG
83 single-purpose utilities · runs local
Browse all →
All tools process files entirely in your browser · Your data never leaves your device

JSON Formatter — Free Online Pretty-Print & Minify

Format and validate JSON instantly. Pretty-print with 2/4/tab indent or minify to a single line, with color-coded syntax highlighting. Everything runs in your browser — your data stays local.

FreeNo sign-upRuns in your browserDeveloperApplication

The 6 JSON syntax errors that trip people up most

JSON looks like a JavaScript object literal but follows a stricter grammar (RFC 8259) — most "invalid JSON" reports are one of a handful of repeat offenders, usually from copy-pasting JS code or a trailing comma left over from editing.

ErrorInvalid exampleWhy it failsFix
Trailing comma{"a": 1, "b": 2,}JSON has no trailing commas, unlike modern JSRemove the comma before } or ]
Single quotes{'a': 1}JSON strings and keys must use double quotes onlyUse "a" not 'a'
Unquoted keys{a: 1}JS object shorthand is not valid JSONQuote every key: {"a": 1}
Comments{"a": 1 /* note */}JSON has no comment syntax at allDelete comments — JSON has no equivalent
NaN / undefined / Infinity{"a": NaN}These are JS values with no JSON equivalentUse null, or a sentinel string like "NaN"
Leading zeros{"a": 007}Numbers cannot have leading zerosWrite 7, or quote it as a string "007"

How to format and validate JSON online

  1. Paste your JSON. Paste raw JSON into the editor, or drag a .json file into the drop zone / click Upload File.
  2. Pick indent style. Choose 2 spaces, 4 spaces, or tab indentation for the Format / Prettify output.
  3. Format or minify. Click Format / Prettify for a readable, syntax-highlighted, indented view, or Minify for a single-line output ready for transmission.
  4. Copy or clear. Invalid JSON shows the exact parser error message in red. Copy the formatted output with one click, or Clear to start over.

Frequently Asked Questions

Is my JSON uploaded or logged?
No. Formatting and minifying run entirely in your browser. Nothing is sent to a server.
What is the maximum file size?
Up to ~10 MB performs smoothly. Larger files may slow the editor. For >50 MB consider a CLI tool like jq.
Does the output have syntax highlighting?
Yes. Formatted and minified output color-codes strings, numbers, booleans, null, and object keys so structure is easy to scan.
What happens if my JSON is invalid?
The tool shows the parser's exact error message so you can find and fix the problem quickly.
Can I upload a file instead of pasting?
Yes. Click Upload File or drag a .json/.txt file directly into the input area — its contents load into the editor.
Will it preserve number precision?
JavaScript number precision (53-bit) is preserved. For larger integers (BigInt), use a CLI tool.

Use Cases

Related tools

More free, in-browser tools from the Developer Tools set — every one runs locally, with no sign-up and no upload.

Browse all free online tools →