JSON formatter
Pretty-print JSON with 2-space indentation, or minify it to a single line. Invalid JSON gets a clear error.
Runs entirely in your browser — your text is never uploaded.
How to format JSON
- 1
Paste your JSON
Add the JSON you want to clean up or check.
- 2
Format or minify
Choose Format for readable output, or Minify to strip whitespace.
- 3
Copy the result
Copy the formatted JSON with one click.
Why use this JSON formatter
Validates as it formats
Invalid JSON is reported with the exact parser error.
Format or minify
Readable 2-space output, or the smallest possible single line.
Safe for real data
Everything runs in your browser — API responses and payloads are never uploaded.
Privacy
This tool runs entirely in your browser. Your JSON is never uploaded to a server and we never see it — safe for real API payloads.
JSON formatter FAQ
- Is it safe to paste sensitive data?
- The tool runs fully in your browser and makes no network request, so your JSON never leaves your device.
- Why does my JSON say it is invalid?
- Common causes are trailing commas, single quotes instead of double quotes, and unquoted keys. The error message shows the position.
- What indentation does it use?
- Two spaces, which is the most common convention for JSON and JavaScript projects.
Related tools
Word counter
Count words, characters, sentences, and paragraphs instantly. Free online word counter that runs in your browser — no upload, no signup.
Case converter
Convert text between UPPERCASE, lowercase, Title Case, camelCase, snake_case, and kebab-case. Free, instant, and runs in your browser.
Slug generator
Turn any title into a clean, SEO-friendly URL slug. Removes Vietnamese diacritics correctly, including đ. Runs in your browser.