Build a JSON Formatter & Validator (JS)
Build a JSON pretty-printer and validator in JavaScript - parse, format, explain errors, and check shape - runnable right in your browser.
- Parse and Pretty-Print Turn a cramped one-line JSON string into clean, indented output using JSON.parse and JSON.stringify.
- Explaining Errors Catch a failed parse and turn the thrown error into a readable message with a rough location in the text.
- A Tiny Shape Check Validate parsed JSON against a small expected shape - required keys present and each value the right type.
- Minify and Extend Add a whitespace-free minify mode, sort keys for stable output, and sketch a diff between two JSON values.