TOML to XML converter

Convert TOML to XML that is well-formed: tables become elements, arrays become repeated elements, and Cargo.toml or pyproject.toml files work as they are.

TOML

XML

Waiting for input

What you get

How each result is checked

  1. Step 1: Your TOML is parsed with a TOML 1.0 parser; errors show the line number.
  2. Step 1: The JSON is parsed back and compared with the parsed TOML, value by value.
  3. Step 2: The output is checked for well-formedness with an XML validator.
  4. Step 2: The XML is parsed back and compared with your data. Because XML has no data types, values are compared as text.

What can't convert exactly

  • JSON has no date type, so TOML dates become ISO strings.
  • Comments are not carried over.
  • XML has no numbers, booleans or null: they are written as text, and null becomes an empty element.
  • Keys that are not valid XML names (spaces, leading digits) are renamed, and you are told which.
  • A one-item array looks the same as a single value in XML, and empty arrays have no XML form.

Questions

How is a two-step conversion checked?

Your input is converted to JSON first, then to the target format. Each step has its own independent check, and both must pass. The checks of both steps are listed under every result.

Is my data uploaded?

No. Everything runs in your browser, in a background worker. Nothing is sent to a server.

How do I convert TOML to XML online?

Paste your TOML or open a file on the left (or click Example). The XML appears on the right as you type, already checked. Copy it, or download it as a file. Nothing is uploaded.

Can the XML output be wrong?

Every result is checked before it is shown (the checks are listed on this page). If a check fails, the page says "Review needed" and why, instead of presenting the output as correct, and anything that cannot convert exactly is named in the notes.