What this JSON tool does
JSON (JavaScript Object Notation) is the default data format of web APIs, configuration files and log pipelines. Raw JSON, however, often arrives minified on a single line or slightly broken by a trailing comma. This tool parses your input with the browser's native JSON.parse, reports the exact error if the document is invalid, and re-serialises it with the indentation you choose. It also converts in both directions: JSON to YAML, CSV or TypeScript interfaces, and YAML or CSV back to JSON. Parsing runs in a Web Worker, so even multi-megabyte payloads do not freeze the page.
How to use it
- Paste JSON into the left panel, or click Sample to load an example.
- Pick a mode: Format (pretty-print), Minify, → YAML, → CSV, → TypeScript, YAML → JSON or CSV → JSON.
- Choose 2 spaces, 4 spaces or tabs for indentation.
- Read the status badge above the output: green means valid, red shows the parser message.
- Click Copy to put the result on your clipboard.
Practical examples
- Debugging an API response: copy a minified body from the browser's Network tab, paste it here and format it to see the nesting at a glance.
- Typing a fetch call: switch to → TypeScript and you get
export interface Root { ... }with nested interfaces named after their keys, ready to drop into your project. - Sharing data with non-developers: convert an array of objects to CSV and open it in Excel or Google Sheets. Nested objects are kept as JSON strings in a single cell so no data is lost.
- Kubernetes or GitHub Actions config: convert JSON to YAML when a tool only accepts YAML, or go the other way to validate a YAML file strictly.
Tips and edge cases
- JSON does not allow comments, single quotes, trailing commas or
NaN. If your input came from a JavaScript file, remove these first. - Numbers larger than 2^53 (for example 64-bit database IDs) lose precision in any JavaScript parser. Ask your API to send them as strings.
- CSV export uses the keys of every object as columns; objects with different shapes produce empty cells rather than errors.
- For CSV → JSON, numbers and booleans are detected automatically. Wrap a value in quotes in your CSV if you need it to stay a string.
- Duplicate keys are legal in the grammar but only the last value survives parsing.