Free online JSON formatter and validator
JSON (JavaScript Object Notation) is a text format commonly used to exchange data between websites, applications and APIs. When JSON is compressed onto one line, nested objects can be difficult to inspect. This free JSON formatter makes valid JSON easier to read with indentation, or reduces it to a compact string with minification.
What this tool does
- Pretty print: adds indentation and line breaks to valid JSON.
- Minify: removes unnecessary whitespace while keeping the JSON data unchanged.
- Validate: attempts to parse your input and displays a syntax error if it is not valid JSON.
How to format JSON
- Copy your JSON data from a file, API response or code editor.
- Paste it into the Your text box.
- Choose Pretty print to format it or Minify to compact it.
- Click Run tool. If the input is valid, the formatted result appears below.
- Use Copy result to copy the output.
Example
Input JSON: {"name":"Asha","city":"Pune","active":true}
Pretty-printed output:
{
"name": "Asha",
"city": "Pune",
"active": true
}
Minified output: {"name":"Asha","city":"Pune","active":true}
Common JSON errors
- Use double quotes around property names and string values.
- Remove trailing commas after the final item in an object or array.
- Match every opening brace
{with a closing brace}, and every opening bracket[with]. - Use valid JSON values such as strings, numbers, booleans, arrays, objects or
null.
Frequently asked questions
Does formatting change my JSON data?
Pretty printing changes whitespace and indentation, not the represented values. Minifying also removes unnecessary whitespace. Always review important output before using it in production.
Can this tool fix invalid JSON automatically?
No. It reports a parsing error to help you locate a problem, but you must correct the input yourself.
Is my JSON uploaded?
Formatting and parsing happen in your browser. The JSON text is not sent to Tolvix for processing. Avoid pasting secrets into any website and review the Privacy Policy · Terms.
Explore related developer tools
Continue working with data using the JSON to CSV Converter, CSV to JSON Converter, Base64 Encoder & Decoder or URL Encoder & Decoder.