JSON Formatter

Input JSON
1
Formatted JSON
Output appears here…
2sp · 14px · UTF-8

What is a JSON Formatter?

A JSON formatter (also called a JSON beautifier or pretty printer) takes compact or minified JSON and adds proper indentation and line breaks, making it easy to read. Minified API responses that arrive as a single unreadable line become structured, hierarchical and scannable in one click.

How to Format JSON

  1. 1Paste your raw or minified JSON into the left input panel
  2. 2Click Format or press Ctrl + Enter
  3. 3Formatted JSON appears in the right output panel instantly
  4. 4Click Copy or Download to save your result

Example

Input (minified):

{"name":"Ravi","age":28,"city":"Surat","active":true}

Output (formatted with 2 spaces):

{
  "name": "Ravi",
  "age": 28,
  "city": "Surat",
  "active": true
}

Features

Live validation

Errors highlighted as you type with exact line and column

Syntax highlighting

Keys, strings, numbers and booleans in distinct colours

Collapsible nodes

Fold any object or array to focus on the parts you need

Four output views

Code, interactive Tree, tabular Table, and a Stats view — key/value counts, max depth and byte size

Find & Replace

Ctrl+F to find, Ctrl+H to find and replace one match or all of them

Undo & redo

Step backward or forward through edits with dedicated buttons, not just browser undo

Sort keys

Alphabetically sort all keys at every nesting level

Input history

Every version you've formatted here is saved locally — pin the ones you want to keep, restore any with one click

Share via link

Compress your JSON straight into a URL — nothing is uploaded, the link itself carries the data

Load from file or URL

Upload a .json file or paste a URL to fetch and format its response directly

Line wrap & font size

Toggle line wrapping and adjust text size for long lines or dense JSON

Session auto-save

Your last JSON is restored automatically when you return

Views: Code, Tree, Table & Stats

The output panel isn't just formatted text — switch views with the tabs above it to look at your JSON from a different angle without reformatting anything:

CodeThe classic syntax-highlighted, indented view — best for copying into source code or a request body.
TreeAn interactive, collapsible node tree. Expand only the branches you need in a deeply nested document instead of scrolling past everything else.
TableRenders a JSON array as rows and columns, so you can scan records the way you would a spreadsheet — useful for API responses that are lists of similar objects.
StatsA breakdown of your document: total keys, maximum nesting depth, how many strings/numbers/booleans/nulls it contains, and the byte size of the input and output.

Keyboard Shortcuts

Every shortcut works with Cmd on Mac in place of Ctrl.

Ctrl + EnterFormat the JSON in the input panel
Ctrl + Shift + CCopy the formatted output to your clipboard
Ctrl + FOpen Find, to search within your JSON
Ctrl + HOpen Find & Replace
Ctrl + Z / Ctrl + YUndo or redo your last edit
EscClose the Find bar or History panel

Common JSON Errors

Missing commaAdd a comma after every property except the last one
Trailing commaRemove the comma after the last property or array item
Single quotesReplace all ' with " — JSON requires double quotes
Unquoted keysWrap every key in double quotes: name → "name"
undefined or NaNReplace with null — these values are not valid JSON

Frequently Asked Questions

Yes. All JSON processing happens entirely in your browser using JavaScript. Your data is never sent to our servers.

You can choose between 2 spaces, 3 spaces and 4 spaces. 2 spaces is the most common convention used by JavaScript and most REST APIs.

There is no hard limit. Files up to several megabytes work without slowdown because processing runs in your browser.

Paste the URL into the input — the formatter will detect it and offer to load the JSON from that endpoint.

Click Share to generate a link with your JSON compressed directly into the URL — nothing is uploaded to a server, so the link itself is the only place your data lives. Send it however you like.

Yes. Every version you format is kept in a local history panel on your device — pin the ones you don't want cleared, rename them, and restore any with one click. Nothing in that history ever leaves your browser.

Tree lets you collapse and expand nested objects and arrays to focus on one branch at a time. Table renders a JSON array as rows and columns like a spreadsheet. Stats summarizes the document — key count, max depth, value-type breakdown, and byte size — useful for sanity-checking a large payload at a glance.

Related Tools