UUsefulCrate Your files never leave your browser

Home › Tools › JSON Formatter & Validator

JSON Formatter & Validator

Paste JSON and get it indented, minified, or rejected with an explanation of what is wrong and where. Formatting happens live as you type.

100% private — everything runs in your browser, nothing is ever uploaded.

What this tool does

An API response comes back as one unbroken line of JSON, and somewhere in it a comma is missing. Pasting it into a code editor without formatting makes the problem almost invisible. This tool indents JSON as you type, minifies it when you need to ship it, and when the syntax is invalid it reports what is wrong and at which character position rather than just saying parse error. It is a daily scratch pad for debugging webhooks, editing config files, checking a payload before posting it, or reading a response copied from a browser's network panel. Because formatting is live, you can watch structure appear as soon as a bracket is fixed. The indent selector also lets you match a project's two-space or four-space convention before pasting the result back into source code.

How to use it in three steps

  1. Paste the JSON into the box. Valid input is indented automatically; invalid input produces an error message below the buttons with the offending position.
  2. Read the error if there is one, fix the bracket or comma it points to, and watch the formatted output appear as soon as the text becomes valid.
  3. Use Minify to strip all whitespace for a request body, or change the indent selector to match your project's style, then copy the result. Copy a minified value only after the validator reports no error, since a malformed payload is worse than an unformatted one.

Questions people ask

Why does it say unexpected token at a position I did not expect?

JSON parsers report the first point where the structure stops making sense, which is often just after the real mistake. Check the character immediately before the reported position, especially a trailing comma or an unquoted key.

Can it handle very large responses?

It runs in your browser, so the practical limit is your device's memory and how much text the editor can render comfortably. For a multi-megabyte payload, a desktop editor with syntax folding may be more comfortable.

Does it validate against a schema?

No. It checks JSON syntax only. A document can be perfectly valid JSON and still be missing a field your API requires; use a schema validator for that kind of check.

Does it reorder keys or change my data?

No. Formatting only adjusts whitespace and indentation, and minifying only removes it. Key order, number precision and string contents are left as written, so the formatted document is the same JSON your API will receive.

Privacy: The JSON you paste is parsed, indented and minified exclusively by JavaScript in this browser tab, so payloads carrying access tokens, customer addresses or internal identifiers are never transmitted, stored or seen by a server.

How to use it

  1. Paste your JSON into the box — it is formatted automatically as you type.
  2. If it is not valid, the message under the buttons tells you why.
  3. Use Minify to strip all whitespace, and the indent selector to change the formatting style.

Why it stays private

JSON pasted into a formatter is very often an API response, which typically carries tokens, internal hostnames, customer records and identifiers. Because parsing happens in the page, none of that reaches a server.

Questions

Why does it say my JSON is invalid when it looks fine?

The most common causes are a trailing comma after the last item, single quotes instead of double quotes around keys and strings, unquoted keys, or a comment. Standard JSON allows none of those — even though JavaScript does.

What does minifying do?

It removes every character that is not required: indentation, line breaks and spaces between tokens. The data is identical, the file is smaller. It is useful when embedding JSON in a URL, a header, or a config value.

Can it handle large files?

Yes, within the limits of your browser's memory. Tens of megabytes are usually fine. Extremely large documents may make the tab slow, since formatting re-runs on every keystroke.

Is it safe to paste an API response here?

The parsing happens in your browser and nothing leaves the machine, so the response stays where you pasted it. The realistic risk is not transmission but habit: responses often carry session tokens, internal hostnames or customer records, and a formatted blob sitting in a shared editor or a screenshot is a leak that no formatter caused. Re-tokenise and close the tab when you are done.

Can it tell me exactly where the error is?

The message names the problem and the position — for example an unexpected token at character 1,204. Use that: a single misplaced comma in a large document is almost always the last character the parser managed to accept, so look just before the reported position, not after it. Trailing commas before a closing brace are the classic offender.

Related tools

Base64 Encoder & Decoder

Encode and decode text as Base64, UTF-8 safe.

URL Encoder & Decoder

Percent-encode or decode URLs and query strings.

JWT Decoder

Read a JWT's header and payload, with readable expiry.

← All tools