How It Works Under the Hood
Input text is parsed into an intermediate JavaScript AST using strict `js-yaml` schema rules (disabling unsafe custom JS tags), native `JSON.parse`, or `smol-toml` (TOML v1.0.0 compliant). The validated structure is then serialized cleanly into your target format with configurable indentation.
Step-by-Step Instructions
Select your Input Format (`YAML`, `JSON`, or `TOML`) and Target Format.
Paste or drop a configuration file such as `docker-compose.yml`, `package.json`, or `pyproject.toml`.
Choose JSON/YAML indentation (`2` or `4` spaces) and optional alphabetical key sorting.
Inspect structured validation errors with line numbers or copy/download the converted configuration.
Key Features & Performance
- Full 3x3 conversion matrix: YAML ↔ JSON ↔ TOML plus same-format pretty-printing
- Uses YAML safe schema — never evaluates arbitrary code or JS tags
- TOML 1.0 support for tables, arrays of tables, inline tables, and ISO dates
- Top-level scalar/array wrapping guard when exporting to TOML (which requires a root table)
- Zero telemetry — safe for Kubernetes secrets templates and CI workflows
Methodology, Formulas & Technical Standards
YAML parsing relies on `js-yaml` core schema (`YAML 1.2` subset); JSON uses ECMAScript `JSON.parse`/`stringify`; TOML uses `smol-toml` implementing TOML `v1.0.0`. Because TOML requires a top-level key-value table, root arrays converted to TOML are clearly rejected or require an object wrapper rather than silently corrupting output.
Common Real-World Use Cases
- Migrating Node.js/TypeScript `tsconfig.json` snippets into YAML CI pipelines or vice versa
- Debugging indentation mistakes in Kubernetes manifests or GitHub Actions `.yml` workflows
- Inspecting Rust `Cargo.toml` or Python `pyproject.toml` dependency graphs as readable JSON
- Formatting minified single-line JSON payloads into human-readable YAML
Worked Examples & Edge Cases
TOML to YAML
[server]\nhost = "127.0.0.1"\nport = 8080
server:\n host: 127.0.0.1\n port: 8080
Nested TOML tables map directly to indented YAML mappings.
Root Array Notice for TOML
["alpha", "beta"]
Error: TOML requires a top-level object/table (cannot serialize a bare root array).
Prevents invalid TOML output per TOML v1.0.0 specification.
Limitations, Scope & Accuracy Notes
- • YAML comments (`# ...`) and TOML comments are discarded during AST conversion because JSON has no standard comment syntax.
- • TOML local dates/times serialize to ISO-8601 strings when targeting JSON.
- • YAML custom anchors/tags outside the JSON/core schema are flattened or rejected for safety.
Local Browser Processing & Privacy
Traditional web converters upload your documents, snippets, or media files to remote servers. YAML, JSON & TOML 3-Way Converter runs inside your browser tab:
Your input text and files are processed locally without uploading payloads to a processing server.
Microdeck does not log or store the files or inputs you paste into tool workspaces (normal static hosting/CDN requests still load page assets).
Working outputs stay in your browser tab and are released when you reset the tool or close the tab.
Frequently Asked Questions
Why did comments disappear after converting YAML to JSON and back?
Standard JSON does not support comments, so any intermediate conversion through an AST strips `#` comment lines.
Why can’t a JSON array like [1, 2, 3] be converted directly to TOML?
By the TOML specification, the root document must always be a table (key-value object). Wrap the array inside an object key like `items: [1, 2, 3]` first.
Is parsing untrusted YAML here safe?
Yes. Custom JavaScript evaluation tags (`!!js/function`, etc.) are never enabled, and everything runs isolated inside your browser sandbox.
Does it support same-format beautifying (e.g., JSON to formatted JSON)?
Yes, selecting the same source and target format validates syntax and re-indents your file cleanly.
Explore Related Micro-Tools
JSON Formatter, Validator & Diff
Format, validate, compare diffs & auto-repair malformed JSON locally in your browser
XML Formatter, Validator & JSON Converter
Pretty-print, minify, validate XML structure, and convert XML ↔ JSON without XXE risk
Structured LLM Output & Schema Generator
Convert JSON payloads into Zod, Pydantic & JSON Schema