JSON Parse / Formatter

Valid JSON

Drag file here, or click to select file

{
hello: "world"
}

Shortcuts: Ctrl+Shift+F Format · Ctrl+Shift+M Minify · Ctrl+S Download

  1. Paste or drag a JSON file into the dark editor on the left.
  2. 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.
  3. Use the 'Tree View / Formatted / Minify' buttons at the top to switch the output mode.
  4. Enter a JSONPath (e.g. $.store.book[0].title) in the tree view toolbar to quickly look up a field.
  5. On syntax errors, click 'Try Repair' to automatically fix common issues (trailing commas, single quotes, comments, etc.).
  6. Click 'Copy Result' or 'Download' to get the processed JSON.

Help

FAQ

What's the difference between JSON and JavaScript objects?Show
JSON is a data exchange format where keys must be wrapped in double quotes. JavaScript objects are data structures in the programming language where keys can omit quotes.
Why does my JSON fail to format?Show
Common reasons include: missing quotes, extra commas, mismatched brackets, using single quotes. The error banner shows the exact location, and you can click "Try Repair" to automatically fix trailing commas, single quotes, comments, and other common issues.
How do I validate if JSON is valid?Show
After pasting JSON, watch the status indicator at the top: a pulsing green dot means the JSON is valid, red means there is a syntax error, and the banner shows the error line and column.
What's the maximum JSON file size supported?Show
It's recommended to process JSON files no larger than 1MB. Larger files may affect browser performance.
What is JSON minification?Show
JSON minification removes all whitespace, newlines, and indentation to minimize JSON size, suitable for production environments. In Minify mode the tool shows the resulting size and percentage saved.
How do I look up a field in JSON?Show
Switch to Tree View, type a JSONPath (e.g. $.store.book[0].title) in the toolbar search box, then press Enter or click "Look up" to see the value above the tree and copy it.
What JSON formats are supported?Show
Standard JSON format is supported, including objects, arrays, strings, numbers, booleans, and null.

How to Use JSON Formatter

  1. Paste or drag a JSON file into the dark editor on the left.
  2. 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.
  3. Use the 'Tree View / Formatted / Minify' buttons at the top to switch the output mode.
  4. Enter a JSONPath (e.g. $.store.book[0].title) in the tree view toolbar to quickly look up a field.
  5. On syntax errors, click 'Try Repair' to automatically fix common issues (trailing commas, single quotes, comments, etc.).
  6. 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

JSON 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

JSON Format

Automatically format compressed JSON into readable indented format.

Error Detection & Repair

JSON Error Detection

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:

RuleCorrect ExampleWrong 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 SequenceMeaningUnicode
\"Double quoteU+0022
\\BackslashU+005C
\/Forward slashU+002F
\nNewlineU+000A
\rCarriage returnU+000D
\tTabU+0009
\uXXXXUnicode characterU+XXXX

Usage Tips

Keyboard Shortcuts

  • Ctrl+Shift+F - Switch to formatted view
  • Ctrl+Shift+M - Switch to minify mode
  • Ctrl+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 commas
  • Expected property name - Key format error
  • Unexpected 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