How to use

  1. Paste your JSON into the input panel.
  2. Choose Format (pretty-print), Minify or Validate.
  3. If the JSON is invalid, jump to the reported line and column to fix it.
  4. Copy the cleaned-up result.

JSON's grammar is small enough to fit on a business card, and almost every parse error comes from one of six violations of it. Trailing commas ({"a": 1,}) are legal in JavaScript objects but not JSON. Single quotes are not valid string delimiters. Keys must be quoted. Comments do not exist in JSON at all, a surprise to anyone coming from JSONC files in VS Code. NaN and Infinity are not valid tokens even though JavaScript will happily produce them. And unescaped control characters (a literal newline inside a string) break parsing in ways that are invisible on screen.

A validator that reports line and column turns each of these from a hunting expedition into a ten-second fix, which is the main job of this tool. Formatting is the second job: machine-generated JSON often arrives as a single line, and 2-space indentation makes a 400-line API response navigable. Minifying reverses that for production, whitespace stripped, semantics identical.

Two deeper gotchas worth knowing. JSON numbers have no precision limit in the spec, but JavaScript parses them as 64-bit floats, so an ID like 9007199254740993 silently loses precision when round-tripped through a browser, transmit large IDs as strings. And duplicate keys are technically permitted by the grammar but handled inconsistently: most parsers keep the last occurrence, some the first, so treat duplicates as a bug. Velona formats your document server-side and retains nothing for anonymous users.

Examples

Pretty-print
Input:  {"name":"Velona","tools":41,"free":true}
Output: {
  "name": "Velona",
  "tools": 41,
  "free": true
}
Minify
Input:  {
  "a": 1,
  "b": [1, 2, 3]
}
Output: {"a":1,"b":[1,2,3]}
Catch an error
Input:  {"a": 1,}
Output: Invalid JSON: trailing comma before } at line 1, column 9

Frequently asked questions

Why is my JSON invalid when it works in JavaScript?

JavaScript object literals accept single quotes, unquoted keys, trailing commas and comments, JSON accepts none of these. JSON is a stricter subset, and eval-style leniency in a browser console hides the difference.

Can JSON contain comments?

No, the specification has no comment syntax. Some tools support JSONC (JSON with comments) for config files, but any standard parser will reject //. Common workarounds are a "_comment" key or keeping notes in the consuming code.

Does formatting change my data?

No, formatting and minifying only alter whitespace between tokens. Key order, values and string contents are untouched. Note that key order is preserved by this tool but is not guaranteed to be meaningful by the JSON spec itself.

Why did my 19-digit ID change after parsing?

JavaScript stores JSON numbers as double-precision floats, exact only up to 2^53 - 1 (9007199254740991). Larger integers get rounded. APIs avoid this by sending big IDs as strings, Twitter's API famously ships both id and id_str.

Related tools

Free forever, built by Velona

Velona is India's INR-native AI API gateway with 300+ models, UPI top-up from ₹10, no foreign card needed. These tools are free forever.