JSON Formatter

Format & validate JSON

Open in workspace

JSON Formatter: Format & validate JSON. A free, browser-based tool from DevToolbox that runs entirely on your own device: no upload, no account, no tracking.

About the JSON Formatter

Paste JSON and this formatter validates it, pretty-prints it with the indentation you choose, and highlights the result by type so structure is readable at a glance. Minify does the reverse when you need the smallest possible payload.

Formatting happens by parsing your input into a structure and printing it back out with consistent indentation, so the result is the same document with different whitespace, never a rewrite of its meaning. Invalid input is reported with the position that broke the parse rather than silently repaired.

What you can do with it

  • JSON validator
  • JSON pretty print
  • Format JSON online
  • JSON beautifier
  • Validate JSON
  • JSON parser

How to use it

  1. Paste or type your code into the input pane.
  2. The formatted result appears in the output pane as you type. There is no run button to press.
  3. If the input will not parse, the status bar turns red and names the problem and its position.
  4. Use Copy to put the formatted result on your clipboard.

Questions

What happens if my JSON is invalid?
The status turns red and you get the parser's own message together with the line the problem is on. Trailing commas, single quotes around keys and unquoted keys are the three that account for most failures. JSON allows none of them.
How large a document can it handle?
It is bounded by your browser's memory rather than an upload limit. Documents of a few megabytes format without trouble; very large ones are slower to syntax-highlight than to parse.
Is my data uploaded anywhere?
No. The tool is JavaScript that runs in the tab you already have open, and DevToolbox has no backend to send anything to. You can open the network tab and watch: after the page and its script load, nothing is sent while you work.
Does it work offline?
Once the page has loaded, yes. The tool needs no network access to do its job, so it keeps working if your connection drops. Reloading the page does need the network unless your browser has it cached.

The JSON Formatter sits in Beautifiers & Formatters, one of the 90 tools on DevToolbox.