JSON ↔ YAML ↔ TOML
Convert structured data between JSON, YAML, and TOML, live in your browser.
Prefer the terminal? See the CLI equivalent →About the JSON ↔ YAML ↔ TOML
- JSON ⇄ YAML ⇄ TOML
- Syntax highlighting
- Chain to other tools
- Instant results
- 100% private — runs in your browser
- Free, no sign-up
JSON, YAML, and TOML are three ways of writing the same thing: structured data made of objects, arrays, strings, numbers, and booleans. Each has its niche — JSON dominates APIs and web payloads, YAML is popular for configuration and CI pipelines, and TOML is the format of choice for many modern language toolchains. This converter translates between all three, live, in your browser.
Because the three formats share a common data model, converting between them is lossless for the values themselves: an object becomes a mapping becomes a table, an array becomes a sequence, and scalars carry across unchanged. Comments are the exception — JSON has none, so converting a commented YAML or TOML file to JSON drops the comments, and there is nowhere to recreate them on the way back.
Conversion happens as you type, with clear errors when the source is malformed. Nothing is uploaded, so you can safely convert configuration files that contain internal hostnames or other private details.
How to use it
- Paste your data into the Input editor, or load a file with the ⬆ upload button in its toolbar.
- Pick the source and target formats — the converted output appears live in the Output editor.
- Fix any reported syntax errors in the source; the output updates as soon as the input is valid.
- Copy or download the result from the Output editor’s toolbar, and use ⛶ to expand either editor — or both at once.
- When the target is JSON, use the “Send to…” buttons to pipe the result straight into the Types generator or JSONPath Tester.
When to use each format
- JSON
- Ubiquitous for APIs and data interchange. Strict, no comments, quotes required — great for machines, less friendly to hand-edit.
- YAML
- Indentation-based and comment-friendly. Common for CI/CD, Kubernetes, and app config where humans edit by hand.
- TOML
- Explicit and unambiguous with clear tables. Favoured by Rust (Cargo), Python (pyproject), and other tooling. Requires an object at the top level.
Frequently asked questions
Is the conversion lossless?+
Values, structure, and types round-trip faithfully between all three formats. The one thing that cannot survive is comments: JSON has no concept of them, so any comments are lost when converting through or to JSON.
Why can’t my data convert to TOML?+
TOML requires a table (object) at the top level. A document whose root is a bare array or a single scalar has no valid TOML representation, so those inputs can convert to JSON and YAML but not to TOML.
How are dates and numbers handled?+
JSON has no native date type, so dates become strings. YAML and TOML do understand dates and typed numbers, and the converter preserves them where the target format supports them and falls back to strings where it does not.
Does it validate my data against a schema?+
No — this tool converts between formats. If you need to validate JSON against a JSON Schema or pretty-print a single format, use the Code Formatter instead.
Works well with
JSON ↔ YAML ↔ TOML chains with these tools — send your result straight on:
Related tools
Code Formatter
Format and beautify JSON, YAML, TOML, XML, HTML, and CSS — with JSON/CSS minify and JSON schema validation.
Data Diff
Compare two JSON, YAML, or TOML documents by structure, not text: added, removed, and changed values with their paths. Key order and formatting are ignored. Runs in your browser.
HAR Viewer
Open a .har network export and explore its requests, sizes, status codes, and a timing waterfall — entirely in your browser. Nothing is uploaded.
JSON to SQL
Infer a SQL CREATE TABLE from a JSON sample or a JSON Schema — column types, nullability, and a primary-key guess — for PostgreSQL, MySQL, or SQLite. Runs in your browser.
JSON to Types
Turn a JSON sample or a JSON Schema into TypeScript, Zod, Go structs, Python dataclasses, Kotlin data classes, or Java records/Lombok. Infers optional and nullable fields. Runs in your browser.
JSONPath Tester
Query JSON live with JSONPath — filter, slice, and recurse, and see each matched value with its path, all in your browser.