Skip to content

JSON Formatter & Validator

Paste JSON and format it with proper indentation, minify it to a single line, or just validate it — with the exact line and column of the first syntax error, not a vague "unexpected token" with no location.

  • Format, minify or validate
  • Exact line and column on syntax errors
  • Configurable indent width
  • Copy the result in one click
  • Runs fully client-side

Formatter

Parsed locally, nothing uploaded

Output

How to format or validate JSON

  1. 01

    Paste your JSON

    Paste the JSON document, however it is currently formatted — minified, malformed, or already pretty.

  2. 02

    Pick format or minify

    Format adds indentation for readability; minify strips it to the smallest valid representation.

  3. 03

    Fix anything flagged

    A syntax error shows the exact line and column where parsing failed, so there is no guessing which of 200 lines has the problem.

Why the error location matters more than the error message#

"Unexpected token in JSON" tells you something is wrong. It does not tell you where, and a config file, an API response, or a build artifact pasted in for debugging is often hundreds of lines long. This tool surfaces the exact line and column JavaScript's own parser reports the failure at, which turns a search through the whole document into a jump straight to the problem — usually a trailing comma, a missing quote, or a stray comment (JSON has no comment syntax, despite how often people try to add one).

Format versus minify versus validate#

Formatting adds consistent indentation for human readability — useful when debugging a compressed API response or reviewing a diff. Minifying does the opposite: it strips every character that does not change the meaning, which matters when JSON ships inside a URL parameter, an environment variable, or anywhere every byte counts. Validate-only exists for the case where you just need a yes-or-no answer without generating any output to copy.

What "valid JSON" actually requires#

JSON is stricter than it looks. Object keys must be double-quoted — single quotes and unquoted keys are invalid, even though both are common in JavaScript object literals. Trailing commas after the last item in an array or object are not allowed, unlike in JavaScript. Comments are not part of the spec at all. All three are the most common reasons a document that "looks like JSON" fails to parse, and all three are things this tool catches and locates precisely.

Frequently asked questions

Why does it tell me the exact line and column of an error?

Because "unexpected token" alone is nearly useless in a document of any real size. This tool surfaces JavaScript's own parser location, so the problem line is immediately findable instead of requiring a manual search.

Does JSON allow trailing commas or comments?

No to both — JSON is stricter than JavaScript object literals here. A trailing comma after the last array or object item, or any `//` or `/* */` comment, makes the document invalid, and both are common reasons a document that "looks right" fails to parse.

What does minifying actually remove?

All whitespace that does not change meaning — indentation, line breaks, and spaces around punctuation. The data is identical; only the formatting is gone, which matters when JSON needs to be as compact as possible.

Is my JSON sent anywhere to be checked?

No. Parsing, formatting and validation all happen locally in your browser — nothing is uploaded.

Developers

UUID Generator

Generate cryptographically random UUID v4 or time-ordered UUID v7, in bulk.

Developers

Base64 Encoder & Decoder

Encode and decode Base64 with correct UTF-8 handling, including the URL-safe alphabet.

Developers

ULID Generator

Generate ULIDs — sortable by creation time like UUID v7, but Crockford Base32 instead of hex.