About this tool

Prettify, minify and validate JSON data.

The JSON Formatter parses and reformats JSON data. Paste any JSON string and choose Prettify to get human-readable indented output, or Minify to strip all whitespace for compact transport. Validation errors are shown with the exact line and column of the problem. Useful for debugging API responses, editing config files, and inspecting data payloads.

Example

Input: {"name":"Alice","age":30,"active":true}

Formatted:

{\n  "name": "Alice",\n  "age": 30,\n  "active": true\n}
How to use
  1. Paste your JSON in the input field.
  2. Click Prettify for indented output or Minify to compact it.
  3. Validation errors appear with line / column info.
  4. Copy the formatted output.
Features
  • Prettify with 2 or 4 space indent
  • Minify (remove all whitespace)
  • Syntax validation with error location
  • Object key sorting option
  • Copy to clipboard
When to use this

API developers copying a raw JSON response from cURL or Postman and inspecting its structure before writing parsing code.

Config file editors checking that a JSON configuration file is valid before deploying — a single missing comma will break the app.

QA engineers comparing expected vs actual API response shapes by formatting both and diffing them visually.

Students learning JSON syntax: the formatter highlights exactly which line and character caused a parse error.

Frequently Asked Questions
What is JSON?+
JSON (JavaScript Object Notation) is a lightweight text format for structured data. It is the most common format for web API responses.
What does prettify do?+
Prettify parses the JSON and re-serialises it with consistent indentation and one property per line, making it human-readable.
Why does validation fail?+
Common causes: trailing commas (not valid in JSON), single quotes instead of double quotes, undefined or NaN values, or missing closing brackets. The error shows the exact location.
Is prettify lossless?+
Yes — all data values are preserved. Key order may change only if you enable the sort-keys option.
What is minified JSON?+
Minified JSON removes all whitespace and newlines to reduce file size. Use the Minify button to produce it. Useful for API responses and config files where bytes matter.
Does it support JSON5 or comments?+
No. This tool validates strict RFC 8259 JSON. Comments, trailing commas, and unquoted keys are not valid JSON and will trigger a syntax error.
Can I format very large JSON files?+
Yes — the formatter runs in the browser and handles files of any size, though very large inputs (10MB+) may take a second to process.

JSON Formatter

← All tools
Loading…
Related tools
CSV to JSON JSON to CSV URL Encoder / Decoder Base64 Encode / Decode
Also available in: 🇪🇸 Español🇮🇳 हिन्दी