JSON Formatter

Paste minified or slightly broken JSON and get clean, indented, readable output — with automatic repair for common syntax mistakes.

  • Free
  • No signup
  • Private

Invalid JSON is auto-repaired when possible (missing ], trailing commas, etc.) then formatted.

Overview

Paste minified or slightly broken JSON and get clean, indented, readable output — with automatic repair for common syntax mistakes.

Benefits

  • Auto-repairs trailing commas and missing brackets
  • Instant, readable indentation
  • Runs locally, safe for private data
  • No account or install required

Use Cases

  • Debugging malformed API responses
  • Reading minified config files
  • Cleaning up JSON pasted from logs
  • Preparing JSON for documentation

Users Also Use

How to Use

  1. Paste your JSON in the input area.
  2. Click Repair & Format to fix common errors and prettify with indentation.
  3. Copy the formatted output.

What is a JSON formatter?

A JSON formatter, also called a JSON beautifier or pretty printer, takes compact or messy JSON and rewrites it with consistent indentation and one value per line. This tool indents with two spaces, which is the style most APIs, linters and code editors use. Formatting does not change the data itself, only the whitespace around it, so the result is easier to read, review and compare.

Automatic repair of common mistakes

If your input is not valid JSON, the formatter first tries to repair it. It removes trailing commas before a closing bracket and closes brackets or braces that were left open, then formats the result. A message tells you when a repair was made, so you know the output is not identical to what you pasted. If the JSON cannot be repaired, the error from the parser is shown instead. To check JSON strictly without any repair, use the JSON Validator.

Worked example

Input on one line, including a trailing comma:

{"name":"AtoZee","tags":["json","tools",],"active":true}

Formatted output:
{
  "name": "AtoZee",
  "tags": [
    "json",
    "tools"
  ],
  "active": true
}

Things to know before you format

  • Very large integers above 9,007,199,254,740,991 lose precision when parsed in JavaScript. Keep IDs like these as strings.
  • If an object has the same key twice, only the last value is kept.
  • Numbers are rewritten in their shortest form, so 1.50 becomes 1.5 and 1e3 becomes 1000.
  • Comments are not part of the JSON standard and are not kept.

Privacy

Formatting runs entirely in your browser. API responses, configuration files and tokens you paste are not uploaded to our server.

FAQ

Does it fix invalid JSON?
Yes. The tool auto-repairs common issues such as missing closing brackets, trailing commas, and unclosed arrays before formatting.
Is my JSON sent to a server?
No. Formatting and repair both run locally in your browser, which makes it safe for private API keys or internal data.
Can it minify JSON as well as beautify it?
The main focus is beautifying and repairing minified or broken JSON into readable, indented output for debugging.
What indentation does the JSON formatter use?
Two spaces per level, which matches the default of most code editors and JavaScript's JSON.stringify.
Will formatting change my data?
Only whitespace changes for valid JSON. If repair was needed, trailing commas are removed and missing brackets are added, and a message tells you that happened.
Can it format JSON with comments?
No. Comments are not valid JSON, so they are not kept in the output.
How do I make the JSON small again?
Use the JSON Minify tool to remove all indentation and line breaks.

Keep exploring