Skip to content
Developer ToolsRuns in your browser

JSON Formatter

Pretty-print messy JSON, catch syntax errors with a clear message, and minify when you're done.

Input
Output

Formatted JSON appears here. Paste input and press Format.

What this does

Paste JSON to format it with clean indentation, or minify it to a single line. Invalid JSON is flagged with the line, column and reason so you can find the problem fast. Everything happens in your browser.

How to use it

  1. 1Paste or type JSON into the left pane.
  2. 2Choose Format to indent it or Minify to compact it.
  3. 3Copy or download the result, or Clear to start over.

Examples

  • {"name":"John","tags":["a","b"]} formats onto multiple indented lines
  • A trailing comma is reported with its exact position

Frequently asked questions

Is my JSON uploaded anywhere?
No. The JSON Formatter runs entirely in your browser using the built-in JSON parser. Your data never leaves your device.
Why does it say my JSON is invalid?
Common causes are trailing commas, single quotes instead of double quotes, unquoted keys, or missing brackets. The error message points to the line and column so you can fix it quickly.
What indentation does it use?
Formatting uses two spaces by default, which is the most common convention. You can switch between 2 spaces, 4 spaces and tabs.

More developer tools

View all