Format and validate JSON with JSONLint
A practical review of using JSONLint as a JSON validator and formatter: what it changes, what it should leave alone, and when to use an offline tool instead.
JSONLint is widely used as an online JSON validator and formatter. You paste JSON into it, it reports whether the text is syntactically valid, and it presents the data in an indented layout. This review explains what that transformation does to your text, where it helps, and where it may not be the right choice. No independently confirmed details about the current version of the tool were available for this review, such as size limits, exact error wording, or data-handling practices. Those points are flagged as open questions rather than stated as facts.
Is JSONLint suitable for your use?
For quick checks of non-sensitive JSON, such as a configuration snippet, a sample API response or a hand-edited fixture, an online validator like JSONLint is a reasonable fit. Its main benefit is speed. It tells you whether the text parses as JSON and makes nested structures easier to read.
The main tradeoff is that you send your data to a web page you do not control. This review found no confirmed information about how pasted content is processed or retained, and a tool's appearance or marketing should not be taken as evidence either way. If the JSON contains credentials, personal data, tokens or proprietary content, use a local tool or an editor feature instead.
Keep the original, unformatted text when exact bytes matter. Examples include content that is signed or hashed, files compared by checksum, and payloads where whitespace inside the raw text is significant to a downstream system.
What validation and formatting actually change
This is not a reversal, mirroring or Unicode font transformation. Validation changes nothing. It only checks whether the text follows JSON syntax: double-quoted strings and keys, no trailing commas, no comments, and correctly nested braces and brackets. Formatting, also called pretty-printing or beautifying, is a stored character change. It adds or removes whitespace between tokens, typically line breaks and indentation. The data itself should stay the same: keys, values, types and nesting.
Here is a minified input and an indented equivalent. Only whitespace outside the strings differs, so both describe the same data. The indentation width and style depend on the tool and its settings.
{"name":"Ada","tags":["math","code"],"active":true}
{
"name": "Ada",
"tags": [
"math",
"code"
],
"active": true
}
The next input is not valid JSON. It uses single quotes and has a trailing comma. A strict validator should reject it rather than silently repair it. If a tool does auto-correct input like this, review the corrected output, because the fix is a guess about what you meant.
{'name': 'Ada', 'active': true,}
Where reformatting can alter more than whitespace
Many formatters do not just insert whitespace. They parse the JSON into an in-memory structure and then write it back out. Whether JSONLint works this way was not confirmed for this review. If a tool does reserialize, these general risks apply and are worth testing with your own data:
- Duplicate keys: the JSON standard says object names should be unique but does not require it. Many parsers keep only one value, often the last, so a duplicate may silently disappear.
- Large or precise numbers: parsers built on JavaScript numbers cannot exactly represent integers beyond about 2^53. Long IDs may come back rounded.
- Number notation: values such as 1.0, 1e2 or 100 may be rewritten in a different but numerically equal form.
- Key order: JSON objects are unordered by definition. Some environments, including JavaScript objects, move integer-like keys ahead of other keys when reserializing.
- String escapes: escape sequences such as \u00e9 may be written out as the literal character, or the reverse. The meaning is the same, but the bytes differ.
A simple check is to validate a sample that includes duplicate keys, a very long integer and numeric object keys, then compare the output with the input. Do not assume one clean result covers every case.
Copying, sharing and accessibility
Formatted JSON is ordinary plain text. Copying it into an editor, terminal, ticket or chat message keeps the characters intact. Reading order does not change, and nothing depends on special glyphs or visual styling. Destinations can still alter the text. Some chat and document tools convert straight quotes to curly quotes or collapse whitespace, and curly quotes make JSON invalid. Use a code block or a plain-text field when sharing, and re-validate after pasting if the destination is unfamiliar.
Line breaks and indentation usually make nested data easier to scan and to move through line by line. This review did not test how any particular screen reader announces indentation in JSONLint or elsewhere, so no claim is made about specific assistive technology. Minified JSON remains the better choice when size matters, such as in network payloads or single-line log entries. The two forms carry the same data and can be converted back and forth.
Local alternatives when an online tool is not appropriate
For sensitive data or repeatable workflows, local tools validate and pretty-print without sending content anywhere. Many code editors have built-in JSON formatting and syntax checking. On the command line, both commands below exit with an error on invalid JSON and print indented output on valid JSON. They also parse and reserialize, so the caveats above about numbers and duplicate keys still apply.
python3 -m json.tool input.json
jq . input.json
| Situation | Reasonable choice |
| Quick syntax check of non-sensitive JSON | Online validator such as JSONLint |
| JSON containing secrets or personal data | Local editor or command-line tool |
| Exact bytes must be preserved (signatures, checksums) | Keep the original; validate without saving reformatted output |
| Compact transport or logging | Minified JSON |
| Human review of nested data | Indented JSON |
Open questions
Several points could not be verified for this review: how JSONLint handles duplicate keys and large numbers, whether it parses and reserializes or only re-indents, any input size limits, and what happens to pasted data. Test the first three with representative samples before relying on the tool. For the last, look for a published privacy policy rather than inferring practices from the interface.