plain/devtools home

JSON formatter and validator

Paste JSON to validate it, pretty-print it or minify it. Errors point to the line and column.

tool 01 of 12 []
all shortcuts ?

json-formattersamplesCtrl↵ run · s sample · c copy
Output

never leaves your browser

How to use it

  1. Paste or type JSON into the input box. It is checked as you type, so the status line tells you at once whether it is valid.
  2. Press Format for readable, indented output or Minify to strip all whitespace. Use Sort keys to order object keys alphabetically, which makes two documents easier to compare.
  3. If the JSON is invalid, the message names the problem and shows the line and column where the parser stopped. The cursor jumps to that spot in the input.
  4. Copy the result with the Copy output button.

Examples

Select an example to load it into the tool.

  • Valid object{"name":"Ada","roles":["admin","dev"],"active":true,"manager":null}
  • Trailing comma (invalid){ ↵ "a": 1, ↵ "b": 2, ↵ }
  • Single quotes (invalid){'a': 1}

Frequently asked questions

Is my JSON sent to a server?

No. Parsing and formatting use your browser's built-in JSON engine. The page makes no network request with your input, so it is safe for tokens, internal payloads and customer data. You can load the page and then go offline.

Why is trailing-comma JSON invalid?

The JSON standard (RFC 8259) does not allow trailing commas, comments or single-quoted strings. JSON5 and JSONC allow some of them, but most parsers and APIs expect strict JSON.

Does it change my numbers?

Numbers are parsed as JavaScript doubles. Integers above 9007199254740991 (2^53 - 1) lose precision, and 1.0 is printed as 1. If you need exact large integers, keep them as strings.

What does Sort keys do to arrays?

Only object keys are sorted. Array order is meaningful in JSON, so arrays are left exactly as they are.

How large an input can it handle?

A few megabytes work fine on a modern device. The limit is your browser's memory, not a server quota.

Related tools

esc
↑↓ move↵ open? all shortcuts

Keyboard shortcuts

Cmd or Ctrl shortcuts always work.
Everywhere
Everywhere
Open the command palette
CtrlK
Open the palette (outside a text field)
/
Show these shortcuts
?
Toggle light and dark theme
t
Go home
gh
Go to all tools
gt
On a tool page
On a tool page
Run the main action
Ctrl↵
Copy the output
c
Load the next sample
s
Focus the input
i
Leave a text field
Esc
Previous or next tool
[]
In the palette
In the palette
Move the selection
↑↓
Open the selected item
↵
Close
Esc