Skip to content

All tools

JSON Formatter

Make JSON readable, check it for errors, or minify it.

  • 100% free
  • Shows error line and column
  • Nothing is uploaded
0 characters

Format

Last reviewed by the OnlineToolPro team

What is the JSON Formatter?

Paste JSON to format it with clean indentation, check that it's valid (errors show the line and column), sort keys alphabetically or minify it to one line.

How it works

How to use the JSON Formatter

3 simple steps. No experience needed.

What can you use it for?

  • Read an API response that arrived as one long line.
  • Find the exact spot where a JSON file is broken.
  • Minify JSON before embedding it.

Common JSON errors

The most frequent problems are trailing commas after the last item, single quotes instead of double quotes, keys without quotes and comments. The error message shows the line and column so you can jump straight to the problem.

Formatting options

Choose 2 spaces, 4 spaces or tabs for readable output, or minify to remove all whitespace for the smallest payload. Sorting keys alphabetically makes two JSON files much easier to compare.

FAQ

Frequently asked questions

Is it safe to paste private data?

Yes. The JSON is parsed in your browser and never sent anywhere.

Does it accept comments or trailing commas?

No — those aren't valid JSON, so the tool points them out.

How do I compare two JSON files?

Format both with “Sort keys alphabetically” turned on, then paste them into the text compare tool to see exactly what changed.

Related guides

Step-by-step help for getting more out of the json formatter.

All guides

Other tools you might find useful next.

More Developer Tools

Format, convert and check code and data. 9 free tools.

Browse Developer tools
Other categories:YouTubeTextImagesPDFs