Free · No sign-up · Data stays local

JSON Formatter

Free online JSON formatter and minifier with 2/4 space or tab indentation. Syntax errors are reported with the exact line and column. Nothing is uploaded.

等待输入
字符数
—
行数
—

How to Use

  1. Paste your JSON

    Paste the raw JSON into the input box and choose an indent (2 spaces, 4 spaces or tab).

  2. Format or minify

    Click Format for a readable nested structure, or Minify to strip all whitespace. Syntax errors are reported with line and column in the status line.

  3. Copy the output

    Click Copy result to send the output to your clipboard. Character and line counts are shown underneath.

FAQ

What does JSON formatting do?

Minified JSON is often a single unreadable line. Formatting adds indentation and line breaks so the structure is easy to inspect, while minifying strips all extra whitespace to shrink the payload for transport.

How do I check whether my JSON is valid?

Just click Format. If there is a syntax error the tool reports the line, column and reason. Typical causes are trailing commas, single-quoted strings and unquoted keys.

Why do I get an unexpected token error?

The most common causes are a trailing comma after the last item, single quotes instead of double quotes, unquoted keys, or stray comments. Standard JSON allows neither comments nor trailing commas.

Is my data uploaded?

No. Parsing, formatting and minifying all happen locally in your browser. Nothing leaves your device, so it is safe for config files containing secrets.

More Online Tools