Tools Nimbus

Tool 002 / dev / free / runs locally

JSON Formatter & Validator

Paste JSON to pretty-print it with proper indentation and validate the structure. If something's wrong, we point you at the line and column. All formatting happens in your browser, so nothing is sent to a server.

{
  "name": "Tools Nimbus",
  "tools": 5,
  "private": true
}

How it works

The JSON formatter parses your input with the browser's native JSON.parse, then re-serialises it with JSON.stringify using the indentation you pick. Because it uses the same parser the browser uses for real code, what it accepts is exactly what a strict JSON consumer accepts: double-quoted keys, no trailing commas, no comments, and no single quotes.

When parsing fails, the tool reads the position offset out of the browser's error message and walks the text to convert that offset into a line and column number, so instead of a vague Unexpected token you get a place to look. Valid input is reformatted; the structure is preserved exactly, only the whitespace changes.

You can switch between 2 spaces, 4 spaces, and tab indentation. Two spaces is the default because it matches what most modern style guides and formatters (Prettier, the npm ecosystem) emit. Everything runs in your tab, so pasting a config file or an API response with secrets in it never leaves your machine.

How to use it

  1. Paste your JSON into the Input box on the left.
  2. Pick an indentation style: 2 spaces, 4 spaces, or Tab.
  3. Read the formatted result on the right; the label shows Valid JSON or Invalid JSON.
  4. If it is invalid, jump to the reported line and column to fix the error, then click Copy output.

Worked examples

Input: {"name":"Tools Nimbus","tools":5,"private":true}

Output: { "name": "Tools Nimbus", "tools": 5, "private": true }

Default 2-space indentation, keys and values spaced for reading.

Input: {"a": 1,}

Output: Invalid JSON, with the error pointing at the trailing comma before the closing brace.

Trailing commas are valid in JavaScript but not in JSON.

Edge cases and limits

  • Strict JSON only. Comments, trailing commas, single quotes, and unquoted keys are rejected, because JSON.parse rejects them. Use a JSON5 tool if you need those.
  • Numbers are reformatted by the JavaScript number type, so very large integers beyond 2^53 or high-precision decimals can lose precision on a round trip.
  • Key order is preserved as written, but duplicate keys collapse to the last value, matching how JSON.parse behaves.
  • Files in the tens of megabytes work on desktop browsers; multi-hundred-megabyte files can exhaust tab memory because the whole structure is held in memory at once.

Common mistakes

  • Pasting a JavaScript object literal (with single quotes or unquoted keys) and expecting it to validate. That is JS, not JSON.
  • Copying JSON that was wrapped in a string by an API (escaped quotes everywhere). Unescape it first or you are formatting a string, not an object.
  • Assuming the formatter fixes errors. It validates and reformats valid input; it cannot guess what a broken structure was meant to be.

Frequently asked questions

Does Tools Nimbus save my pasted JSON anywhere?+

No. Validation and formatting happen entirely in your browser. We never upload your JSON, log it, or store it.

What indentation does the formatter use?+

You can switch between 2 spaces, 4 spaces, and tabs. The default is 2 spaces, which matches what most modern style guides recommend.

Can it handle very large JSON files?+

Yes, but your browser is the limit. Files in the tens of megabytes range usually work fine on modern desktops. For multi-hundred-MB files, a streaming parser in a script is a better choice.

More Developer tools that run entirely in your browser.