JSON Formatter
Make JSON easier to read or compact it without changing its data representation.
JSON editor
Paste or enter JSON, then choose an action.
Share
What does the JSON Formatter do?
It validates JSON syntax and converts valid data into an indented format for reading or a compact format without unnecessary whitespace. Use it to inspect API responses and clean up configuration files.
How to use it
- 1
Enter JSON
Paste JSON into the input. Object keys and strings must use double quotes.
- 2
Format or minify
Format applies two-space indentation. Minify removes unnecessary whitespace outside strings.
- 3
Review the result
Inspect nested data in Tree view, or copy the result from Edit view.
Format and minify example
Both results contain the same data; only their whitespace differs.
Formatted JSON
{
"name": "Konly",
"active": true
}Minified JSON
{"name":"Konly","active":true}Syntax and limitations
Check these common causes when parsing fails.
Quotes around keys and strings
JSON requires double quotes. {'name':'Kim'} is a JavaScript-style object, not valid JSON.
Trailing commas
A comma cannot follow the final item in an object or array.
Comments and special values
Standard JSON does not support comments, NaN, Infinity, or undefined.
Large documents
Very large JSON documents can use significant browser memory and slow down Tree view.
Your JSON is processed in the browser
Formatting, minification, and tree conversion run in your current browser. The input is not sent to or stored on this site's server.
Frequently asked questions
Do Format and Minify change data values?
No. For valid JSON, object and array values remain unchanged; only whitespace outside strings is changed.
Can I paste a JavaScript object directly?
JavaScript syntax using unquoted keys or single-quoted strings is not JSON. Convert it to standard JSON first.
What does the error position mean?
It is where the browser stopped parsing. Check nearby quotes, commas, braces, and brackets.
Related developer tools
SQL Formatter
Format SQL queries in your browser with MySQL, PostgreSQL, SQL Server, Oracle, and SQLite syntax in mind.
Open toolBase64 Encoder/Decoder
Choose a character encoding to convert between text and Base64.
Open toolURL Encoder/Decoder
Convert a full URL or component with UTF-8 percent encoding.
Open tool