Processed in your browser

XML / TOML Converter

XML attributes map to @attributes, element text maps to #text, and repeated elements become arrays. TOML import requires one root table key and never loads DTDs or external entities.

Processed in your browser
0 / 1,000,000
Converted output

Tool guide

What is XML / TOML Converter?

XML and TOML Converter connects hierarchical configuration through an explicit mapping: attributes use @attributes, text uses #text, and repeated elements become arrays. DTD and ENTITY declarations are rejected, TOML import requires one root key, and comments, namespaces, mixed content, dates, and source layout are documented as lossy areas. Common workflows include the following. Migrate simple XML configuration to TOML. Generate XML for a legacy consumer. Review attributes, text, and repeated elements. The page also documents input boundaries, output behavior, and practical cautions so you can review the result before putting it into an application, configuration, test, or production workflow.

When to use it

  • Migrate simple XML configuration to TOML.
  • Generate XML for a legacy consumer.
  • Review attributes, text, and repeated elements.

How to use it

  1. Choose the XML or TOML direction.
  2. Confirm TOML has one key for the XML root.
  3. Use @attributes and #text for attributes and text.
  4. Convert and review structural-loss warnings.
  5. Manually verify namespaces and mixed content.
  6. Load one of the realistic examples first to verify the selected options and processing direction before replacing it with your own data.

Runnable examples

The “Example 1” and “Example 2” buttons load the matching inputs. They cover different structures, directions, or boundaries and can be run directly in the workspace.

Example 1

<site lang="zh-CN"><name>JSONLane</name><release><tools>50</tools><ready>true</ready></release></site>

Example 2

[site]
name = "JSONLane"

[site.release]
tools = 50
ready = true

Input rules

  • XML cannot contain DTD or ENTITY.
  • TOML to XML requires one root key.
  • Attributes and text use @attributes and #text.
  • Text input is counted before processing and is limited to 1,000,000 characters on this page; file modes apply the separate file limit shown in the workspace.
  • TOML to XML requires exactly one root key.

Output rules

  • Repeated XML elements become arrays.
  • Attributes enter @attributes.
  • Namespaces and mixed content require review.
  • Output reflects only the current input, direction, and options; rerun after changing a mode or value instead of treating an earlier result as current.
  • XML comments, instructions, namespaces, and mixed content are not guaranteed.

Limitations and cautions

  • TOML to XML requires exactly one root key.
  • XML comments, instructions, namespaces, and mixed content are not guaranteed.
  • TOML comments, date types, and source layout are normalized.

How your data is handled

All parsing, format conversion, Base64 work, and intermediate data remain in the current browser tab. JSONLane does not upload the input or retain it after refresh or close.

FAQ

Is XML or TOML content uploaded?

No. Parsing, conversion, and output generation remain in the current browser tab.

Is every round trip lossless?

No. Comments, layout, type systems, and binary capabilities differ, so the page identifies the areas that require review.

Why can valid input still be rejected?

The destination may not have a safe representation. Dangerous keys, unsafe integers, excessive depth, and ambiguous mappings are rejected instead of silently rewritten.

How are XML attributes represented?

They use an @attributes table, while text uses #text.

Do namespaces round-trip losslessly?

Not reliably. Prefixes and declaration placement require review.

Why must TOML have one root key?

XML requires one root element, so the TOML object must provide an unambiguous root name.

Updated: 2026-08-09