What this tool answers

A JSON error message that says "unexpected token" without a location is a small puzzle you did not ask for. This page formats, minifies, and validates JSON, and when the parse fails it reports the line and column plus the parser's own message. Everything happens in the browser.

How to use it

Paste JSON into the left box and choose an indent of two spaces, four spaces, or a tab. Format rewrites the document with that indent. Minify removes all optional whitespace, which is what you want before sending a payload or storing a config. Validate parses without rewriting, so you can check a document and leave it untouched.

The output panel has its own copy button. The error panel appears only when the parse fails; a successful parse clears it. The tool accepts a top-level array, object, string, number, boolean, or null, because JSON.parse does.

What it does not do

It does not repair invalid JSON. A trailing comma, a comment, or a single-quoted string is invalid JSON even when a JavaScript file accepts it, and the validator will say so. It does not convert JSON to YAML, CSV, or TypeScript types. It does not fetch a URL for you; paste the response body instead.

Nothing is uploaded. There is no request to the server while you type, and no history is kept.

Reading the error location

The line and column come from the parser's position at the failure, which is usually where the structure broke rather than where you started editing. A missing comma is often reported one token later than the line you changed. Start at the quoted line, look at the previous non-empty line, and check the separator between them.

For very large documents the browser may pause while formatting. If that happens, minify first, or split the file; this tool is aimed at configuration files and API payloads, not multi-megabyte exports.