How JSON Formatting Works
AnyTool formats JSON by parsing the input with JSON.parse(), then serializing with JSON.stringify() using configurable indentation (2 or 4 spaces). Syntax errors are caught and displayed with line numbers and error messages. Minification removes all whitespace.
- Uses native JSON.parse/stringify for standards compliance
- Syntax highlighting via regex-based tokenizer
- Error detection with line numbers
- Beautify (indent) and minify modes
