JSON formatter

Format, beautify, minify and validate JSON with syntax highlighting.

  • Development
  • 100% free & unlimited
  • No sign-up
  • Runs in your browser
JSON formatter

What is the json formatter?

The JSON formatter makes JSON readable: paste an API response or a config file and get it indented with 2 or 4 spaces or tabs, with syntax highlighting. Switch to minify to remove every space, or sort the keys alphabetically to compare two objects.

Invalid JSON is reported with its line and column, and the editor marks the error as you type. Everything runs in your browser, so your data stays private.

How to use the json formatter

  1. 1Paste or type JSON in the editor.
  2. 2Choose beautify or minify, the indentation and key sorting.
  3. 3Copy or download the result.

Features

Code editor

Syntax highlighting, line numbers and live error marks.

Beautify or minify

2 spaces, 4 spaces, tabs, or one line.

Sort keys

Alphabetical order at every level.

Clear errors

Line and column of the first syntax error.

Frequently asked questions

What's the difference between a JSON formatter and validator?

A validator only checks the syntax; the formatter also rewrites the JSON in the layout you choose.

Why is my JSON invalid?

Common causes are trailing commas, single quotes, unquoted keys and comments, which JSON doesn't allow.

Is my JSON sent to a server?

No, formatting happens entirely in your browser.