JSON Formatter

Free online JSON formatter and parser: paste JSON to parse and pretty-print it, find syntax errors, or minify it — right in your browser.

Suggested tools

XML Formatter

Beautify, minify and validate XML instantly in your browser.

XML
Open Tool

YAML Formatter

Re-indent YAML and check it for syntax errors, with line numbers.

YAML
Open Tool

JSON5 Formatter

Format JSON5 with comments, unquoted keys and trailing commas.

JSON5
Open Tool

HTML Formatter

Indent and tidy HTML, or minify it.

HTML
Open Tool

CSS Formatter

Beautify minified CSS into readable rules, or minify it.

CSS
Open Tool

SQL Formatter

Beautify or minify SQL queries in your browser.

SQL
Open Tool

About JSON Formatter

JSON Formatter pretty-prints, minifies and validates JSON. Paste a minified API response or a messy config file and get clean JSON with 2- or 4-space indentation, syntax highlighting and line numbers — or compress it to one line.

It also works as an online JSON parser: the document is parsed before formatting, so if the JSON is invalid you see the exact line and column of the problem. Numbers are kept exactly as written, so long IDs and precise decimals are never rounded, and duplicate keys are flagged. It runs entirely in your browser, so nothing you paste is uploaded.

How to use JSON Formatter

  1. Paste JSON, upload a .json file or click Sample.
  2. Press Beautify (choose 2 or 4 spaces), Minify, or Validate.
  3. Copy the result or download it.

Key features

  • Beautify, Minify and Validate in one place
  • Exact line and column for syntax errors
  • Big numbers never rounded
  • Duplicate-key warnings

Example

A minified API response, beautified with 2-space indentation.

Input
{"id":101,"name":"Asha Patel","city":"Surat","skills":["JSON","SQL"],"active":true}
Output
{
  "id": 101,
  "name": "Asha Patel",
  "city": "Surat",
  "skills": [
    "JSON",
    "SQL"
  ],
  "active": true
}

When to use JSON Formatter

  • Reading a minified API response while debugging.
  • Tidying a config file before committing it.
  • Finding the exact line of a JSON syntax error.

Tips and common problems

  • Use Validate first when the JSON comes from a hand-edited file.
  • Use 2 spaces for compact files and 4 spaces when you want deep nesting easier to scan.
  • For very large documents, the tree view in JSON Viewer is easier to explore.

Frequently asked questions

Many formatters parse JSON with JavaScript, which rounds integers above 2⁵³ — so 12345678901234567890 silently changes. This formatter never converts numbers.

Guides

  • How to Convert JSON to CSV — How to convert JSON to CSV: how arrays of objects map to rows and columns, how nested objects are flattened, and how to avoid losing data.
  • Base64 Explained — Base64 explained for beginners: what it is, why it exists, where it is used (data URIs, JSON, email), and when you should and should not use it.
  • JSON vs XML vs YAML — JSON vs XML vs YAML compared: strengths, weaknesses and best uses, to help you choose the right data format for APIs, config files and documents.