JSON Formatter, Validator & Minifier
Paste JSON to check it against the strict JSON standard and get it back indented for reading or minified onto one line. Errors show the exact line and column, large numbers keep every digit, and nothing you paste leaves your browser.
Runs in your browser
Free, no sign-up. Parsing, formatting and downloads all run in your browser. The JSON you paste is never uploaded, logged or sent to analytics.
JSON Formatter / Validator / Minifier
Validate strict JSON, format it for reading, or minify it for production use.
JSON input
Output
Formatted or minified JSON will appear here.Status
Checking...
Output Chars
0
Keys
0
Depth
0
How to use the JSON Formatter
- Paste your JSON into the JSON input box, or press Sample to load an example. Clear empties the box.
- Choose Format to indent the output, or Minify to remove all whitespace.
- For Format, pick an indent of 2 spaces, 4 spaces or a tab. Tick Sort keys (A-Z) to order object keys alphabetically.
- Read the Status panel: Valid JSON shows the output with key count and nesting depth; Invalid JSON shows the error with its line, column and a caret under the problem.
- Press Copy to put the full output on your clipboard, or Download to save it as formatted.json or minified.json.
Worked example
Sample data
{"order":1042,"paid":true,"items":[{"sku":"A-7","qty":2}],"total":19.90}{
"order": 1042,
"paid": true,
"items": [
{
"sku": "A-7",
"qty": 2
}
],
"total": 19.90
}Format mode, 2-space indent, keys not sorted. The tool reports 6 keys and a maximum depth of 4. Note that 19.90 keeps its trailing zero: numbers are copied exactly as written, not re-printed by JavaScript.
How it works
What counts as valid JSON
JSON (RFC 8259) allows objects, arrays, double-quoted strings, numbers, true, false and null. Keys must be double-quoted strings.
Things many editors accept but JSON does not: single quotes, trailing commas, comments, unquoted keys, NaN, Infinity and leading zeros such as 007. This tool rejects all of them, so output that passes here will parse in any standards-compliant JSON parser.
Format vs minify
Format adds line breaks and indentation so nesting is easy to read in reviews, logs and documentation.
Minify removes every optional space and line break. The data is identical; only the size changes, which helps for payloads, config embedded in code, and storage.
Large numbers and precision
JavaScript stores numbers as 64-bit floats, so integers above 9,007,199,254,740,991 and long decimals are rounded by JSON.parse. Many formatters silently change such values.
This tool keeps the digits exactly as you wrote them and warns you when a number cannot be represented exactly by JavaScript, so you can send it as a string instead.
Number.MAX_SAFE_INTEGER = 2^53 - 1 = 9007199254740991
Duplicate keys and byte-order marks
JSON allows the same key twice in one object, but JSON.parse keeps only the last value. The tool keeps every occurrence in the output and lists the duplicates in a warning.
A UTF-8 byte-order mark at the very start of the input is removed and reported, because strict parsers reject it.
Inputs, outputs and limits
Inputs
- JSON text, pasted or typed
- Mode: Format or Minify
- Indent: 2 spaces, 4 spaces or tab
- Sort keys (A-Z) on or off
Outputs
- Formatted or minified JSON
- Validation status with line, column and caret for errors
- Output character count, key count and maximum nesting depth
- Warnings for precision loss, duplicate keys and a removed byte-order mark
- Copy to clipboard and download as .json
Limits
- Strict JSON only: no comments, trailing commas or single quotes (JSON5 and JSONC are rejected).
- Nesting deeper than 1,000 levels is rejected.
- The on-screen preview shows the first 200,000 characters; Copy and Download always include the full output.
- Inputs over 500,000 characters re-validate after a short pause so typing stays responsive.
Processing
- Parsing, formatting and downloads all run in your browser. The JSON you paste is never uploaded, logged or sent to analytics.
Frequently asked questions
Is my JSON uploaded anywhere?
No. The parser runs in this page's JavaScript. Your input is not sent to a server, not stored, and not included in analytics events, which record only actions such as format or copy.
Why does valid-looking JSON fail here?
Usually because it is JavaScript object syntax rather than JSON: single quotes, a trailing comma after the last item, comments, or unquoted keys. The error message names the character found and the exact line and column.
Does sorting keys change my data?
No values change. Sort keys (A-Z) reorders keys inside each object, at every level, which makes two documents easier to compare. Array order is never changed because it is meaningful in JSON.
Why do I see a precision warning?
At least one number has more digits than a JavaScript number can hold exactly. The output keeps your digits, but any code that parses the JSON with JSON.parse will round them. Send such IDs or amounts as strings.
Can it format JSON Lines or multiple JSON documents?
No. The input must be a single JSON value. Text after the first complete value is reported as an error.
Common uses
Need a custom internal tool or integration?
We build internal tools, APIs and integrations that fit your team's workflow, from a single admin screen to a full backend.