JSON Formatter & Validator
Format, validate, convert, diff, and query JSON entirely in your browser. Nothing uploaded, nothing tracked.
Settings
Settings apply to your current session only. Nothing is saved across page reloads to keep this tool tracker-free.
JSON to TypeScript: produces interface declarations with optional fields detected across array items.
Paste your JSON in the left pane and your JSON Schema in the right pane. Supports JSON Schema draft-07 and 2020-12 for common keywords.
Paste the original JSON in the left pane and the modified JSON in the right pane. Arrays are compared index-by-index — semantic reordering may appear as differences.
Supported JSONPath Syntax
$ | Root of the document |
.key or ['key'] | Child by name |
['k1','k2'] | Multiple children |
[0] or [-1] | Array index (negative from end) |
[1:5] or [::2] | Array slice |
[*] or .* | All children (wildcard) |
..key or ..['key'] | Recursive descent |
[?(@.x > 5)] | Filter (comparison: == != < <= > >=, logical: && ||) |
Examples: $.store.book[*].author · $..price · $.users[?(@.age >= 18)] · $..book[?(@.category == 'fiction')]
Not supported: script expressions like [(@.length-1)], function calls like length(), regex match
operators.
Click "Compare JSON Documents" to see differences.
Raw:
Reviewed by DoItSwift Editorial. This tool uses the browser's native JSON.parse and JSON.stringify to format and validate JSON. Lenient mode preprocesses input to strip // and /* */ comments and trailing commas before parsing. Syntax highlighting and error positioning run entirely in your browser using vanilla JavaScript — no JSON content is sent to any server. Read our editorial policy, research methodology, and fact-checking standards.