Microdeck.tools 100% In-Browser

YAML, JSON & TOML 3-Way Converter

New

Bidirectional configuration converter and syntax validator for YAML, JSON, and TOML files (`Cargo.toml`, `pyproject.toml`, Docker Compose, GitHub Actions, Kubernetes manifests). Strict parser catches duplicate keys and schema hazards offline.

100% In-Browser No Server Storage Instant Results

Did this tool save you time? Help keep Microdeck free and maintained. Completely optional · From $3.

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

1

Select your Input Format (`YAML`, `JSON`, or `TOML`) and Target Format.

2

Paste or drop a configuration file such as `docker-compose.yml`, `package.json`, or `pyproject.toml`.

3

Choose JSON/YAML indentation (`2` or `4` spaces) and optional alphabetical key sorting.

4

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

Input
[server]\nhost = "127.0.0.1"\nport = 8080
Output
server:\n  host: 127.0.0.1\n  port: 8080

Nested TOML tables map directly to indented YAML mappings.

Root Array Notice for TOML

Input
["alpha", "beta"]
Output
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:

Processed in This Tab

Your input text and files are processed locally without uploading payloads to a processing server.

No Tool Payload Logging

Microdeck does not log or store the files or inputs you paste into tool workspaces (normal static hosting/CDN requests still load page assets).

Tab Memory Lifecycle

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

Support Microdeck

Completely optional · From $3 · No account required

Choose an amount (USD):Selected:$5

Minimum support amount is $3 USD.

Completely optional · From $3 · Checkout opens on Gumroad.