UtiliTools

JSON Formatter and Validator

Format, validate and minify JSON right in your browser. Paste your JSON, pick the indentation and get clean, readable output instantly, with the exact line and column of any syntax error.

✓ Valid JSON

{
  "id": 42,
  "name": "UtiliTools",
  "active": true,
  "tags": [
    "json",
    "dev"
  ],
  "owner": {
    "name": "Ana",
    "email": "ana@example.com"
  },
  "score": 9.5,
  "deletedAt": null
}

What is JSON?

JSON (JavaScript Object Notation) is a text format for exchanging data. It is the standard for REST APIs, configuration files such as package.json and document databases such as MongoDB. It supports objects in braces, arrays in brackets, double-quoted strings, numbers, true, false and null.

How to format JSON

  1. Paste your JSON into the input box, even if it is all on a single line.
  2. Choose the indentation: 2 spaces, 4 spaces, tab or minified.
  3. Optionally sort the keys, which makes two JSON documents much easier to compare.
  4. Copy the result. If the JSON is invalid, the tool shows the line and column of the error.

Common errors that make JSON invalid

  • Trailing comma: {"a": 1,} is not allowed in JSON.
  • Single quotes: strings and keys need double quotes, as in "name".
  • Unquoted keys: {name: 1} is valid JavaScript but not valid JSON.
  • Comments: JSON does not allow // or /* */.
  • Special values: undefined, NaN and functions do not exist in JSON.

Beautify or minify?

Beautified (pretty-printed) JSON is easier to read and review. Minified JSON strips whitespace and line breaks, so it is smaller to send in requests or store in environment variables. Both contain exactly the same data.

Privacy: your JSON is processed only in your browser. Nothing is sent to a server, so it is safe to format API responses and configuration files.

Frequently asked questions

How do I format JSON online?

Paste your JSON into the input box and the formatted result appears instantly. Pick 2 spaces, 4 spaces or tab indentation and click Copy.

How can I tell if my JSON is valid?

The tool validates as you type. If there is an error, it shows the line and column of the problem, such as a trailing comma or a single quote.

What is the difference between beautifying and minifying JSON?

Beautifying adds line breaks and indentation so the JSON is easy to read. Minifying strips all unnecessary whitespace to make it smaller. The data is the same.

Does JSON support comments?

No. Standard JSON does not allow // or /* */ comments. Formats such as JSONC and JSON5 do, but they are not plain JSON.

Is my JSON sent to a server?

No. Formatting and validation happen entirely in your browser, so it is safe to use with sensitive data.

See also:

UtiliTools · by Viniciusadm · 2023 - 2026