Read the structure, not just the whitespace
JSON Formatter & Validator Online — Beautify, Minify & Inspect
A formatter can make valid JSON readable. It cannot make broken JSON trustworthy. DevSexy keeps those jobs separate and shows exactly where parsing stopped.
Raw JSON
{"user":{"id":17,"roles":["editor"]}}Parsed value
object · 1 root key · 2 nested values
Tree path
$.user.roles[0] → “editor”
From raw payload to navigable structure
Error anatomy
Line and column are clues; the preceding token is often the cause.
A missing comma or quote can surface one token later. The diagnostic keeps the parser message, offset, line, column, and nearby source together so you can repair the real boundary.
2 "name": "Mole" 3 "active": true 4 "roles": ["admin"] ▲ comma expected before this key
Formatting choices change the diff, not the data
Indentation
Two spaces is compact, four is easier to scan, and tabs follow editor policy. All three preserve parsed values.
Key order
Sorting keys creates stable fixtures but can make human-authored configuration harder to review. It is opt-in.
Minification
Minification parses and serializes the value without layout whitespace. Duplicate keys and integers beyond JavaScript’s safe range are not preserved losslessly; use strings for large identifiers.
Strict JSON is not JSONC
Strict JSON rejects comments and trailing commas. Turn JSONC on to accept them explicitly: formatting can retain comments, while minification emits strict JSON without comments. Unquoted keys, NaN and Infinity remain invalid.
✓ Strict JSON: strings, numbers, booleans, null, arrays, objects
× Invalid in both modes: unquoted keys, NaN and Infinity
Use JSONPath after the document parses
Validate first, then use root, member, array index or wildcard selections. This implementation does not support the full JSONPath grammar, including recursive descent, filters or slices.
$[0].id$.users[*].email$.orders[*].statusRun these JSON examples
Compare the input with the expected result, then load the same data and options into the editor.
Loading an example replaces the current input and processing options.
Format a strict JSON payload
Format · 2-space indentation · JSONC off · key sorting off · JSONPath root.
Input
{"user":{"id":17,"roles":["editor"]},"active":true}Expected result: a nested object with the same parsed values and readable indentation.
{
"user": {
"id": 17,
"roles": [
"editor"
]
},
"active": true
}Convert commented configuration to strict JSON
Minify · JSONC on · JSONPath root. Turn JSONC off to see why the same input fails strict JSON parsing.
Input
{
// local development
"port": 3000,
"enabled": true,
}Expected result: comments and the trailing comma disappear from the serialized JSON. Format mode with JSONC on can retain comments instead.
{"port":3000,"enabled":true}Continue the data workflow
Syntax-valid JSON can still miss required fields or use the wrong types; check the payload against your schema.
Use the configuration tool for YAML or TOML rather than trying to parse those languages as JSON.
Use consistent indentation and key-order settings before comparing two versions.
Keep formatting and inspection at hand with keyboard shortcuts and local offline tools.