Format and validate JSON in your browser
This JSON formatter turns compact or messy JSON into clean, indented text that is easy to read — and tells you immediately if the JSON is not valid. It is also a JSON minifier: switch to minify mode to strip all whitespace for production use. Everything happens locally in your browser, so you can safely work with API responses, tokens, logs and configuration files without uploading them anywhere.
Output updates as you type or paste. There is no "submit" button and no waiting for a server.
Features
- Beautify / pretty print with a choice of 2 spaces, 4 spaces or tab indentation.
- Minify to produce the smallest possible single-line JSON.
- Validation with error location. If parsing fails, the message shows the line and column, so you can jump straight to the missing comma or stray quote.
- Sort keys alphabetically at every level of nesting for consistent, comparable output.
- Copy or download the result as a
.jsonfile.
Common uses
Debugging APIs. Responses from REST APIs and webhooks often arrive as one long line. Paste the response here to see its structure, find the field you need and check its type.
Editing configuration. Many tools store settings as JSON (package.json, tsconfig.json, VS Code settings, cloud templates). Validate your edits before saving to avoid a broken deployment.
Preparing payloads. Minify JSON before sending it in a request body, putting it in an environment variable or embedding it in HTML.
Comparing documents. Sort keys in two JSON documents, then compare them with the Diff Checker to see what really changed.
JSON syntax rules in brief
JSON (JavaScript Object Notation) is a strict subset of JavaScript object syntax:
- Strings and object keys must use double quotes:
"name", not'name'orname. - No trailing commas after the last item in an object or array.
- No comments.
//and/* */are not allowed. - Allowed values are strings, numbers,
true,false,null, objects and arrays.undefined,NaN,Infinityand dates are not JSON values — dates are usually stored as ISO strings like"2026-10-02T12:00:00Z". - Special characters in strings, such as quotes, backslashes and line breaks, must be escaped (
\",\\,\n).
If you receive data that is encoded as Base64 or comes inside a token, decode it first with the Base64 tool or the JWT Decoder, then format it here.