JSON Formatter & Validator
Format, minify, and validate JSON entirely in your browser — nothing is uploaded, and values are never silently changed.
Your JSON is processed locally in your browser and is not uploaded.
Paste any JSON into the box above. Format rewrites it with readable indentation, Minify collapses it to a single line, and Validate checks it without changing anything. For example, formatting {"a":1,"b":[1,2]} produces the same data spread across multiple indented lines — the underlying values never change, only the text layout does.
This checks that your text is syntactically valid JSON (via the browser’s own JSON parser) — it does not validate against a JSON Schema or any external specification.
How to use the JSON Formatter & Validator
- Paste or type your JSON into the Input box.
- Click Format for indented output, Minify for a single line, or Validate to check it without changing the text.
- Read the Result message: green means valid, red shows the parser's error and where it occurred.
- Click Copy output to copy the box contents, or Clear to start over.
Example: Minifying, then catching a trailing comma
Input: {"name": "Tecuy", "tags": ["tools", "seo"]} spread over several lines. Click Minify and the box becomes {"name":"Tecuy","tags":["tools","seo"]} with the message "Valid JSON — minified." Changing the input to {"a":1,} and clicking Validate shows "Invalid JSON — Expected double-quoted property name in JSON at position 7 (line 1 column 8)" in Chrome.
Questions about the JSON Formatter & Validator
- How much does Format indent?
- Format always uses two spaces per level and puts each array item and object property on its own line. There is no option for tabs or a different width.
- Why does my JSON with comments, single quotes or trailing commas fail?
- The tool uses the strict JSON parser built into your browser, which rejects comments, single-quoted strings, unquoted keys and trailing commas. Remove them and validate again.
- Can formatting change any of my values?
- No. After the browser's strict parser confirms the JSON is valid, Format and Minify only change whitespace: numbers keep every digit (12345678901234567890 stays as written), 1.0 and 1e3 are not rewritten, \u escapes stay as typed, and duplicate keys are kept.
- What happens with duplicate keys?
- They are kept and reported. Formatting {"id":1,"id":2} keeps both lines and the message lists /id as a duplicate, because most parsers, including JavaScript's, keep only the last value.
- Why does the error message look different in another browser?
- The error text comes from the browser's own JSON parser, so Chrome, Firefox and Safari word it differently and may report the position differently.