Search tools

JSON Formatter & Validator

Pretty-print messy JSON, find exactly where it’s broken, and sort keys — without sending your data anywhere.

JSON Formatter & Validator tool

Options

Processing runs in your browser.

Raw JSON from APIs, logs and config files is often a single unreadable line. A formatter adds indentation so you can see the structure, and a validator tells you exactly why a parser rejects your data. This tool does both instantly as you paste.

Typical uses

  • Debugging APIs: make a minified response readable and find the field you need.
  • Fixing config files: locate the stray comma that breaks package.json or a CI file.
  • Code review: sort keys before comparing two payloads so only real changes show up.
  • Documentation: paste neatly indented examples into READMEs and tickets.

Need the opposite? The JSON Minifier strips all whitespace for smaller payloads.

How to use the JSON Formatter & Validator

  1. Paste JSON into the left box, or click Open file to load a .json file.
  2. Read the formatted result on the right. If the JSON is invalid, the error shows the line and column of the problem.
  3. Choose 2 spaces, 4 spaces or tabs, and tick Sort keys to order object keys alphabetically.
  4. Copy the result or download it as a .json file.

Features

  • Strict validation against the JSON standard (RFC 8259), with line and column for every error.
  • Plain-English hints for common mistakes: trailing commas, single quotes and missing brackets.
  • Recursive key sorting, handy for comparing two JSON files in the Diff Checker.
  • Runs locally, so API responses with tokens or customer data stay on your machine.

Frequently asked questions

Why is my JSON invalid when it works in JavaScript?

JavaScript object syntax is looser than JSON. JSON requires double quotes around every key and string, and doesn’t allow trailing commas, comments, single quotes, undefined or NaN. The error message points to the first place that breaks these rules.

Is it safe to paste API responses with tokens or personal data?

Yes. Formatting happens with your browser’s built-in JSON parser. Nothing is uploaded, logged or stored, which is why this is safer than many online formatters for production data.

Can it handle large files?

Files of several megabytes format in well under a second on a normal computer. Very large files (100 MB+) depend on your device’s memory.

Does sorting keys change my data?

No. JSON objects are unordered, so sorting keys doesn’t change their meaning. Array order is always kept, because it does matter.

Written by