JSON Formatter

Pretty-print, sort keys, browse as a tree, convert to YAML or CSV.

JSON

Formatted

Formatted JSON appears here as soon as you paste it.
Runs on this device. Nothing is uploaded.

About the JSON Formatter

Paste JSON from an API, a log or a config file and get it indented and highlighted at once. Browse it as a collapsible tree, sort keys alphabetically to compare two responses, convert it to YAML or CSV, or minify it again. If the JSON is broken, the formatter points at the exact line and column and offers to repair common mistakes like trailing commas, single quotes and comments. Large files are processed in a background thread so the page never freezes.

How to use it

  1. Paste JSON or drop a .json file into the left panel.
  2. Choose an indent, and Sort keys if you want stable order.
  3. Switch the right panel between Code, Tree, YAML and CSV.
  4. Copy or download the result.

Example

Input
{"name":"Ada","langs":["en","fr"]}
Result
{ "name": "Ada", "langs": [ "en", "fr" ] }

Questions

Is my JSON sent anywhere?

No. Parsing and formatting run in your browser, so API keys and customer data in your JSON stay on your machine. You can check in your browser's network panel: formatting makes no requests.

What can auto-repair fix?

Trailing commas, single-quoted strings, unquoted keys, // and /* */ comments, Python-style True, False and None, and a missing comma between lines. Always read the repaired result before you use it.

Why did a long number change?

JavaScript stores numbers as 64-bit floats, so integers above 9,007,199,254,740,991 lose precision when parsed. The formatter warns you when it finds one. Keep such IDs as strings in your JSON.

How large a file can it format?

Files of tens of megabytes work, depending on your device's memory. Inputs over 1 MB are parsed in a Web Worker, and the tree view opens large nodes on demand.

Related tools