Development
JSON Formatter & Validator
Validate JSON syntax, format with two-space indentation, or minify an API response. Copy or download the result, with examples and fixes for malformed JSON.
About this tool
When to use it
Validate JSON syntax, format with two-space indentation, or minify an API response. Copy or download the result, with examples and fixes for malformed JSON.
How to use it
When an API response arrives as one long line, paste it or upload a .json or .txt file, then select Format JSON. Inspect the values before copying or downloading formatted.json. Use Minify for a compact fixture, or compare the response with an earlier version in JSON Diff.
Guide updated . Examples checked against this implementation.
Worked examples
Format an API response
Input
{"project":"DevMate","tools":8}Expected output
{
"project": "DevMate",
"tools": 8
}Format JSON uses two spaces. Minify produces the original one-line example. A successful result establishes JSON syntax only; it does not check your API schema.
Errors and unsupported input
{"tools":8,}Remove the comma before the closing brace, then run Format JSON again. JSON also requires double-quoted keys and excludes comments and undefined.
{"tools":The value and closing brace are missing. Copy the complete response body, without HTTP headers or Markdown code fences, and retry.
Continue this workflow
- JSON Diff: Compare this response with a previous response to inspect value and type changes.
- JSON to CSV Converter: Convert an array of records to CSV when you need a spreadsheet view.
Format references
Questions
Frequently asked questions
Does formatting preserve every character and number?
No. It parses and serializes JSON. Whitespace changes, duplicate keys collapse and large numbers may round. Keep the original when exact numeric precision or byte identity matters.
Why can valid JSON still fail in my application?
Syntax validation does not establish required fields, allowed values or business rules. Validate against the receiving application schema separately.