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

CSV exports: choose a delimiter (Auto follows locale — semicolon on /fr), RFC-minimal vs always-quoted fields, line endings, and whether to emit a header row. CSV imports: delimiter is auto-detected from the first line (comma, semicolon, tab, or pipe) — toggle whether row 1 holds column names. JSON output (XML, YAML, or CSV sources): indentation (including compact one-line) and optional recursive key sort. JSON → XML: toggle pretty-printing and indent width. YAML output: indent width, readable vs tighter layout, and deterministic string quoting (there is no source YAML file to “preserve”). XML comments are not represented in the intermediate 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.