Skip to content
AnyToolBox

Search tools

Find a tool by name or keyword

JSON Formatter & Validator

Pretty-print, minify and validate JSON with exact error locations, sorted keys and custom indentation.

100% Client-Side

Paste or load JSON, then format or minify it — syntax errors are pinpointed by line and column.

How to use the JSON Formatter & Validator

  1. 1

    Paste JSON into the input box or load a .json file from your device.

  2. 2

    Choose the indentation (2 spaces, 4 spaces or tabs) and whether to sort keys alphabetically.

  3. 3

    Click Format to pretty-print or Minify to strip all whitespace.

  4. 4

    If the JSON is invalid, jump straight to the reported line and column to fix it.

  5. 5

    Copy the result or download it as a .json file.

Frequently asked questions

No. Parsing and formatting happen in your browser with its built-in JSON engine, so API responses, config files and tokens inside them never leave your device.

The validator shows the parser's error message along with the line and column where it failed, and highlights that spot in the input. Common culprits are trailing commas, single quotes and unquoted keys, which strict JSON doesn't allow.

It reorders the keys of every object, at every depth, alphabetically. Array order is never changed. This makes two JSON documents much easier to compare side by side.

Numbers are parsed as standard JavaScript numbers, so integers above 9,007,199,254,740,991 (2^53 − 1) may be rounded when formatted. If your data has 64-bit IDs, keep them as strings.

There's no fixed limit, but everything runs in your browser's memory. Files of a few megabytes format instantly; files of 50 MB or more may be slow on phones.

Missing a feature or tool?

Tell us what would make JSON Formatter & Validator more useful, or what to build next.