Tools In Orbit

JSON Formatter

Pretty-print and validate JSON.

Format and validate JSON with proper indentation, and catch syntax errors instantly.

How it works

Your input is parsed with the browser's built-in JSON parser. If it's valid, it's re-printed with consistent indentation; if not, the parser's error message shows what went wrong.

When it helps

Makes API responses and config files readable, and quickly spots a missing comma or quote.

JSON rules in brief

JSON (JavaScript Object Notation) stores data as objects in curly braces and arrays in square brackets. Keys must be strings in double quotes, and values can be strings, numbers, true, false, null, objects or arrays. Comments aren't allowed, and the last item in a list must not be followed by a comma.

Because the rules are strict, a single missing quote breaks the whole document. A formatter that validates as it indents is the fastest way to find the problem.

Worked example

The minified text {"name":"Ada","skills":["math","code"],"active":true} becomes an indented block with each key on its own line, which makes nested data easy to scan. If you paste {'name': 'Ada'}, the tool reports an error because JSON requires double quotes.

Formatted JSON is easier to compare in code reviews and diffs. When sending data over the network, minified JSON is smaller, so keep both forms in mind.

Frequently asked questions

Why is my JSON invalid?

Common causes are trailing commas, single quotes instead of double quotes, and unquoted keys. JSON is stricter than JavaScript.

Is my data sent anywhere?

No. Formatting runs entirely in your browser, so it's safe to use with private data.

Can it handle large files?

Yes, within the limits of your browser's memory. Very large files (tens of megabytes) may take a moment to format.

Tools In Orbit · About · Contact · Privacy · Terms