💻 Developer Tools

JSON Formatter & Validator

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.

  1. Paste or type JSON into the input area.
  2. Choose compact or indented output and whether object keys should be alphabetized recursively.
  3. 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.

Limitations and common mistakes

  • Parsing and reserializing can change insignificant whitespace and may not preserve duplicate object keys.
  • Very large integers can lose precision when interpreted as ordinary JavaScript numbers.

Common questions

Is my JSON uploaded?

No. This tool parses and formats the text locally in your browser.

Why are comments rejected?

Comments are not part of the JSON standard. Some configuration formats accept extensions, but this validator intentionally checks interoperable JSON.