Skip to main content
ToolsBay

Runs in your browser — nothing is uploaded · verify

JSON Formatter — free, and it runs in your browser

Pretty-print JSON with the indentation you choose, or minify it.

  • Beautify unreadable minified JSON, or minify it again for a request body.
  • Two spaces, four spaces or tabs — whichever your codebase uses.
  • Minify shows the size before and after, and the percentage saved.

Your JSON

Tab indents · Esc then Tab to leave1 line

Formatted

1 line
  • 70 tools

    Free, with no account and no watermark

  • 0 bytes

    Of your files or text uploaded — this tool runs in the tab

  • No queue

    The work happens in this tab, not in a line behind other users

Three steps, nothing to install

JSON Formatter in three steps

  1. JSON123456Paste it in — it never leaves the tab

    Paste your JSON

    Drop in an API response, a config file or a log line. It is parsed in the page, so a payload full of customer data stays on your machine.

  2. JSONJSONConverted on your own device

    Format or minify it

    Pick your indentation and the structure appears. Minify does the reverse when you need to paste it back into a request.

  3. Copy JSON

    Copy the result

    One click to the clipboard, or download it as a .json file.

Why use JSON Formatter

  • What changes, and what does not

    The document is parsed and re-printed, so values and array order come through and numbers are written canonically. Keys that look like integers move to the front of their object, and an integer beyond 9,007,199,254,740,991 can lose precision, as in any JavaScript parser.

  • Errors that say where

    When something will not parse you get the line and column it gave up on, not a red box that says the input was invalid.

  • Your text stays in the page

    What you paste is not transmitted or stored, so an API response full of customer records, a token or an internal query never leaves your machine.

Frequently asked questions

Formatting changes the layout — indentation and line breaks — and writes the data out as the parser read it. Validating only checks that the document parses. This page formats: if the JSON will not parse it stops at the first error and shows its line and column. The JSON Validator is built around that error report, with the usual causes explained.

Formatting and minifying JSON

JSON is transmitted minified — no line breaks, no indentation — because every byte counts on the wire. That is the right format for a machine and the wrong one for a person. Formatting adds the structure back so you can see the nesting; minifying strips it again when you need to paste the result into a config or a request body.

The indentation choice is a matter of convention rather than correctness. Two spaces is the JavaScript ecosystem default and what most APIs return. Four is common in Python and .NET codebases. Tabs render at whatever width the reader has configured, which some people prefer for accessibility.

When it will not parse

Formatting needs a document that parses, so a syntax error stops it: you get the parser's message with the line and column. To work out why, use the JSON validator, which is built around that error report and the four usual causes — trailing commas, single quotes, unquoted keys and comments.

Related: JSON to CSV flattens records into a spreadsheet, and JSON to XML converts for systems that need markup. For YAML, use the YAML validator.

  • JSON Validator

    Check whether JSON parses, and see the line and column where it stops.

  • JSON to CSV

    Flatten a JSON array of objects into CSV rows.

  • JSON to XML

    Convert JSON structures into equivalent XML markup.

  • XML Beautifier

    Format, minify and check XML without mangling CDATA or attributes.

  • XML to JSON

    Convert XML documents into readable JSON.

  • Regex Tester

    Test regular expressions live with match highlighting and groups.

Related guides

More tools

70 tools, none of which want your file

Everything this tool does happens in the page you are looking at. No account, no upload, no watermark.