Loadingβ¦
Loadingβ¦
Convert JSON to clean YAML for Kubernetes, Docker Compose, and CI configs, or YAML to JSON. Values like yes, no, and 0o17 are quoted so every YAML parser reads them correctly.
Also covers: JSON to YAML Β· YAML to JSON
The result appears here as you type.
JSON β YAML writes block-style YAML; YAML β JSON reads YAML 1.2, including anchors, aliases, and multi-document files.
Paste JSON or YAML, drop a file, or click Sample. Syntax errors show the line and column from the parser.
Choose 2- or 4-space indentation, sort keys, or quote every string. Copy, download, or Swap to convert the result back.
Older YAML 1.1 parsers (PyYAML, Ansible, many CI tools) read yes, no, on, off, and y as booleans, 1:30 as a number, and 2024-01-01 as a date. Newer 1.2 parsers read 0o17 as an octal number. Strings like these are quoted so every parser gets back the same text. Everything else stays unquoted.
JSON has no comments, so YAML comments are dropped when converting to JSON. To tidy YAML while keeping its comments, use the YAML Formatter instead.
By default they become one JSON array, one element per document. Choose First document only to convert just the first.
Yes. Aliases (*name) are expanded to copies of the anchored value (&name) in the JSON. Expansion is capped, so a "billion laughs" file can't freeze the page.
No. Everything runs in your browser tab, and nothing you paste or open is uploaded or stored.
Data
Format, validate, and minify JSON in your browser. Paste it, upload a file, or load it from a URL. Errors show the exact line and column.
C# / .NET
Paste JSON and get C# model classes or records, ready for System.Text.Json or Newtonsoft.Json. Nested objects, arrays, nullable types, dates, and GUIDs are inferred for you.
SQL
Format and beautify SQL queries for SQL Server (T-SQL), PostgreSQL, MySQL, Oracle, and more. Set the indentation, keyword case, and layout, and get the exact line of any syntax error.
Data
Format, validate, and minify XML (config files, .csproj, SOAP, RSS) in your browser. Entities, CDATA, and mixed content are kept exactly as written, and errors show the line and column.
Data
Format and validate YAML (docker-compose, Kubernetes, GitHub Actions) without losing comments, or convert YAML to JSON. Errors show the exact line and column.
Web
Beautify HTML pages and fragments without changing how they render. Inline spacing, <pre>, and scripts stay intact, and embedded CSS and JavaScript can be formatted too.