Format or validate JSON
Paste JSON and pretty-print it with 2-space, 4-space, or tab indentation, or minify it to one line. Invalid JSON shows the parse error.
Drop your file here
or click to browse
How it works
Paste JSON and pretty-print it with 2-space, 4-space, or tab indentation, or minify it to one line. Invalid JSON shows the parse error.
The tool parses your input with JSON.parse and re-serializes with JSON.stringify at the indent style you choose: 2 spaces (default, used by most JSON conventions), 4 spaces (Python / older Java style), tabs (some legacy tools), or 0 (minify to a single line). Status line shows a green check for valid JSON with byte counts in and out, or a red X with the exact parse error (line and column) for invalid input. Useful for debugging API responses, sanity-checking a config file, or compacting JSON before pasting into a cell that can't handle multi-line content. Keys are not reordered, formatting is structure-preserving. Output is a copyable, downloadable .json file.
How to use it
- Paste your JSON. The status line shows a green check for valid input or the exact parse error with line and column.
- Pick an indent style. 2 spaces, 4 spaces, tabs, or minify to a single line.
- Copy or download. Grab the formatted output or download it as a .json file — key order is preserved.
Frequently asked questions
- Why does my JSON show as invalid?
- The status shows the parse error with location. Common causes: trailing commas (not allowed in standard JSON), single quotes (must be double), unquoted keys, unescaped backslashes.
- Can I sort keys?
- Not in this version. The output preserves the source order of keys.
- What's the difference between minify and format?
- Minify removes all whitespace (smallest possible). Format adds line breaks and indentation for readability.
- Is my JSON uploaded?
- No. Parsing and serializing happen in your browser.