Paste any JSON and format it beautifully, minify it for production, or sort its keys alphabetically — with clear line and column errors when something is invalid.
Pretty-print any JSON with 2-space, 4-space or tab indentation so nested structures become instantly readable.
Recursively order object keys A→Z across the whole document, ideal for stable diffs, config files and API fixtures.
Strip all whitespace to produce compact JSON that is perfect for storage, transfer and HTTP payloads.
Invalid input is reported with the exact line and column, so you can fix syntax mistakes instead of hunting through the document.
Parsing follows the JSON spec exactly — trailing commas, single quotes and comments are caught and flagged rather than silently accepted.
Copy the formatted or minified output with one click, or download it as a .json file for use in your project.
JSON Formatter is a free in-browser tool that beautifies, validates, minifies and sorts JSON data. It reads your input strictly according to the JSON specification and, when the input is valid, rebuilds it with the indentation you choose — or removes all whitespace for a compact minified payload. Every object key can be sorted alphabetically, recursively, which makes the tool perfect for standardizing config files, API responses and test fixtures. Invalid input never breaks the page: instead you get a clear message pointing at the exact line and column of the problem. Because everything runs locally on your device, there are no uploads, no size limits and nothing leaves your computer.
Three steps from messy JSON to a clean, ready-to-use document.
Type, paste or upload a .json file into the input pane. The tool accepts any valid JSON — objects, arrays, strings, numbers, booleans and null.
Pick 2-space, 4-space or tab indentation, and optionally sort object keys alphabetically before formatting.
Click Format to pretty-print or Minify to compact the output, then copy it to your clipboard or download it as a .json file.
This tool follows strict JSON syntax: trailing commas, single-quoted strings and // or /* */ comments are not valid JSON and will be reported with a precise line and column error. Duplicate keys in an object are collapsed to the last value, matching how most parsers behave. Everything is processed locally in your browser.