How to use
- Paste your JSON text into the input box on the left.
- Click "Pretty" or "Minify" to convert it.
- Any syntax errors are shown immediately with their location.
๐ฏ Use Cases
- Debugging API responses โ turn a JSON response squashed onto one line into something readable so you can find the field you need
- Cleaning up config files โ reformat files like package.json or tsconfig.json for readability
- Optimizing transfer size โ remove unnecessary whitespace and line breaks with Minify to shrink API response size
- Validating hand-written JSON โ catch quote or comma mistakes instantly when typing config values or test fixtures by hand
Example
Input
{"name":"developk","tags":["json","tool"],"active":true}Output
{
"name": "developk",
"tags": [
"json",
"tool"
],
"active": true
}This is the result of applying "Pretty" to JSON squashed onto a single line. A 2-space indent is added so keys, values, and array items each sit on their own line.
Common JSON syntax errors
| Invalid | Why it fails | Valid |
|---|---|---|
{'name':'a'} | Single quotes aren't valid JSON syntax | {"name":"a"} |
{"a":1,} | Trailing comma after the last item | {"a":1} |
{a:1} | Key written without quotes | {"a":1} |
{"a":undefined} | undefined isn't a valid JSON value | {"a":null} |
{"a":01} | Leading zero before a number | {"a":1} |
JSON looks similar to a JavaScript object literal but is a stricter subset. Pasting code straight from JavaScript often triggers a syntax error for one of the reasons above.
FAQ
- Is the JSON I enter sent to a server?
- No. It's processed entirely in your browser using
JSON.parse/JSON.stringify. - Why do I see a "syntax error" message?
- If the text doesn't follow standard JSON syntax (single quotes aren't allowed, trailing commas aren't allowed, etc.), you'll be shown the error location. See the comparison table above for common patterns.
- What's the difference between Pretty and Minify?
- Pretty adds indentation to make the JSON easy for humans to read, while Minify removes unnecessary whitespace and line breaks to reduce file size. Most API responses sent over the wire are minified.
- Does this handle JSON with comments?
- No. Standard JSON doesn't support comments. Remove any
//or/* */comments before pasting your text in.
๐ Learn more: Using a JSON Formatter to Read API Responses
Turn minified JSON into something readable
More Coding Tools
๐๏ธ
Timestamp Converter
Convert Unix timestamp โ date
๐งฉ
JSON String Encoder
Convert text โ JSON string literal
โจ
JS/CSS Formatter
Indent & tidy JS/CSS code
โ๏ธ
JS/CSS Minifier
Strip comments & whitespace
๐งฝ
HTML Formatter
Indent HTML by tag structure
๐งน
XML Formatter
Indent XML by tag structure
๐๏ธ
SQL Formatter
Break SQL into clauses & indent
๐ฃ
HTML Entity Encoder
Convert special chars โ HTML entities
๐
Excel to HTML Table
Convert spreadsheet data to HTML TABLE
โ๏ธ
Link Extractor
Extract href/src links from HTML
๐จ
Color Picker
Get HEX, RGB & HSL color codes
๐
PHP Syntax Checker
Check bracket/string pairing (practical checker)
๐๏ธ
MySQL Syntax Checker
Check bracket/quote pairing (practical checker)
๐
HTML5 Validator
Check tag pairing, duplicate id, missing alt
โ๏ธ
Online HTML Editor
Write & edit HTML visually