YAML to TOML Converter Online — Free & Private

Convert readable YAML into TOML through a JSON intermediate. It suits teams standardizing on Cargo.toml or pyproject.toml.

Loading…
YAML → TOML for DevOps configuration
Converts YAML into TOML through a JSON step, for tools such as Cargo and pyproject.

Developer notes

Multi-document YAML streams are rejected. Comments are lost, because the YAML is read as data before the TOML is written. A list at the root is wrapped in an items key, because a TOML document needs a table at the root. Sort TOML keys orders the keys alphabetically at every level. Compare the result with your team's TOML style.

Use cases

Standardize on TOML when the source still ships YAML. Preview the TOML equivalent of Compose or Helm values. Check how a nested mapping becomes tables.

About these options

For CSV output, choose the delimiter, how fields are quoted, the line endings and whether to write a header row. Auto uses a comma in English and a semicolon in French, German and Spanish, as Excel expects. For CSV input, the delimiter is detected on the first line (comma, semicolon, tab or pipe). You choose whether that line holds the column names. JSON output can use 2 or 4 spaces or a single line, with an optional recursive key sort. XML output can be pretty-printed with a chosen indent width. YAML output takes an indent width and a quoting mode for strings. XML comments are dropped, because the conversion goes through a JSON tree.

Examples

Kubernetes deployment

Input

apiVersion: apps/v1 kind: Deployment metadata: name: checkout-api labels: app: checkout spec: replicas: 3 selector: matchLabels: app: checkout template: metadata: labels: app: checkout spec: containers: - name: api image: registry.example/checkout:2.4.1 ports: - containerPort: 8080

Output

apiVersion = "apps/v1" kind = "Deployment" [metadata] name = "checkout-api" [metadata.labels] app = "checkout" [spec] replicas = 3 [spec.selector.matchLabels] app = "checkout" [spec.template.metadata.labels] app = "checkout" [[spec.template.spec.containers]] name = "api" image = "registry.example/checkout:2.4.1" [[spec.template.spec.containers.ports]] containerPort = 8080

Service with a list of endpoints

Input

service: name: billing-gateway port: 8443 tls: enabled: true minVersion: "1.2" endpoints: - /health - /metrics - /ready

Output

[service] name = "billing-gateway" port = 8443 endpoints = [ "/health", "/metrics", "/ready" ] [service.tls] enabled = true minVersion = "1.2"

Related tools

Check the structure with YAML → JSON, write TOML from JSON with JSON → TOML or tidy TOML with the TOML beautifier.

YAML → TOML FAQ

Single document

Can I paste several YAML documents?

No. Streams with several documents are rejected, so paste one document at a time.

What happens to YAML comments?

They are lost, because the YAML is read as data before the TOML is written.

What happens to a list at the root?

It is wrapped in an items key, because a TOML document needs a table at the root.

Is my data sent to a server?

No. The conversion runs in your browser, and FastMinify never receives what you paste.

Convert YAML to JSON, XML, CSV, TOML, TSV, Properties and INI, in your browser.