Skip to content

JSON Formatter

In-browser only Keeps every value exact 2, 4 or tab indent

Which tool?Format make it readableMinify smallest sizeLint syntax check, strict rules and duplicate keys

The result appears here once you enter JSON.
Runs entirely in your browser — your JSON never leaves this page.

Overview

Pretty-print JSON without changing a single value

Pretty-print messy JSON with clean, consistent indentation. Only whitespace changes — numbers, strings and key order stay exactly as you wrote them.

Guide

How to use

  1. 1
    Paste your JSON

    Type, paste, or use the Paste button to pull JSON from your clipboard. The Sample button loads a small example to try.

  2. 2
    Pick an indentation

    Choose 2 spaces, 4 spaces, or Tab. The formatted result updates instantly.

  3. 3
    Check the result

    The pretty-printed JSON appears next to your input. If the JSON is broken, you see the line, column, and a plain-language explanation instead.

  4. 4
    Copy or download

    Use Copy to send the result to your clipboard. On the Format and Minify pages you can also Download it as a .json file.

Pitfalls

Common JSON mistakes

  • Expecting the formatter to fix errors

    A formatter never guesses what you meant. If the JSON is broken it shows where — fix that spot first, then the formatted result appears.

  • Large numbers rounded by other tools

    Many formatters parse numbers into JavaScript floats, so 12345678901234567890 comes back as 12345678901234567000. This formatter copies the digits exactly as written.

  • Mixing tabs and spaces

    Switching indentation style creates noisy diffs. Pick the style your project already uses and keep it.

  • Duplicate keys hidden in long objects

    Formatting keeps both copies of a duplicated key and points them out. Use JSON Lint to list every one before you ship the file.

Frequently asked questions

What indentation should I use — 2 spaces, 4 spaces, or tab?
It depends on your team's style guide. 2 spaces is the most common default in JavaScript and TypeScript projects, 4 spaces is popular in Python and Java, and tabs let each developer set their own display width. All three produce equally valid JSON.
Does formatting change my data?
No. Formatting only changes the whitespace between tokens. Every key, string and number is copied exactly as you wrote it: key order stays the same, large integers such as 12345678901234567890 keep every digit, and duplicate keys are kept (and pointed out) rather than silently dropped.
Is my JSON sent to a server?
No. Formatting runs entirely in your browser. Your data never leaves your device — you can confirm this in your browser's network tab.
It says my JSON is invalid — what now?
The formatter needs valid JSON to pretty-print. When parsing fails it shows the exact line and column of the problem with a plain-language explanation. To see every issue at once, open JSON Lint — your input comes with you.