JSON Parser / Formatter
Free online JSON parser. Validate, pretty-print, and minify JSON in real time with syntax highlighting and error location. 100% client-side.
Paste JSON on the left to see the formatted result hereYou might also like
😄 Free thanks to ads
Online JSON Parser & Formatter
JSON (JavaScript Object Notation) is the most common data exchange format. A JSON parser validates your JSON, pretty-prints it with indentation, and highlights syntax so you can spot errors instantly.
Features
- Real-time validation with 150ms debounce as you type
- Collapsible tree view — explore nested objects/arrays with
+/−toggles - Format / Minify — 2-space, 4-space, or tab indentation, or strip whitespace
- Error location — shows "line N, col M" for parse failures
- Lenient mode auto-recovery — fixes unescaped control characters, wrap-split tokens, trailing commas, and comments
- Recovery highlight — auto-recovered values get a 🟥 red outline so you can spot what changed
- Syntax highlighting — keys, strings, numbers, booleans, null colored distinctly
- Copy / Download — copy formatted output or save as
.jsonfile
Lenient mode — auto-recovery for broken JSON
JSON copied from chat apps, email clients, or terminals often contains accidental line breaks that break JSON.parse. This tool auto-recovers 4 common cases:
- Control chars inside strings (
\n,\t) → replaced with spaces - Line breaks inside tokens (e.g.
847\n521,fal\nse) → rejoined - Trailing commas → removed
- Comments (
//,/* */) → stripped (URLs preserved)
When recovery applies, a yellow warning banner appears and recovered values are outlined in red.
Privacy: 100% client-side
Your JSON is never sent to any server. All parsing happens in your browser. Safe for JSON containing API keys, passwords, or sensitive customer data.
Common parse errors
- Unexpected token: missing quotes around keys, or missing comma/colon
- Unexpected end of input: unclosed
{}or[] - Trailing comma after the last item — not allowed in strict JSON
- Single quotes — JSON requires double quotes for strings
JSON syntax cheatsheet
- Keys must be strings wrapped in double quotes
- Values: string, number, boolean (true/false), null, object
{}, array[] - No comments (
//or/* */) in strict JSON
More iTool Features!
Character Counter
Free online character counter — count characters, words, sentences, and bytes in real time. No install, no signup.
YAML ↔ JSON ↔ TOML Converter
Live 3-way converter between YAML, JSON, and TOML. Smart schema detection for Kubernetes, Docker Compose, GitHub Actions, plus YAML pitfall warnings (Norway problem, octal, sexagesimal). 100% browser-based.
XML Parser / Formatter
Free online XML parser with real-time validation, collapsible tree view (+/-), pretty print, and syntax highlighting for elements, attributes, text, and CDATA. 100% browser-based.
JSON ↔ XML Converter
Live 2-way converter between JSON and XML. Configurable attribute prefix and text node key. 100% browser-based, no upload.
Text Diff
Free online text diff tool — compare two texts side by side and spot every difference instantly. No install, no signup.