Skip to main content
toolsxulo

JSON Formatter

Format, minify, and explore JSON with a tree view, sorting, and file import/export.

Paste JSON, or drop a .json file

Nothing to format yet

Paste JSON above, drop a .json file, or use Upload file.

How it works

JSON is valid regardless of whitespace - {"a":1} and { "a": 1 } mean exactly the same thing to a computer. Formatting parses the structure and re-prints it with consistent indentation, purely for human readability; minifying does the opposite, stripping all non-essential whitespace to shrink the payload. Neither changes the underlying data.

Read the full guide

How to use it

  1. Paste your JSON into the input field, however messy or minified - or drop a .json file onto it.
  2. Pick Format or Minify, choose an indent size, and optionally sort keys alphabetically.
  3. Switch between Text and Tree view, then copy or download the result.

Examples

{"name":"Alex","tags":["a","b"]}{ "name": "Alex", "tags": ["a", "b"] }

Frequently asked

Does formatting change my data?
No. Formatting and minifying only change whitespace and line breaks - the keys, values, and structure stay exactly the same either way.
Why does it say my JSON is invalid?
Usually a missing comma, an extra trailing comma, or unquoted keys - JSON requires double quotes around every key and string value, unlike plain JavaScript object literals. The error message points to the exact line and column.
What does Tree view show that Text doesn't?
Tree view renders the parsed JSON as collapsible objects/arrays, so you can fold away large sections and scan a big payload's shape without scrolling through thousands of lines of text.