JSON formatter

To format JSON, paste it into the box and press Format JSON. Pick an indent first, or press Minify JSON to remove all spaces and line breaks.

  • Stays on your device

    Nothing you type is sent

  • Works as you type

    No file needed

  • Copy or download

    Nothing is saved

How it works

  1. Paste your JSON into the box.
  2. Pick an indent of 2 spaces, 4 spaces or tabs, and tick the option to sort keys if you need it.
  3. Press Format JSON, or press Minify JSON to remove all spaces and line breaks.
  4. If the JSON is not valid, read the error. It gives the line and column where the JSON goes wrong.
  5. Copy the result with the Copy text button.

Facts

Where it runs
In your browser. What you type is not sent anywhere or saved
Indent
2 spaces, 4 spaces or tabs
Sort keys
An option sorts object keys from A to Z
Checked by
The browser's own JSON parser
Errors
The error message, with the line and column where the JSON goes wrong

Questions

How do I format JSON online?

Paste the JSON, pick an indent, and press Format JSON. The indented JSON is the result, and you can copy it with the Copy text button.

What is the difference between formatting and minifying JSON?

Formatting adds indents and line breaks so people can read the JSON. Minifying removes all spaces and line breaks, which makes the JSON as short as it can be.

Why does my JSON show an error?

The text is not valid JSON. The error shows the line and column where it goes wrong, which is often a missing comma or quote, or an extra comma before a closing bracket.

Does the JSON leave my browser?

No. Your browser checks and formats the JSON, and nothing you paste is sent to a server.

Related tools

Advertise here

Your ad goes live as soon as the payment goes through.

How long

0 of 60

Payment is handled by Dodo Payments. You can pay by card and other methods they offer.