Skip to content
DevKit
Menu

JSON Formatter & Validator

Format, validate and minify JSON with precise error locations.

Processed locally in your browser. Your input never leaves this device.

Indent

Input

Output

What does the JSON Formatter do?

This tool formats (pretty prints) JSON so it is easy to read, minifies it so it is as small as possible, and validates it against the JSON specification (RFC 8259).

When the input is not valid JSON, you get the exact line and column of the problem and a plain-English explanation — for example a trailing comma, a single-quoted string or a missing closing bracket.

How to use it

  1. Paste or type JSON into the input editor, or load the example.
  2. Choose an indentation of 2 spaces, 4 spaces or tabs.
  3. Select Format (or press Ctrl/⌘ + Enter) to pretty print, or Minify to remove whitespace.
  4. Copy the result or download it as output.json.

Example

Input
{"id":12345678901234567890,"name":"Ada","tags":["math","code"],"active":true}
Output
{
  "id": 12345678901234567890,
  "name": "Ada",
  "tags": [
    "math",
    "code"
  ],
  "active": true
}

Common use cases

  • Reading a minified API response while debugging.
  • Finding the exact location of a syntax error in a configuration file.
  • Minifying JSON before embedding it in a request, environment variable or fixture.
  • Normalising indentation before committing JSON files or comparing them.

Frequently asked questions

Is my JSON sent to a server?

No. Formatting, minifying and validation run entirely in your browser. The page does not upload, store or log what you paste.

Will formatting change my numbers?

No. Many formatters convert JSON through JavaScript numbers, which silently rounds integers larger than 2^53 (such as 64-bit IDs). This formatter keeps every number, string and escape sequence exactly as written and only changes whitespace.

Why is my JSON invalid when JavaScript accepts it?

JSON is stricter than JavaScript object syntax. Property names and strings must use double quotes, trailing commas and comments are not allowed, and values like undefined, NaN or Infinity do not exist in JSON.

What happens with duplicate keys?

The JSON specification discourages duplicate keys, and most parsers silently keep only the last one. This tool preserves both entries in the output and shows a warning so you can fix the source.

How large a file can I format?

Files of several megabytes format comfortably. Large inputs are processed in a background thread so the page stays responsive, and inputs above 50 MB are refused to protect your browser.