Skip to content
Developer

JSON Formatter

Paste JSON to format with 2 or 4 spaces, minify, sort keys, convert to YAML or CSV, or download the output. Errors include line and column position. Live statistics show structure depth, key counts and byte size.

Your JSON is processed in your browser and is not uploaded to a server.

How to use this json formatter

  1. Paste your JSON into the input box.
  2. Choose Format (2 or 4 spaces), Minify, → YAML or → CSV.
  3. Optionally tick 'Sort object keys alphabetically' before formatting.
  4. Review JSON statistics, copy or download the output.

Frequently asked questions

Can I convert JSON to YAML or CSV?

Yes. Use → YAML for any JSON, or → CSV when your JSON is an array of flat objects (e.g. [{name, age}, {name, age}]).

What does 'sort keys' do?

It alphabetizes object keys at every depth — useful for diffing, version control, and consistent output.

Why does it say invalid JSON?

Common causes are trailing commas, missing quotes around keys, and unclosed brackets. The error message includes the line and column.

Is my JSON sent to a server?

No. Parsing, formatting and converting happen entirely in your browser.