XML to TOON Converter

Transform your XML data into the clean, token-efficient TOON format.

What is the XML to TOON converter?

This tool parses your XML into a nested structure and re-encodes it as TOON (Token-Oriented Object Notation), a compact format that strips the angle brackets and repeated tag names XML spends so many tokens on. Elements, attributes and nesting are preserved in the conversion.

Each result is measured with the cl100k_base tokenizer used by GPT models, so you can see exactly how many tokens the TOON version saves over the original XML.

How to use the XML to TOON converter

  • 1. Paste your XML into the Input XML field.
  • 2. Choose a delimiter and indentation style.
  • 3. Optionally turn on length markers.
  • 4. The TOON Output updates as you type - click Copy to grab it.

Features

  • Parses XML elements, attributes and nested nodes.
  • Compact TOON output instead of verbose, tag-heavy XML.
  • Selectable delimiter and indentation.
  • Live token savings from a GPT-style tokenizer.
  • Free to use, no sign-up.

When to use it

Helpful when the data you need a model to read arrives as XML - SOAP responses, RSS feeds, exported documents - and the repeated tags would otherwise eat your token budget. Convert to TOON to shrink it before it goes into the prompt.

Stripping the closing tags alone removes a large share of the tokens XML spends on structure, which is why tag-heavy documents tend to show the biggest saving.

FAQ

What is TOON format?

TOON (Token-Oriented Object Notation) is a minimal, indentation-based data format for LLM prompts. It keeps data readable while using fewer tokens than XML or JSON.

How are XML attributes handled?

The XML is parsed into a nested structure that keeps elements and attributes, and that structure is written out as TOON, so attribute data is carried over.

How are token savings measured?

The tool counts tokens with the cl100k_base encoder used by GPT-3.5 and GPT-4, then compares the XML and TOON counts to show the percentage saved.

Is my data uploaded?

Yes. The conversion runs on our server, so your XML is sent there to be processed and is not stored. Avoid pasting anything sensitive you would rather keep local.

Related tools