JSON Formatter

Developer Tools

Format, validate and explore JSON in code, tree, form, text or read-only view.

Runs entirely in your browser โ€” nothing is uploaded

Features

  • Five ways to read the same document: code, tree, form, text and view.
  • Collapsible tree for large payloads, with expand-all and copy-the-path on any row.
  • Form view edits values in place and rewrites the JSON as you go.
  • Two-space, four-space or tab indentation, plus one-click minify.
  • Validation errors report the line, column and offset of the offending character.
  • One-click sample documents, formatted the moment you pick one.

How to use the JSON Formatter

  1. 1Paste your JSON, or load one of the samples to try it.
  2. 2Pick an indentation width, or hit Minify to collapse it.
  3. 3Switch to Tree to fold away the parts you do not need, or Form to edit values.
  4. 4Copy the formatted result or download it as a .json file.

Frequently asked questions

What is the difference between the code, tree, form and text views?

Code is the formatted document with syntax highlighting and line numbers. Tree folds each branch away so a large API response stays readable, and hovering a row lets you copy its path. Form is the tree with editable values, leaving keys and structure fixed. Text is a plain editable textarea. View is the tree without any editing affordances, for when you only want to read.

Is my JSON sent to a server?

No. Formatting and validation run locally with the browser JSON parser, so payloads never leave your machine.

Why does it reject trailing commas?

Trailing commas are invalid in the JSON spec even though JavaScript allows them. The error message points at the offending character so you can strip it โ€” load the "Broken JSON" sample to see what that looks like.

Can I edit the JSON in the tree?

Values, yes โ€” switch to Form view and edit them in place, and the source is rewritten so every view stays in step. Keys and structure are deliberately fixed there; change those in the input on the left, which is faster than clicking through a tree anyway.

Can it handle very large files?

Yes โ€” several megabytes format comfortably. For anything big, the tree view is the practical one: it opens two levels by default so you can drill into the part you care about rather than scrolling a wall of text.