ToolStudio.es
In your browser1 Free Trial

JSON formatter online

Paste minified or messy JSON and get it back with readable indentation, keys sorted if you like, and any error pointed out on its line.

Free try: process 1 document (pasted or 1 file) and change the options as often as you like. Errors do not use up your try.
Input · JSON

Everything runs in your browser: your data is never sent to a server.

Result · JSON
Indentation

Why format JSON?

APIs, logs and many config files store JSON on a single line to save space. That's perfect for machines but impossible to read: you can't tell which object sits inside which, or where an array ends.

This formatter (also called a JSON beautifier or pretty printer) rewrites the JSON with one value per line and 2-space, 4-space or tab indentation, so you can see the structure at a glance. Turn on “Sort keys A-Z” and the keys of every object are put in alphabetical order, which is handy when comparing two responses.

Numbers are kept exactly as they were written. Many formatters run JSON through JavaScript and round very long integers (a 19-digit ID, for example); that doesn't happen here. If the JSON is invalid, you get the error in plain English, the line and column, and a button that puts your cursor right on it.

How to format JSON

  1. Paste the JSON into the input box, drag in a .json file or click “Open file”.
  2. Pick the indentation: 2 spaces, 4 spaces or tab.
  3. Optionally, turn on “Sort keys A-Z”.
  4. Click “Format JSON”, then copy the result or download it as a file.

When to use it

  • Reading an API response that arrives on a single line.
  • Checking a package.json, tsconfig.json or other config file before you commit it.
  • Comparing two JSON responses with their keys in the same order.
  • Finding the line with the error in a JSON file your program rejects.

Frequently Asked Questions

What's the difference between formatting and validating JSON?

Formatting changes the layout (line breaks and indentation) without touching the data. To format it, the tool also has to parse it, so if the JSON is invalid it shows you the error. If you only want to know whether it's valid and see its stats, use the JSON validator.

Does formatting change any values?

No. Only whitespace and line breaks change. Numbers are copied as-is, without rounding, and strings keep their content. If you turn on “Sort keys”, the order of the keys changes, not their values.

Can I format JSON with comments or trailing commas?

No, because that isn't valid JSON (it's JSON5 or JSONC). The tool tells you which line the comment or extra comma is on so you can remove it.

Is my data sent to a server?

No. Everything is processed in your browser with JavaScript. The text you paste and the files you open never leave your device, so you can safely work with internal or customer data.

Can I format several files at once?

Yes, with ToolStudio Pro. Open several .json files together, they're formatted with the same options and you download them all in one ZIP. The free try covers one document.

Is it free?

Yes. You can try the tool for free on one document (pasted or a single file) and change the options as often as you like; attempts that end in an error don't use up your free try. For unlimited use and processing several files at once, ToolStudio Pro costs €1.99 a month and includes every tool.

Related tools

Development

JSON Validator

Validate JSON against the RFC 8259 standard with every error explained in plain words: trailing commas, single quotes, unquoted keys or comments. It also flags duplicate keys.

JSON
Try this tool
Development

JSON Minifier

Compact JSON into a single line without changing any value and see how much smaller it gets. Handy for APIs, config files and lighter requests.

JSON
Try this tool
Development

JSON to CSV Converter

Convert JSON to CSV with one column per key, flatten nested objects (“address.city”) and choose comma or semicolon as the delimiter. The CSV opens in Excel with accents intact.

JSONCSVExcel
Try this tool
Development

JSON to TypeScript Converter

Create TypeScript interfaces or types from JSON: objects in a list are merged into one type, missing keys become optional (?) and unions are created when values differ.

JSONTypeScript
Try this tool