Skip to content
↑↓ to move ↵ to open Esc to close Browse all tools

JSON Formatter

Paste JSON to pretty-print, minify or validate it. Errors show the exact line and column, and everything stays in your browser.

Tip: press Ctrl + Enter or Cmd + Enter to format.

Output

Formatted JSON appears here.

Runs on your device. Nothing you enter is sent to a server.

What is a JSON formatter?

JSON (JavaScript Object Notation) is a text format for structured data, used by most web APIs and many config files. Machines often send it as one long line, which is hard for people to read. A JSON formatter adds line breaks and indentation so you can see the structure at a glance.

This tool parses your input with the browser's built-in JSON parser, so it also works as a validator. If the input is not valid JSON, you get a plain message with the line and column of the first problem. Minify does the opposite of formatting and strips all optional whitespace.

How to use the JSON formatter

  1. 1Paste your JSON into the input box, or press Load sample to try it out.
  2. 2Pick an indent and choose Format, Minify or Validate. Turn on Sort keys to order object properties alphabetically.
  3. 3Fix any error at the line and column shown, then copy the output or download it as a .json file.

Frequently asked questions

Is my JSON sent to a server?

No. Formatting, minifying and validation run in your browser with its built-in JSON parser. Nothing you paste leaves your device, so it is safe to use with API responses and config files.

What does minify do?

Minify removes all spaces, tabs and line breaks that are not inside strings. The data stays the same, but the file gets smaller, which helps when you send JSON over a network or store it.

Why does my JSON fail to validate?

Common causes are trailing commas, single quotes instead of double quotes, property names without quotes, comments, and unescaped line breaks inside strings. JSON allows none of these. The error message shows the line and column where the problem starts.

Does sorting keys change my data?

No. Sort keys only reorders object properties alphabetically, which makes two files easier to compare. Arrays keep their order. Note that JavaScript always lists keys that look like whole numbers first.

Are very large numbers handled exactly?

Numbers above 9,007,199,254,740,991 can lose precision, because browsers store JSON numbers as 64-bit floating point values. If you work with large IDs, keep them as strings in your JSON.