1. Home
  2. Text tools

JSON formatter and validator

Pretty-print, validate and minify JSON. Your data stays private.

Result
Indent

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.

How to use

  1. Paste JSON or drop a .json file.
  2. Choose Format or Minify and the indentation.
  3. If there is an error, jump to the highlighted line.
  4. Copy or download the result.

Frequently asked questions

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.

How do I find an error in JSON?

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.

What is the difference between JSON and a JavaScript object?

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.

What does minifying JSON do?

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.

Does formatting change large numbers?

No. Many formatters round numbers like 12345678901234567890 because they convert them to JavaScript numbers. This one keeps every number exactly as written.

Is my JSON data kept private?

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.

Should I format or minify my JSON?

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.

How do I find and fix a JSON error?

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.

Why do exact numbers matter?

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.

How do I compare two JSON files?

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.

How it compares

This toolUpload-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

Limits and privacy

  • Comments and trailing commas (JSON5, JSONC) are reported as errors because standard JSON does not allow them.
  • Very large files (tens of megabytes) can take a few seconds and use a lot of memory.
  • Converting JSON to CSV is not available yet.

Standards and sources

Use it in your AI assistant

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.

Set up the MCP server

Updated: Something not working? Report a problem