JSON Parse / Formatter
Valid JSON3 lines · 22 chars · 0.0 KBDrag file here, or click to select file
{hello: "world"}Shortcuts: Ctrl+Shift+F Format · Ctrl+Shift+M Minify · Ctrl+S Download
- Paste or drag a JSON file into the dark editor on the left.
- The status indicator at the top shows in real time whether the JSON is valid; errors appear in a red banner with the exact line and column.
- Use the 'Tree View / Formatted / Minify' buttons at the top to switch the output mode.
- Enter a JSONPath (e.g. $.store.book[0].title) in the tree view toolbar to quickly look up a field.
- On syntax errors, click 'Try Repair' to automatically fix common issues (trailing commas, single quotes, comments, etc.).
- Click 'Copy Result' or 'Download' to get the processed JSON.
Help
FAQ
What's the difference between JSON and JavaScript objects?ShowHide
Why does my JSON fail to format?ShowHide
How do I validate if JSON is valid?ShowHide
What's the maximum JSON file size supported?ShowHide
What is JSON minification?ShowHide
How do I look up a field in JSON?ShowHide
What JSON formats are supported?ShowHide
How to Use JSON Formatter
- Paste or drag a JSON file into the dark editor on the left.
- The status indicator at the top shows in real time whether the JSON is valid; errors appear in a red banner with the exact line and column.
- Use the 'Tree View / Formatted / Minify' buttons at the top to switch the output mode.
- Enter a JSONPath (e.g. $.store.book[0].title) in the tree view toolbar to quickly look up a field.
- On syntax errors, click 'Try Repair' to automatically fix common issues (trailing commas, single quotes, comments, etc.).
- Click 'Copy Result' or 'Download' to get the processed JSON.
Privacy Notice
Full guide
What Can This Tool Do?
This tool provides comprehensive JSON processing features:
- Format/Beautify: Convert compressed JSON to readable indented format
- Syntax Validation: Real-time detection with a status indicator plus an error banner showing line and column
- Tree View: Visualize JSON structure with expand/collapse support
- JSONPath Lookup: Quickly locate field values by path
- Smart Repair: One-click fixes for trailing commas, single quotes, comments, Python literals, and more
- Minify/Compress: Remove whitespace to reduce JSON size, with compression ratio displayed
Workbench Interface
The left side is a dark code editor (CodeMirror-based, with syntax highlighting, line numbers, and code folding). The right side shows the tree view, formatted text, or minified result depending on the top toggle. The top status bar shows JSON validity, line count, character count, and file size in real time.
Tree View

The right panel shows a collapsible JSON tree structure for browsing complex data. The toolbar offers "Expand All"/"Collapse Level 1", plus an embedded JSONPath lookup box — type a path to quickly locate a field.
Format View

Automatically format compressed JSON into readable indented format.
Error Detection & Repair

When JSON has syntax errors, a red error banner appears on the right showing the reason and the exact line/column, with a "Try Repair" button that automatically fixes common issues (trailing commas, single quotes, comments, None/True/False literals, unquoted keys).
Why Use JSON Formatting?
JSON formatting is useful in these scenarios:
- Debugging API Responses: Server JSON is usually compressed; formatting makes it readable
- Config File Editing: JSON config files need proper indentation for maintenance
- Data Inspection: Quickly locate JSON structure issues and syntax errors
- Code Development: Rapidly validate JSON data structures during development
JSON Syntax Rules
Valid JSON must follow these rules:
| Rule | Correct Example | Wrong Example |
|---|---|---|
| Keys must use double quotes | {"name": "John"} | {name: "John"} |
| Strings use double quotes | "Hello" | 'Hello' |
| Numbers without quotes | {"age": 25} | {"age": "25"} |
| Booleans are lowercase | {"active": true} | {"active": True} |
| No trailing commas | {"a": 1, "b": 2} | {"a": 1, "b": 2,} |
Common JSON Errors and Solutions
1. Using Single Quotes
// ❌ Wrong
{'name': 'John'}
// ✅ Correct
{"name": "John"}
2. Keys Without Quotes
// ❌ Wrong
{name: "John"}
// ✅ Correct
{"name": "John"}
3. Extra Trailing Comma
// ❌ Wrong
{
"items": [1, 2, 3,],
"count": 3,
}
// ✅ Correct
{
"items": [1, 2, 3],
"count": 3
}
4. Comments Not Supported
// ❌ JSON doesn't support comments
{
"name": "John" // username
}
// ✅ Use JSONC or remove comments
{
"name": "John"
}
JSON Escape Character Reference
| Escape Sequence | Meaning | Unicode |
|---|---|---|
\" | Double quote | U+0022 |
\\ | Backslash | U+005C |
\/ | Forward slash | U+002F |
\n | Newline | U+000A |
\r | Carriage return | U+000D |
\t | Tab | U+0009 |
\uXXXX | Unicode character | U+XXXX |
Usage Tips
Keyboard Shortcuts
Ctrl+Shift+F- Switch to formatted viewCtrl+Shift+M- Switch to minify modeCtrl+S- Download the current result as data.json
Quick Error Location
When JSON formatting fails, the error banner points to the problem location. Common error messages:
Unexpected token- Syntax error, check quotes and commasExpected property name- Key format errorUnexpected end of JSON- Incomplete JSON, check bracket matching
Smart Repair
When you hit a syntax error, click "Try Repair" and the tool will automatically attempt to:
- Remove trailing commas
- Convert single quotes to double quotes
- Strip comments
- Convert Python literals (None → null, True → true, False → false)
- Add quotes around unquoted keys
Large File Handling Tips
- For JSON over 500KB, use drag-and-drop upload instead of paste
- JSON over 1MB may cause browser lag
- Use minify function to reduce size before processing
Related Tools
- JSON Escape/Unescape - Dedicated JSON string escape handling
- JSON to CSV - Convert JSON data to tables
- JSON Compare - Compare differences between two JSON files