Skip to content
JSON Tidy

JSON Formatter & Validator

Check, format, and fix JSON in your browser. Nothing is uploaded.

How to format JSON

  1. Paste your JSON above, or choose Open file to load a .json file.
  2. Choose Format, with 2 spaces, 4 spaces, or tabs for each level.
  3. Copy or download the result.

Formatting, also called pretty-printing or beautifying, only changes spaces and line breaks. Keys, values, and their order stay exactly as they were. If the JSON has a mistake, the editor underlines the line, and Fix My JSON can repair common ones. For the rules behind it all, read the JSON format guide.

Formatting JSON in code

// JavaScript
JSON.stringify(data, null, 2)

# Python
json.dumps(data, indent=2)

# Command line
python3 -m json.tool data.json
jq . data.json
Have a suggestion or found a bug? Send a message.

We’ll only use your email to respond to this message.