Skip to main content
OnlineTools

Runs locally in your browser

JSON Formatter & Validator

Format, validate, and explore JSON with useful error locations. Your input stays on this device.

Hover a key to see its value type
{
"project":"OnlineTools",
"private":true,
"features":[
0:"format",
1:"validate",
2:"tree view"
],
"settings":{
"treeView":true
}
}
✓ Valid JSON5 object keys3 array items158 characters

How to format JSON

  1. Paste JSON into the input editor.
  2. The tool automatically validates and formats the data.
  3. Explore nested objects and arrays in the interactive tree.
  4. Copy the result or download it as a JSON file.

Formatting and validation

The formatter makes nested objects and arrays easier to inspect by adding consistent whitespace. Validation checks that the input follows the JSON grammar and reports a useful error location when it does not.

Frequently asked questions

Does OnlineTools upload my JSON?

No. Formatting and validation happen locally in your browser, so the JSON you paste is not sent to OnlineTools servers.

Can I collapse nested JSON objects and arrays?

Yes. Click the arrow beside an object or array in the tree to expand or collapse it. Use Expand all or Collapse all to change the complete document.

Why is my JSON invalid?

Common causes include trailing commas, single-quoted strings, unquoted property names, comments, and missing brackets. Standard JSON requires double quotes and does not allow comments.

Related tools