Skip to content

JSON Formatter

Beautify, minify and validate JSON with precise error locations.

Quick Tool Overview

The JSON Formatter beautifies, minifies and validates JSON in your browser. Paste a minified or malformed payload and get it back readable, or get the exact line and column where parsing failed — which is usually a trailing comma or an unquoted key.

What it does
Formats, minifies and validates JSON
You give it
A JSON string, minified or broken
You get back
Indented or minified JSON, plus errors with line and column
Best for
API responses, config files, log payloads and debugging
Developer Tools Free, unlimited use No sign-up Runs in your browser

About the JSON Formatter

Paste minified or malformed JSON and get it back readable. The formatter re-indents with two or four spaces or tabs, can sort object keys alphabetically, and minifies back to a single line when you need the smallest possible payload.

Validation is the part that saves the most time. When the parser rejects your input, the error message is reported with the line and column where parsing failed, so you can jump straight to the trailing comma or unquoted key instead of scanning the whole document. Statistics below the output show the size before and after, plus the number of keys and the maximum nesting depth.

Key features of the JSON Formatter

Error locations, not just error messages

When the parser rejects your input it reports the line and column, so you jump straight to the problem instead of scanning the document.

Choose your indentation

Re-indent with two spaces, four spaces or tabs to match whatever the rest of your project uses.

Minify for the smallest payload

Collapse the whole document back to a single line when size on the wire is what matters.

Sort keys alphabetically

Optional key sorting makes two versions of the same object easy to compare by eye.

Document statistics

Size before and after, the number of keys and the maximum nesting depth are reported under the output.

How to use the JSON Formatter

  1. 1

    Paste your JSON

    Drop in an API response, a config file or any JSON string, however badly formatted.

  2. 2

    Format or minify

    Choose an indentation width and click Format, or click Minify to strip all whitespace.

  3. 3

    Fix any errors

    If the JSON is invalid, the line and column of the failure are shown so you can correct it.

  4. 4

    Copy or download

    Copy the result to your clipboard or download it as a .json file.

Frequently asked questions

The usual causes are a trailing comma after the last item, keys or strings wrapped in single quotes instead of double quotes, or unescaped line breaks inside a string. The error message points at the exact position.

Reviews of the JSON Formatter

What people who use the JSON Formatter think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the JSON Formatter. It takes half a minute and no account.

Write the first review

More developer tools