JSON Formatter & Transformer
Format, validate, minify, and convert JSON instantly — right in your browser. Runs entirely offline. Your data never leaves your machine.
// drag a file here to load it
⚡ Instant formatting
Paste messy JSON and get perfectly indented, readable output in milliseconds. Supports deeply nested structures of any size.
✓ Live validation
Errors are highlighted the moment you stop typing. Clear error messages tell you exactly what went wrong and where.
🔒 Fully private
Everything runs in your browser using JavaScript. No API calls, no servers, no logs. Your tokens and payloads stay on your machine.
↔ Format conversion
Convert JSON to YAML for config files, or flatten arrays of objects to CSV for spreadsheets — all in one click.
{ } Minify & compress
Strip whitespace for production payloads or API requests. See the exact character count difference before and after.
🗂 Key explorer
Extract every key path from a complex nested JSON object. Perfect for exploring unfamiliar API responses.
How to use the JSON Transformer
JSON syntax rules
JSON has six data types: string, number, boolean, null, array, and object. Strings must use double quotes — single quotes are invalid. Trailing commas are not allowed. Numbers can be integers or floats but not NaN or Infinity. Object keys must be strings in double quotes. Boolean values are lowercase true and false. These rules are strict — one violation breaks the entire document.
Minified vs formatted JSON
Minified JSON removes all whitespace and is ideal for API responses and storage where size matters. A 100KB JSON file can shrink by 20-30% when minified. Formatted JSON with 2-space or 4-space indentation is easier to read and review. In development, format API responses to understand their structure. In production, send minified JSON. The DevCrate JSON Transformer converts between both instantly.
JSON vs YAML vs TOML
JSON is verbose but universally supported and has strict parsing rules. YAML is more concise and human-readable but relies on indentation for structure, making it error-prone. TOML is designed for config files and is more readable than both for flat key-value pairs. JSON is the right choice for APIs and data interchange. YAML is common in CI/CD pipelines and Kubernetes configs. TOML is used in Rust projects (Cargo.toml) and some static site generators.
Common JSON mistakes
The most common JSON errors are: trailing commas after the last item in an array or object, using single quotes instead of double quotes for strings, forgetting to quote object keys, using undefined or NaN as values (not valid in JSON), and unescaped special characters in strings. Paste your JSON into the transformer to instantly see if it's valid and get a clear error message if not.