TanodTools

JSON formatter and validator

Paste JSON to tidy it, shrink it or check it, with the exact line and column of any error.

Runs entirely in your browser

Or paste below, or drop a file anywhere on this page.
Layout
Keys

Input up to about 10 MB, pasted or from a .json file.

How to format and validate JSON

  1. Paste your JSON into the box, or drop a .json file onto the page.
  2. Choose the layout: 2 spaces, 4 spaces, tabs, or minified. Turn on Sort keys if you want them alphabetical.
  3. If the JSON is invalid you see the line and column with a caret under the problem. Otherwise copy or download the result.

Formatting and checking JSON

JSON is a small, strict text format for data: objects in curly braces, arrays in square brackets, and values that are strings, numbers, true, false or null. Machines do not care about whitespace, but people do, so a formatter adds indentation and line breaks to make nested data readable, and a minifier removes them to save space.

This tool reads your text with its own parser, so it can point at the exact character where something goes wrong. The most common mistakes are a trailing comma after the last item, single quotes instead of double quotes, an unquoted key, a comment, or a missing bracket at the end. The error shows the line and column, a copy of that line, and a caret under the position.

Formatting only changes whitespace. Numbers and string escapes are kept as written, so a long ID such as 12345678901234567890 is not rounded the way it would be if the data were read into JavaScript numbers.

Tips

Questions

Is my JSON uploaded?

No. It is parsed and formatted in your browser and is never sent or stored, so it is fine to paste configuration or data you would not want to share.

What counts as valid JSON?

The standard format: double-quoted keys and strings, no comments, no trailing commas, no single quotes, no undefined or NaN. Many files that look like JSON, such as JavaScript object literals or config files with comments, are not strictly valid and will be flagged.

Does formatting change my data?

No. Numbers are kept exactly as written (even very long ones that JavaScript could not hold precisely), strings keep their escape sequences, and keys keep their order unless you turn on Sort keys. Only whitespace changes.

How does Sort keys work?

Keys in every object, at every level, are sorted alphabetically by their characters. Arrays keep their order, because the order of array items usually matters.

What do the stats show?

Input and output size in bytes, the total number of object keys at all levels, and the maximum nesting depth, where a flat object has depth 1.

How big can the input be?

About 10 MB. Larger input is refused rather than risking a frozen tab. The output well shows up to the first two million characters; Copy and Download always include all of it.