JSON Formatter
?
About JSON formatting
- What makes JSON invalid?
- The most common culprits: trailing commas after the last item in an object or array, single quotes instead of double quotes, unquoted object keys, and comments — all allowed in a plain JavaScript object literal, none allowed in standard JSON.
- Why does the error message look different than in another tool or browser?
- JSON.parse's error reporting isn't standardized by the JSON spec — each JavaScript engine phrases it differently. Firefox and recent Chrome versions include a line and column directly in the message; older Chrome only gives a raw character offset ("position N"). This tool shows your browser's exact message, and computes a line/column from that offset itself when the message doesn't already include one.
- Does Format or Minify change my data?
- No — both just re-serialize the same parsed value with different whitespace. Object key order is preserved exactly as it appeared in the input (matching how JSON.parse and JSON.stringify already handle key order), and no values are altered, reordered, or dropped.
- Does this tool upload my data anywhere?
- No. Parsing and formatting happen entirely in your browser using the standard JSON.parse/JSON.stringify APIs. Nothing you paste ever leaves your device.
Pretty-print, minify, and validate JSON.
- input chars
- 0
- output chars
- 0
- status
- idle