SanWebCorner · Developer Tools

JSON Formatter & Validator Online

Format, validate, minify and sort JSON in your browser without rounding large numbers. Paste your data or open a local file, choose an action, then copy or download the result.

Free · no signupLocal browser processingCopy & download

How to format and validate JSON

  1. Paste JSON into Input JSON, open a local .json file, or load the sample.
  2. Choose 2 spaces, 4 spaces or tabs for indentation.
  3. Select Format JSON, Validate, Minify or Sort Keys. Ctrl/Cmd + Enter formats the input.
  4. Copy output or download formatted.json. Editing the input clears the old output.

What each action does

Action Result
Format JSON Adds indentation while preserving number tokens, string escapes and original key order.
Validate Checks syntax and reports line and column for errors; creates no output.
Minify Removes whitespace outside strings without converting numbers.
Sort Keys Recursively orders decoded property names using UTF-16 string order. Array order stays unchanged.

JSON formatting example

Compact input:

{"name":"SanWebCorner","id":9007199254740993,"active":true}

Formatted output:

{
  "name": "SanWebCorner",
  "id": 9007199254740993,
  "active": true
}

Large numbers and duplicate keys

Ordinary JavaScript parse-and-stringify workflows can round integers beyond the safe Number range. This formatter keeps numeric tokens as text while checking their grammar, so the number above remains exactly as entered. It does not perform arithmetic or convert a number to a different notation.

Duplicate property names are accepted by the JSON grammar but cause interoperability problems. This tool reports them; Format and Minify preserve every occurrence in its original order. Sorting is blocked when duplicates exist. It does not silently discard a value. These choices follow the interoperability concerns described in RFC 8259.

Common JSON syntax errors

Check for trailing commas, missing commas, unquoted names, single quotes, invalid escapes or unmatched braces. JSON strings and property names require straight double quotes. Comments are not part of standard JSON. The formatter reports the line and column rather than silently repairing the document.

{"name":"Example","active":true}

Privacy and limits

The formatter code processes pasted text and opened files in your browser. It does not send input to a formatting API or save it in local storage. Normal website services, including advertising and analytics, still run on this page; this is not an isolated offline environment. Use an offline tool for data that must never be entered into a website.

Input is limited to 2 MiB of UTF-8 text and 128 nesting levels to keep the tool practical in a browser. For larger files, use a suitable local editor. A valid result confirms JSON syntax, not a schema, API contract or the trustworthiness of its contents.

Frequently asked questions

Is this JSON formatter free?

Yes. No account, installation or API key is required.

Does it support arrays and primitive JSON values?

Yes. The root can be an object, array, string, number, true, false or null. Empty input is not valid JSON.

Does sorting change array order?

No. Only object members are reordered. This is a readability sort, not a cryptographic canonicalization algorithm.

Can I upload a JSON file?

Open JSON file reads a file locally into the editor. The formatter does not upload that file to a server.

Why are copy and download disabled?

Create valid output first. Input edits and processing errors clear previous output so it cannot be mistaken for a current result.

More developer tools