YAML to TOML converter

Useful when moving settings from YAML to TOML-based tools such as Hugo, Cargo or Poetry without a manual JSON step.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter yaml text and null values.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

YAML is read with the YAML 1.2 core schema, then TOML is written: plain values first, then [a.b] tables, then [[a]] arrays of tables. .inf and .nan become inf and nan, multi-line text becomes """, and null values are left out, written as "" or reported, as you choose.

Example

Inputs: Null values = Leave them out. Result: TOML: app = "toolsahla" port = 8080 debug = false languages = ["ar", "en"] welcome = """ Welcome to ToolSahla أهلا بك """ [database] host = "localhost" user = "admin" ; Null values left out: 0.

# App settings
app: toolsahla
port: 8080
debug: false
languages:
  - ar
  - en
database:
  host: localhost
  user: admin
welcome: |
  Welcome to ToolSahla
  أهلا بك
app = "toolsahla"
port = 8080
debug = false
languages = ["ar", "en"]
welcome = """
Welcome to ToolSahla
أهلا بك
"""

[database]
host = "localhost"
user = "admin"

Limits and caveats

  • The tool supports a clear YAML subset: maps, lists, scalars, quoted strings, | and > block scalars and [ ] and { } flow collections. Anchors &, aliases *, tags ! and multiple documents are rejected with a clear message.
  • Comments are dropped, and an unquoted date in YAML stays text under YAML 1.2.

Questions about this tool

Why did 2024-01-01 not become a TOML date?

Under YAML 1.2 an unquoted date is plain text, so it is written as a quoted string to keep the same meaning.

Must the YAML start with a map?

Yes, because a TOML file is a table of keys. A top-level list gives an error.

Are comments kept?

No. Comments do not carry across formats, so add them back by hand if you need them.