Format & Minify
Native JSON.parse + JSON.stringify
Format calls JSON.parse(input) to validate and parse, then JSON.stringify(parsed, null, 2) to pretty-print with 2-space indentation. Minify uses the same parse step but stringifies without the indent argument - yielding the most compact valid JSON.
Validation is automatic: any parse error is caught and shown inline with the exact character position from the V8 / SpiderMonkey error.
Auto-Fix
Three regex repairs
The fixer applies three patterns that cover ~90% of malformed JSON:
- Trailing commas:
,(\s*[}\]]) → strip
- Single quotes:
' → "
- Unquoted keys:
{key: → {"key":
The result is then run through JSON.parse to confirm validity. Always review fixes before using in production.
Syntax Highlighting
Custom tokenizer, zero deps
The highlighter walks the input character-by-character, classifying each token: strings (with key vs value detection by lookahead for :), numbers, true/false/null, brackets, and punctuation. It works on partial or invalid input - no dependency on a parser, so the editor never breaks while you type.
Color tokens: keys in cyan, strings in green, numbers in orange, booleans in purple, nulls in red.