How to use
Use this formatter to clean up JSON for debugging, reviews, or production.
- Paste JSON into the input box.
- Choose indent and options (Sort Keys / Lenient / Auto-format).
- Click Format (pretty) or Minify (compact), or Validate.
- Copy the result from the output box.
FAQ
Does this JSON formatter upload my data?
No. Formatting and validation run locally in your browser.
What’s the difference between Format and Minify?
Format adds indentation and newlines for readability; Minify removes whitespace to make JSON compact.
Can I sort JSON keys?
Yes—enable Sort keys (deep) to alphabetize keys at every object level.
Can it handle JSON with comments or trailing commas?
Standard mode is strict JSON. Turn on Lenient to strip //, /* */ comments and trailing commas before parsing.
Why do I get “Unexpected token” errors?
Usually it’s invalid JSON (single quotes, unquoted keys, trailing commas in strict mode, or a missing brace). Enable Lenient if your input contains comments/trailing commas.
What indent options are supported?
Choose 2 spaces, 4 spaces, or tabs from the Indent menu.
Will formatting change key order?
Without sorting, output typically follows the input’s insertion order. With sorting enabled, keys are reordered alphabetically.