JSON Formatter
Prettify unreadable JSON with clean indentation, minify JSON onto a single line, or sort object keys alphabetically in your browser.
JSON Formatter Workspace
How to use
- 1
Step 1
Paste your raw or minified JSON data into the Input JSON box, or click Load Sample to see an example.
- 2
Step 2
Select Format / Beautify (with 2 Spaces, 4 Spaces, or Tab indentation) or Minify, and check Sort Keys (A-Z) if needed.
- 3
Step 3
Copy the formatted JSON to your clipboard or click Download .json to save it as a file.
Key features
- Formats compact or messy JSON with your choice of 2 spaces, 4 spaces, or tab indentation
- One-click Minify mode removes extra spaces and line breaks to shrink payload size
- Optional Sort Keys (A-Z) arranges object properties alphabetically at every level for easy comparison
- Shows helpful summary stats including total object keys, nesting depth, and input/output file size
Supported formats
File limits & notes
Supports JSON documents up to 10 MB directly in your browser. Follows standard JSON syntax rules (double-quoted keys and strings); if your file has comments or trailing commas, click Auto-Fix JSONC to clean them up automatically.
Frequently asked questions
View all FAQsIs my JSON data sent to any server when I format it?
No. All formatting, key sorting, and minifying happen locally in your browser so API responses, configs, and test data stay private.
Does Sort Keys (A-Z) change the order of items inside arrays?
No. Sorting only reorders named object keys alphabetically while keeping the exact order of items inside every array unchanged.
When should I use Minify mode?
Use Minify when you want to remove all unnecessary spaces and line breaks to make a JSON string as small as possible for API requests or configuration storage.
Practical Example: Making a Compact API Response Easy to Read and Compare
- Sample Input
- A single-line 450 KB API response with deeply nested objects and keys in random order.
- Result
- Formatted with clean 2-space indentation and alphabetically sorted keys so changes between two responses are easy to spot.