XML to TOML Converter Online — Free & Private

Paste XML and get TOML output. Everything runs in your browser and nothing is uploaded.

Loading…
XML → TOML for configuration migrations
Reads XML in the browser and writes it as TOML tables, with every value as a string.

Developer notes

The conversion goes through JSON, so attributes become keys and text next to attributes goes under _text. Every value is a string, because XML has no types. Numbers and booleans appear in quotes. Repeated elements become an array of tables, written as [[table]] blocks. Comments are dropped. Sort TOML keys orders the keys alphabetically.

Use cases

Move a legacy XML configuration toward a tool that uses TOML. Draft a TOML file from an XML export. Check how nested elements become 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

Attributes and nested elements

Input

<?xml version="1.0" encoding="UTF-8"?> <config env="production"> <database host="db.internal" port="5432" name="checkout" /> <cache ttl="300" provider="redis" /> <features> <flag name="checkout-v2" enabled="true" rollout="25" /> </features> </config>

Output

[config] env = "production" [config.database] host = "db.internal" port = "5432" name = "checkout" [config.cache] ttl = "300" provider = "redis" [config.features.flag] name = "checkout-v2" enabled = "true" rollout = "25"

Repeated elements with text

Input

<library> <book id="1">Alpha</book> <book id="2">Beta</book> </library>

Output

[[library.book]] id = "1" _text = "Alpha" [[library.book]] id = "2" _text = "Beta"

Related tools

Other converters that start from XML are linked on this page.

XML → TOML FAQ

How the TOML is built

Why are numbers in quotes?

XML has no types, so every value is read as text. The TOML keeps them as strings.

How are repeated elements written?

As an array of tables, with one [[table]] block for each element.

Where does the text of an element with attributes go?

Under a _text key, next to the attributes.

Is my data sent to a server?

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

Convert XML to YAML, CSV, JSON, TOML, TSV and HTML.