JSON Formatter
Paste any JSON to format it into readable, indented text, minify it down to a single line, or validate it and get a clear explanation of any errors.
Everything you enter is processed in your browser and isn't sent to our servers.
How to use JSON Formatter
- 1Paste your JSON into the input box.
- 2Click Format to prettify it, or Minify to compress it to one line.
- 3If the JSON is invalid, a clear error message points to the problem.
- 4Copy the result to your clipboard with one click.
About this tool
JSON is the standard format for exchanging data between APIs, config files and applications, but it's easy to introduce a stray comma or missing bracket. This tool checks your JSON and reformats it however you need.
Formatting adds consistent indentation so nested objects and arrays are easy to read, while minifying strips all unnecessary whitespace to produce the smallest possible payload. Validation happens entirely client-side using your browser's native JSON parser.
Worked example: paste {"name":"Ana","tags":["a","b"],"active":true} and choose Format to print it over eight lines with two-space indentation. If the input has a trailing comma, as in {"name":"Ana",}, the tool reports the error instead of formatting, because strict JSON — unlike JavaScript — doesn't allow trailing commas, single-quoted strings or comments. Minify reverses formatting and produces the compact one-line form typically sent in API requests.
Frequently asked questions
The tool shows a plain-language description of the problem along with the line where the parser stopped, so you can find and fix the issue quickly.
Formatting adds line breaks and indentation for readability. Minifying removes all unnecessary whitespace to make the file as small as possible, which is useful for production APIs.
No. Parsing and formatting use your browser's built-in JSON engine, so your data never leaves the page.
Related tools
Diff Checker
Compare two texts and see line-by-line differences.
CSV to JSON Converter
Convert CSV data to JSON, with proper quoted-field handling.
JSON to CSV Converter
Convert a JSON array of objects to CSV, ready to download.
JWT Decoder
Decode a JWT's header and payload — no verification.
XML Formatter
Pretty-print or minify XML, with clear error messages.
Base64 Encode / Decode
Encode text to Base64 or decode Base64 back to text.