How do I format JSON?
Paste it and press Format. Choose 2 spaces, 4 spaces or tabs for indentation, and optionally sort keys alphabetically. The formatted JSON can be copied or downloaded as a file.
Pretty-print, validate and minify JSON. Your data stays private.
Your text never leaves this device.
Paste JSON to format it with clean indentation, or minify it to a single line. If it is invalid, the exact line and column of the first error are shown with a plain explanation, such as a missing comma. Values are never changed, so large numbers keep full precision, and your data stays in your browser.
Paste it and press Format. Choose 2 spaces, 4 spaces or tabs for indentation, and optionally sort keys alphabetically. The formatted JSON can be copied or downloaded as a file.
Paste the JSON; if it is invalid you see the line and column of the first problem with an explanation, for example “expected a comma” or “trailing comma is not allowed”. Fix it and the check runs again.
JSON is a stricter text format: keys and strings need double quotes, trailing commas and comments are not allowed, and there are no functions, undefined or NaN. Valid JSON is always a valid JavaScript value, but not the other way round.
Minifying removes all spaces and line breaks that are not needed, which makes the file smaller for sending over a network. The data itself does not change.
No. Many formatters round numbers like 12345678901234567890 because they convert them to JavaScript numbers. This one keeps every number exactly as written.
Yes. The JSON is parsed and formatted inside your browser and is never uploaded, so it is safe to paste API responses, configuration files or data containing personal information.
Format it when a person has to read it: in a code review, a bug report or documentation. Choose 2 spaces, 4 spaces or tabs to match your project, and sort the keys if you want a stable order. Minify it when a machine reads it and size matters, for example in a request body or an embedded file. Minifying removes only the spaces and line breaks that are not needed; the data does not change.
Paste the JSON and read the line and column of the first problem. The most common causes are a trailing comma after the last item, single quotes instead of double quotes, keys without quotes, a missing comma between two items and comments, which standard JSON does not allow. Only the first error is reported, so fix it and the check runs again; a long file may need a few rounds.
Many tools turn every number into a JavaScript number, which rounds integers longer than about 15 or 16 digits. A 19-digit order or user ID can then silently change. This formatter keeps every number exactly as written, so it is safe for IDs from APIs and databases. It is also safe to paste responses that contain personal data, since the JSON is parsed in your browser and never uploaded.
Format both with the same indentation and sorted keys, then paste them into Text Compare in line mode. You will see only the real differences, not noise from key order. If you want to rename keys before that, the Case Converter can turn a list of names into camelCase or snake_case. To check how large a text is, use the Word Counter, which also shows the UTF-8 byte size.
Remember the limits. JSON5 and JSON with comments are reported as errors, and converting JSON to CSV is not available.
| This tool | Upload-based services | |
|---|---|---|
| Is your text sent to a server? | No | Usually |
| Account required | No | Sometimes |
| Length or usage limit | None | Often |
| Saved or logged | Never | Possibly |
Long JSON is easy to misjudge by eye. The check_json MCP tool, available remotely and locally, tells an assistant whether JSON is valid and where the first error is, and can format it without altering any value.