Validate, pretty-print, or compact JSON directly in your browser.
Ready to use · Runs in your browser · No signup
Loading tool…
How to use the JSON Formatter & Validator
Paste JSON to validate its syntax and produce a clean formatted or compact representation without sending the content to a server. You can preserve insertion order or sort object keys recursively.
Parse, validate, pretty-print, minify, or recursively sort JSON object keys directly in the browser. Clear parse errors help locate invalid syntax, while deterministic formatting makes configuration and API payloads easier to review.
Input stays in the browser and is not sent to Fieldlet. Do not treat a formatting, encoding, test, or generated value as a substitute for security review.
Paste or type JSON into the input area.
Choose compact or indented output and whether object keys should be alphabetized recursively.
Fieldlet parses the JSON with the browser's native parser and re-serializes valid data using those options.
Last reviewed for accuracy:
Worked examples
Format a compact object
Scenario: The input is {"name":"Fieldlet","live":true,"tools":84} and two-space indentation is selected.
Result: The object is displayed on multiple indented lines with the same keys and values.
The browser parses the JSON into a data value, then serializes it with the selected indentation. Whitespace changes, but data types and values do not.
Find a trailing-comma error
Scenario: An object ends its final property with a comma before the closing brace.
Result: Validation reports a syntax error instead of formatting the input.
Standard JSON permits commas only between members, not after the last member.
How the result is produced
Validation uses the JSON grammar: double-quoted property names and strings, supported numeric syntax, true, false, null, arrays, and objects. Formatting occurs only after a successful parse, preventing invalid input from being presented as repaired JSON.
JSON requires double quotes around property names and strings
Trailing commas and comments are not valid standard JSON
Minifying removes insignificant whitespace, not data
Sorting changes object-key order recursively but leaves array order and values intact
Formatting is not semantic validation
Valid JSON can still contain the wrong fields, value types, or business rules for an API. Formatting confirms syntax and improves readability; a schema or application-specific validator is needed to confirm meaning.
Use syntax validation to catch malformed JSON.
Use JSON Schema or API documentation for structure requirements.
Review secrets before copying data into any external system.
References
These primary references document standards or definitions used in the explanation above.