Skip to content

Free tool

JSON formatter and validator

Paste JSON to format it with clean indentation, minify it, or find exactly which line and column breaks it. Runs in your browser.

JSON input

Runs entirely in your browser: nothing you paste here is sent anywhere.

Valid JSON

{
  "name": "VitalRix",
  "checks": [
    {
      "type": "http",
      "interval": 60
    }
  ],
  "active": true
}

Common JSON errors

JSON is stricter than JavaScript, so text that looks right often is not:

  • Trailing commas after the last item in an object or array are not allowed.
  • Single quotes are not allowed; strings and keys need double quotes.
  • Unquoted keys ({name: 1}) are JavaScript, not JSON.
  • Comments (// or /* */) are not part of JSON.
  • Special values like undefined, NaN and Infinity are not valid; use null or a string.
  • Control characters inside strings (a raw newline or tab) must be escaped as \n or \t.

The validator shows the parser’s message with the line and column, which is usually one character after the real mistake.

Formatting for logs and APIs

Pretty-printed JSON is for people; minified JSON is for machines. Log in one line per event (minified, or structured logging with a JSON formatter) so tools can parse it, and pretty-print only when reading. API responses should be minified and compressed: whitespace adds bytes with no value to clients.

Validating API responses automatically

When an API returns broken JSON, every client fails. An API monitor can request an endpoint every minute, check that the body parses and that fields have the expected values, and alert before users notice. Check what an endpoint returns right now with the HTTP headers checker.

Using it safely at work

Online developer tools are a common way secrets leak: people paste production tokens, customer records or private keys into a website that quietly logs them. This page does all its work in your browser with standard Web APIs, makes no network request with your input, and stores nothing, so it is safe to use with real data, and you can confirm that in your browser’s network panel. Even so, treat anything you paste as you would treat a screenshot: rotate a token that was exposed, never share links that contain it, and prefer command-line tools on the server itself for very sensitive material.

Frequently asked questions

Is my data sent to a server?

No. This tool runs entirely in your browser; nothing you paste is uploaded or stored.

Why is my JSON invalid?

Most often a trailing comma, single quotes, unquoted keys or a comment.

How big a file can I format?

Several megabytes work in modern browsers; very large files are faster with a command-line tool such as jq.

What is the difference between format and minify?

Formatting adds indentation and line breaks for reading; minifying removes all optional whitespace.

More free tools

All tools