Structured Data Converter

Convert YAML, JSON, and TOML locally in your browser with multi-document YAML support and anchor resolution.

Your config data stays in your browser. No uploads, no API calls, no backend parsing.

Converter

Multi-document YAML is supported, and anchors are resolved locally before conversion.

Source

0 / 1,048,576 bytes

Converted output

You just tested your Structured Data Converter — Try JSON Formatter & Validator next →

What Is a Structured Data Converter?

YAML, JSON, and TOML each became canonical in different ecosystems because they prioritise different things. JSON (ECMA-404) is strict, machine-friendly, and ubiquitous on the wire — REST APIs, GraphQL responses, npm package.json, tsconfig.json. YAML (spec 1.2.2) is human-friendly with anchors, aliases, multi-doc streams, and significant indentation — Kubernetes manifests, GitHub Actions workflows, Ansible playbooks, Docker Compose. TOML (spec 1.0.0) explicit-types-first — Rust Cargo.toml, Python pyproject.toml. The classic conversion gotchas: YAML 1.1's Norway problem treats NO, no, false, off, and the country code NO as boolean false (Kubernetes since 1.16 uses YAML 1.2 which fixes this, but legacy parsers still bite); YAML's date implicit casts 2024-01-15 to a Date object — wrap in quotes to keep it a string. TOML distinguishes datetime (2024-01-15T10:30:00Z), local-datetime, local-date, and local-time as separate first-class types — JSON has none of these and they collapse to strings during round-trips. The converter resolves YAML anchors before output and preserves TOML's typed dates by serialising them as RFC 3339 strings in JSON / quoted strings in YAML.

How to Use the Structured Data Converter

Pick From and To formats. Paste source or Import file from disk. The result appears live. The Swap button reverses From-To and moves the output into the input (useful for round-trip testing — YAML -> JSON -> YAML should be idempotent except for comment loss and key ordering). For multi-document YAML separated by ---, the converter emits a JSON array (one element per document) or concatenates back to multi-doc YAML in the reverse direction. Anchors (&name) and aliases (*name) are resolved before conversion — the output has the expanded values, not the references. The error pane lists the line and column where parsing failed, with a context window: a missing ] in JSON, broken indentation in YAML, or an unquoted special character in TOML are the three most common issues. Download as .json, .yaml, or .toml — the file extension matches the target format so editors apply the right syntax highlighting.

Why Config Format Conversion Matters

Format choice signals intent. JSON is for wire-format and tooling that needs unambiguous parsing — every { and [ is exactly one thing. YAML is for humans authoring configuration with cross-references (anchors avoid copy-pasting blocks of env vars across services). TOML is for explicit-typed configuration where mixing strings and dates accidentally is unacceptable (Cargo.toml would not tolerate the Norway problem). When migrating a project, conversions reveal mismatches: a YAML file with country: NO becomes JSON country: false if the parser is YAML 1.1, breaking downstream systems silently. A TOML date converted to JSON loses its type — round-tripping back to TOML produces a string, breaking config validators that expect datetime. The converter surfaces these by preserving type information across all three formats where possible, so what you read in equals what you write out — modulo comments, which YAML and TOML support but JSON does not.

Frequently Asked Questions

Can it handle multi-document YAML?

Yes. When the input contains multiple YAML documents separated by --- the converter keeps them together and can export them as a JSON array or YAML multi-doc output.

Why can't multi-document YAML convert directly to TOML?

TOML is best suited to a single object document. If you paste multiple YAML documents, convert them to JSON first or merge them before exporting to TOML.

Are YAML anchors and aliases resolved?

Yes. Anchors and aliases are resolved in the browser before the converted output is generated.