Skip to main content

JSON Formatter & Validator

Paste JSON to format or minify it as you type, find the exact line of any error, and fix common mistakes in one click.

Runs 100% in your browser

Shortcuts
Copy the output
Alt + Shift + C

Your input is saved in this browser only. Reset clears it.

Indent

How to use the JSON Formatter & Validator

  1. Paste JSON into the input. Valid JSON is formatted as you type.

  2. Choose Format or Minify, the indent, and whether to sort keys. Switch to Tree to explore nested data.

  3. Copy or download the output. If there's an error, jump to its line or apply a quick fix.

Example: Formatting a minified API response

Paste the response as it came back from the API; the formatted version appears as you type.

Input
{"id":8812,"items":[{"sku":"A-1","qty":2}],"paid":true}
Output
{
  "id": 8812,
  "items": [
    {
      "sku": "A-1",
      "qty": 2
    }
  ],
  "paid": true
}

Switch to Minify to go the other way, or Tree to collapse nested objects while you explore the structure.

Frequently Asked Questions

What is a JSON formatter?

A JSON formatter (also called a JSON beautifier or JSON pretty printer) takes minified or unreadable JSON and adds indentation and whitespace to make it human-readable. DevBottle's JSON Formatter also validates your JSON and highlights exactly where parse errors occur.

Why is my JSON invalid?

The most common JSON parse errors are: trailing commas after the last item in an object or array (not valid in JSON), single quotes instead of double quotes for strings or property keys, unquoted property keys, and comments (JSON does not support comments). The error message shows the exact line and character where the problem is.

What is the difference between formatting and minifying JSON?

Formatting (beautifying) adds whitespace, newlines, and indentation to make JSON easy to read. Minifying does the opposite — it removes all unnecessary whitespace to produce the smallest valid JSON string, which reduces payload size in API responses and config files.

Is this JSON formatter free to use?

Yes. DevBottle's JSON Formatter & Validator is completely free, runs entirely in your browser, and requires no account or installation. Your JSON data never leaves your device.

About the JSON Formatter

JSON is supposed to be readable. The version that comes back from most APIs isn't. This tool turns minified payloads into something a human can read, strips whitespace back out when you need a compact string, and tells you exactly what's wrong when something won't parse.

Common parse errors and how to fix them are explained in How to Format, Validate, and Debug JSON, and Online JSON Formatters Compared covers what to look for in a formatter.

Paste your JSON and it's formatted as you type: a clean indented block (2 spaces, 4 spaces, or tabs, your call) with the key count, line count, and byte size shown above it. That last one matters more than people expect — it's easy to forget how much a formatted payload weighs vs. its minified version. Minify does the reverse: down to the smallest valid string. Validation runs continuously, and when something doesn't parse you get the exact line and column, the line highlighted in the editor, and one-click fixes for trailing commas, single quotes, unquoted keys, and comments. No scrolling through 200 lines hunting for a trailing comma.

Where you'll use it

Inspecting API responses. Cleaning up package.json or tsconfig.json that have gotten messy. Preparing payloads for Postman or curl. Debugging why your app throws a parse error when the config looks fine. Minifying before committing so JSON diffs are actually readable.

Pro Tip

The most common parse errors are trailing commas after the last item in an array or object, single quotes instead of double quotes, and unquoted property keys. The error message points to the exact line and character, so you don't have to scan the whole thing manually.

JSON Beautifier, Pretty Printer, and Formatter — What's the Difference?

These terms describe the same operation. A JSON beautifier adds whitespace and indentation. A JSON pretty printer does the same with styled output. A JSON formatter is the umbrella term. Online, you'll also see "format JSON", "JSON viewer", and "JSON editor online" — they all solve the same problem. This tool covers all three modes in one place: beautify, minify, and validate — with byte-size output so you know exactly what your payloads weigh before and after.

Format vs. Minify vs. Validate

Format

Adds indentation and line breaks for readability. Use when reading, debugging, or code-reviewing. Choose 2-space or 4-space indent.

Minify

Strips all whitespace to the smallest valid string. Use for API payloads, fixtures, or configs where whitespace is pure overhead.

Validate

Runs a strict parse check and reports the exact position of any error. Use when you just need a yes/no on whether it will parse.

Works With Any JSON

API responses, package.json, tsconfig.json, environment configs, test fixtures, webhook payloads. Paste it in and the online JSON formatter handles the rest. All processing runs in your browser — nothing is sent to a server and there's no file size limit.