Skip to content

JSON Formatter & Validator

Format, compact, or validate JSON in your browser with live output, line numbers, folding, search, and adjustable font size. Copy or download the result.

No file chosen.

Ln 1 : Col 1 0 lines / 0 chars
0 lines / 0 chars

Free JSON Formatter and Validator

This free JSON Formatter and Validator turns minified or messy JSON into clean, readable, properly formatted JSON. It validates your input as you go, and when something’s wrong it reports the first syntax error with its line and column, so you can fix it instead of hunting through a wall of text.

Paste it, load it, or try the example

Work happens in the left editor. Paste a chunk of JSON from anywhere, or use the file button to read a .json file straight from your computer. The file is processed locally and never uploaded anywhere. Not sure what to paste? Hit Example and you’ll get a small document to experiment with.

Every line carries a number on the left, and the status bar under the editor shows your caret position as Ln and Col. That matters more than it sounds. When the tool tells you something is wrong at line 4, you can see exactly which line it means.

Live formatting, on your terms

Live mode is on by default, so the right panel starts formatting the moment your JSON is valid. If you’d rather control the timing, switch Live off and press Format (or Ctrl+Enter) when you’re ready. The indent dropdown switches between 2, 4, or 8 spaces to match whatever your project uses.

Formatting only re-indents the JSON and arranges the line breaks. Every key and value stays exactly the same. The output is still the same document, just readable.

When the JSON won’t validate, it tells you where

The status line under the editor checks your JSON as you type and reports the first syntax error with its line and column. Most invalid documents fail on one of the usual suspects:

  • A comma after the last item in an object or array
  • Keys without double quotes
  • Single quotes instead of double quotes
  • Comments left in from a JavaScript file
  • Extra characters after the JSON value

The Validate button runs the same check whenever you ask. Handy when you’ve edited the JSON and want to double-check before you trust it.

Copy it, download it, or squeeze it back down

When the output looks right, Copy puts the formatted JSON on your clipboard and Download saves it as formatted.json. Need the tightest version possible for a URL, a command line, or a field with a character limit? Compact collapses everything back onto one line.

Good to know

The tool accepts JSON documents up to a million characters. Everything runs in your browser. Pasted or loaded JSON is processed locally and never sent anywhere. There’s no account, no queue, and no cost.

Folding, search, and a font that fits

Each editor carries its own toolbar, the way a code editor does. Search, Expand all, Collapse all, and a fullscreen button sit above every panel, and the copy and download buttons live on the output side. The fullscreen button stretches one editor across the whole screen when a document gets long, and Esc brings it back. The search box finds text inside whichever editor you’re using, and the fold markers next to line numbers collapse a whole object or array into one line. The A+ and A− buttons in the middle grow or shrink the font in both editors from 11px up to 22px. In Live mode, picking a different indent in the dropdown re-formats the output right away, with no extra clicks.

Related tools

More utilities you may find useful.

View all tools