$ json --format
JSON Formatter and Validator Online
Format, validate, minify and repair JSON with clearly explained errors — and convert to CSV and YAML without leaving your browser.
- 100% in your browser
- free
- no sign-up
How to use the JSON formatter
Paste your JSON into the Input area, choose the indentation (2 spaces, 4 spaces or tab) and click Format. The result appears in the Output area, ready to copy or download. To validate JSON before using it in an API or configuration file, use the Validate button: if there is any syntax problem, the tool shows the error message in plain language, with the exact line and column and a code excerpt pointing to where the defect is.
That is the big differentiator of this formatter compared to other tools: instead of repeating the cryptic error from the JavaScript engine (like "Unexpected token"), it translates and explains what happened — single quotes where double quotes were expected, a trailing comma before closing a block, an unclosed string — and also offers the Repair button, which automatically fixes the most common defects and lists what was changed.
JSON converter: CSV and YAML in the same tool
Beyond formatting JSON, the tool works as a complete JSON converter. With one click you turn JSON to CSV — perfect for opening API data in Excel or Google Sheets — as long as the JSON is a list of objects. You can also convert JSON to YAML (useful for docker-compose, Kubernetes and CI/CD pipelines) and go the other way, from YAML to JSON, with validation and equally clear error messages.
Common use cases
- Debug API responses: paste the response body, format it and read the structure with syntax highlighting, in light or dark theme.
- Fix broken JSON from logs or LLMs: language model outputs and truncated logs frequently come with trailing commas or wrong quotes — the Repair button solves it on the spot.
- Prepare data for spreadsheets: convert an API response to CSV and download the file ready for analysis.
- Reduce payloads: minify the JSON before embedding it in a request or environment variable and see how many characters were saved.
Privacy first
Unlike many online formatters, here nothing is sent to any server: all processing happens in your browser. You can paste tokens, customer data or internal configurations with peace of mind — the character, line and byte counters are also computed locally.
## faq
Frequently asked questions
Does the JSON formatter send my data to any server?
No. All processing — formatting, validating, minifying, repairing and converting — happens 100% in your browser, via JavaScript. No data leaves your machine, which makes the tool safe even for JSON containing sensitive information.
How do I validate a JSON and understand what is wrong?
Paste the JSON into the input area and click Validate. If there is a syntax error, the tool shows a clear message with the line and column of the problem and a code excerpt pointing to the exact spot — for example, single quotes instead of double quotes or a trailing comma before closing braces.
What can the Repair button fix automatically?
Automatic repair fixes the most common defects: single quotes in place of double quotes, trailing commas, unquoted keys, comments inside the JSON and unclosed braces or brackets. After the repair, the tool lists what was fixed so you can review it before using.
How do I convert JSON to CSV?
Click JSON → CSV. The conversion works when the JSON is a list (array) of objects: each object becomes a row and each key becomes a spreadsheet column. Nested values are serialized as text. If the structure is not compatible, the tool explains the accepted format.
What is the difference between formatting and minifying JSON?
Formatting adds indentation (2 spaces, 4 spaces or tab) and line breaks to make it easier for humans to read. Minifying does the opposite: it removes all spaces and line breaks to reduce file size, ideal for transmitting data in APIs and saving bandwidth.
Can I convert JSON to YAML and YAML to JSON?
Yes. The JSON → YAML button turns the validated JSON into readable YAML, useful for configuration files like docker-compose and CI/CD pipelines. The YAML → JSON button goes the other way, pointing out line and column if the YAML is invalid.
## other tools