100% free · No sign-up · Instant result

JSON Formatter

Format, minify, and validate JSON with clear parse-error messages.

Use this free JSON formatter to pretty-print, minify, and validate JSON in your browser. Paste API payloads, config files, or test fixtures and fix structure before you ship. The validator reports parse errors with line and column when the input is invalid. Choose 2-space, 4-space, or tab indentation for readable output. No account is required and text never leaves your device.

How to use

  1. Add JSONPaste raw JSON into the formatter field.
  2. Configure actionPick an indent size, then format, minify, or validate.
  3. Copy outputCopy the cleaned JSON or fix the reported parse error.

The input is parsed with the browser JSON parser. Valid input is re-serialized with the chosen indent or minified; invalid input reports the parser error with its line and column.

JSON formatter, beautifier, and validator uses

A JSON formatter (beautifier) adds line breaks and indentation so nested objects are easier to read in reviews.

Minify removes optional whitespace when you need a compact body for logs, tests, or size-sensitive requests.

Validation catches broken syntax before an API client fails. Fix the first error, then re-validate.

Common JSON syntax errors this tool can surface

The browser JSON parser rejects invalid text and returns a message with location when possible. These issues show up often in hand-edited payloads.

ProblemExampleWhat to fix
Trailing comma{ "a": 1, }Remove the comma after the last property
Single quotes{ 'a': 1 }Use double quotes for keys and strings
Unquoted keys{ a: 1 }Quote every key as a JSON string
Missing comma{ "a": 1 "b": 2 }Separate properties with commas
Unclosed structure{ "a": [1, 2 }Match every [ ] and { } pair
Invalid number{ "n": 01 }Use standard JSON number forms

JSON does not allow comments. Strip // or /* */ notes before validating.

Example

Formatting {"a":1,"b":[2,3]} with a 2-space indent prints each key and array element on its own line.