JSON Formatter

Format, validate, minify and explore JSON. Errors are pinpointed to the exact line and column. Nothing leaves your browser.

Input

Waiting for input

Output


                
                
—
Ctrl/⌘ + Enter to format

How it works

Paste JSON or open a .json file. The formatter parses it with your browser’s built-in JSON.parse, so validation is exact. If something is wrong you’ll see the line and column of the first error, with that line highlighted.

  • Format re-indents with 2 spaces, 4 spaces or tabs.
  • Minify removes all whitespace for the smallest payload.
  • Sort keys orders object keys alphabetically (recursively), which makes diffs easier to read.
  • Tree view lets you expand and collapse nested objects and arrays.

Your input is kept as a draft in this browser so you don’t lose work on refresh. Nothing is uploaded.

FAQ

Is my JSON sent to a server?

No. Parsing, formatting and validation all happen locally in your browser, so it’s safe for API keys, tokens and private data.

Why does it say “Unexpected token”?

Common causes are trailing commas, single quotes instead of double quotes, unquoted keys, or comments. Strict JSON allows none of these.

How large a file can it handle?

Several megabytes comfortably. Very large files may be slower to highlight; minify or the tree view stay fast.