💻 Developer Tools

JSON Formatter

Paste your JSON and see it formatted, validated, or minified in real time. Works on messy or minified JSON alike. Nothing leaves your browser.

Examples (click to try)

How to Use the JSON Formatter

New here? Start by clicking one of the "Examples (click to try)" chips just above the input — a sample JSON is loaded and formatted instantly. Once you're comfortable, just type or paste JSON into the text area above. Pasting formats it live on the spot, so no button press is needed. Want a single line instead? Click the "Minify" button at the top-left to switch the same JSON to compact form immediately.

Worked example: turning minified JSON readable

Say an API returns this single line of JSON. Paste it in:

{"name":"Benri","tags":["dev","text"],"meta":{"free":true,"login":false}}

In "Format" mode it lines up like this (2-space indent):

{
  "name": "Benri",
  "tags": [
    "dev",
    "text"
  ],
  "meta": {
    "free": true,
    "login": false
  }
}

Click "Minify" and the formatted JSON collapses straight back into the original single line.

  • Format (pretty print): Adds indentation to make JSON human-readable. Choose between 2 spaces, 4 spaces, or tabs.
  • Minify: Removes all unnecessary whitespace and newlines to produce compact, single-line JSON — useful before embedding JSON in an API request.
  • Sort keys: Sorts all object keys alphabetically in ascending order. Handy when comparing two JSON objects.
  • Error display: If a syntax error is detected, an error message along with an estimated line and column number is shown.

Common Use Cases

  • Inspecting and debugging API responses or webhook payloads
  • Syntax-checking config files (package.json, tsconfig.json, etc.) after editing
  • Aligning keys before a code review to make diffs cleaner
  • Converting minified JSON back into a readable format

Frequently Asked Questions

Is my JSON data sent to any server?
No. All processing happens entirely within your browser. Your input is never sent to or stored on any server. It is safe to use even with JSON containing API keys or personal information.
Can I identify where a syntax error occurred in my JSON?
Yes. When parsing fails, the tool analyzes the browser's error message and displays an estimated line number and column number for the error. This helps you quickly locate problems even in large JSON documents.
What does the Sort Keys option do?
When Sort Keys is enabled, all object keys in the JSON output are sorted alphabetically in ascending order. This is useful when comparing two JSON objects or making diffs easier to read.