JSON Formatter

Turn compact or messy JSON into clean, readable text with consistent indentation and colors. Choose 2 spaces, 4 spaces or tabs and sort the keys if you like.

Your files never leave your device. Everything runs in your browser.

How it works

  1. Add your JSONPaste it, type it, open a file or drop it onto the input box. Try Sample if you just want to look around.
  2. Check the resultThe result on the right updates as you type. Errors are shown with the line and column.
  3. Copy or downloadCopy the JSON with one click or download it as a file.

Why format JSON?

API responses and exported files are usually written on a single line to save space. That is fine for programs but hard for people to read. Formatting adds line breaks and indentation so you can see the structure at a glance.

Sorting keys alphabetically makes it easier to compare two JSON files or find a field in a large object.

About JSON

JSON (JavaScript Object Notation) is a text format for structured data. It uses objects with keys and values, arrays, strings, numbers, true, false and null. Almost every web API and many configuration files use it because both people and programs can read it easily.

Frequently asked questions

Does formatting change my data?

No. Only spaces and line breaks change. Sorting keys changes the order of fields, which JSON readers ignore.

Should I use 2 spaces, 4 spaces or tabs?

It is a matter of taste. Two spaces is the most common choice for web projects, four spaces is common in many style guides.

Is my data uploaded anywhere?

No. Everything runs in your browser. Your JSON and CSV data is not sent to our servers.

How big can my JSON be?

Files of several megabytes work well. Very large files depend on your device's memory. Coloring is turned off for very large results to keep the page responsive.

Why does the tool say my JSON is invalid?

Common causes are a missing comma, a trailing comma before a closing bracket, single quotes instead of double quotes, or comments. The error box shows the line and column so you can fix it quickly.

Does it work without an internet connection?

Yes. After you open the page once, it keeps working even if your connection drops.