JSON Formatter & Minifier

Format, beautify and minify JSON online. Custom indent, sort keys, escape Unicode, and get exact line/column numbers for parse errors. Runs 100% in your browser.

Runs locally · data never uploaded
Advertisement

How to use

What it does

Expands a single-line JSON string into a readable tree, or strips all whitespace to shrink it. When parsing fails you get the exact line and column of the offending character instead of a vague "invalid format" message.

Example

Input:

{"name":"DevUtils","tools":36,"local":true}

Formatted with 2-space indent:

{
  "name": "DevUtils",
  "tools": 36,
  "local": true
}

Common mistakes

  • Unquoted keys: use {"a": 1}, not {a: 1}
  • Trailing commas: the last item of an array or object must not be followed by a comma
  • Single quotes: JSON only allows double quotes
  • Comments: standard JSON does not support // comments

FAQ

Q1.How large a JSON can it handle?
Parsing happens in the browser, so anything up to a few tens of megabytes usually works; above 1MB you will see a performance notice. For very large files, prefer a command-line tool.
Q2.Why does it report "line X, column Y"?
The parser stops at the offending character and computes its line and column so you can jump straight to the problem. Trailing commas and mismatched quotes are the usual culprits.
Q3.Does sorting keys change my data?
No. A JSON object is an unordered collection, so sorting keys only changes display order and makes it easier to compare two documents for equality.
Q4.Is my JSON uploaded?
No. Parsing and formatting happen entirely in your browser, and the tool keeps working offline.
Advertisement

Related tools