JSON Formatter

Format, validate, minify, copy, and download JSON in your browser without silently rounding large integer tokens or discarding duplicate object names.

How to Format and Validate JSON Online

1. Paste your JSON

Paste minified, unformatted, or broken JSON into the editor. It accepts valid JSON objects, arrays, strings, numbers, booleans, null values, and nested structures within your browser's available memory.

2. Format or validate

Choose spaces or a real tab, then click Format for readable indentation. Invalid input shows the browser's parsing message and adds line and column details when an error position is available.

3. Copy or minify

Copy the result, download it as a .json file, or minify it to remove insignificant whitespace. Whitespace inside strings and the original number tokens remain unchanged.

What This JSON Formatter Can Do

Lossless Formatting
Adds indentation around JSON tokens without parsing numbers into JavaScript Number values or rewriting string escapes.
Validate JSON
Detects syntax errors and shows the native browser parsing message, with a calculated location when available.
Minify JSON
Removes insignificant formatting whitespace while preserving whitespace inside strings and original number spellings.
Interoperability Checks
Preserves but warns about duplicate object names and integer tokens outside JavaScript’s exact safe range.
Error Detection
Shows the browser parsing message and calculates a line and column when the reported character position allows it.
No Installation Needed
Use this as an alternative to VS Code JSON formatter or Notepad++ JSON plugins — no extension or install required.

JSON Syntax Quick Reference

TypeExampleNotes
Object{"key": "value"}Keys must be double-quoted strings
Array["a", "b", "c"]Ordered list of values
String"hello world"Must use double quotes, not single
Number42 or 3.14Large or high-precision values may exceed a receiver’s exact numeric range
Booleantrue or falseLowercase only
NullnullLowercase only

Why token preservation matters

Large integers

RFC 8259 identifies integers from −(253−1) through 253−1 as the range where common binary64 implementations agree exactly. A formatter that parses and re-stringifies larger identifiers can silently change their digits. Mizakii formats the original number token instead.

Duplicate object names

RFC 8259 says object names should be unique because receivers disagree about duplicates. This tool preserves duplicates and shows a warning rather than silently keeping only the last value.

Primary references: RFC 8259 and the ECMAScript JSON specification.

FAQ

JSON Formatter