Format, validate and minify JSON online
A tool for formatting and minifying JSON data.
Supports JSON validation — syntax errors will be shown with a description of the problem.
You can paste JSON from API responses, configuration files, databases, and other sources.
The "Format" button adds indentation for easy reading, "Minify" removes all whitespace for compact representation.
Online JSON Formatter — Format, Validate, Tree View
JSON (JavaScript Object Notation) is a universal text-based data interchange format that has become the standard for REST APIs, configuration files, NoSQL databases, and microservices. Our formatter transforms minified strings into readable documents with indentation, validates syntax, and displays structure as a collapsible tree.
Tool Features
- Pretty Print — adds indentation (2/4 spaces or tabs) and line breaks for easy reading of nested structures
- Minification — strips all whitespace, reducing size by 30–60% for network transfer
- Validation — checks syntax and pinpoints the error line: unclosed brackets, trailing commas, wrong quotes
- Tree View — collapsible tree representation for navigating deeply nested objects
- Statistics — key count, nesting depth, file size
Data Format Comparison
| Parameter | JSON | XML | YAML |
|---|---|---|---|
| Readability | Good | Medium (verbose tags) | Excellent |
| Size | Compact | Large (+30–50%) | Compact |
| Data types | string, number, boolean, null, array, object | Everything is strings | Like JSON + dates, multiline |
| Comments | Not supported | Supported | Supported |
| Parsing | Native (JSON.parse) | Requires parser | Requires library |
| Use cases | APIs, configs, DBs | SOAP, RSS, SVG | Docker, K8s, CI/CD |
Common JSON Mistakes
- Trailing comma — comma after the last element:
{"a": 1,}. Forbidden in JSON. - Single quotes — JSON requires double quotes only.
- Unquoted keys — all keys must be in double quotes.
- Comments — JSON does not support comments.
- Unescaped special characters — newlines, tabs, and backslashes inside strings must be escaped.
Usage Examples
API debugging: paste an API response into the formatter to see the data structure and navigate via tree view.
Optimization: minify JSON before production deployment to reduce payload by 30–60%.
Configuration: validate package.json, tsconfig.json, or any config file before deploy.
Frequently Asked Questions
How is JSON different from a JavaScript object?
JSON is a text format with strict rules: double quotes only, no comments, no functions, no undefined. A JS object is more flexible and exists in memory, not as text.
What is the maximum JSON size the tool can handle?
Processing happens in your browser, so the limit is your RAM. Files up to 10–50 MB work without issues.
Is it safe to paste sensitive data?
Yes. All operations run locally in your browser. No data is sent to a server.
How to fix "Unexpected token" error?
The parser encountered an unexpected character. Usually a trailing comma, single quotes, or comments. The validator shows the error position.
For XML validation use the XML validator, for SQL — SQL formatter, for Base64 — Base64 encoder.
Useful articles
WCAG Color Contrast: Website Accessibility Guide
A complete guide to color contrast: WCAG 2.1 standards, AA and AAA levels, calculation formula, practical examples of good and bad contrast, and how to fix accessibility issues.
CSS Border Radius: Rounding Element Corners
How to use border-radius: syntax, shorthand notation, elliptical corners. Online border-radius generator.