Convert a list to XML

Paste one item per line and get XML back - each line becomes a child element wrapped by a parent you choose. Ampersands, angle brackets, and unicode are escaped automatically, blank lines are dropped, and every character is processed in your browser.

Input
Ready
Output
Live

Turn a list into valid XML

This is a simple one-level XML builder: the input is a list of values, the output is a parent element containing one child per list item. It is built for the common case where you have a bunch of strings and you need to drop them into an XML-consuming API, config file, or data export, not for crafting nested documents with attributes.

Every character that has a special meaning in XML element content - `&`, `<`, and `>` - is escaped to `&amp;`, `&lt;`, and `&gt;` so the result parses cleanly in any standards-compliant XML reader. Blank lines are skipped so trailing whitespace in the input never produces empty tags. Two-space indentation is fixed so the output diffs cleanly in version control.

Tag names you type are used as-is. XML requires names to start with a letter or underscore and contain only letters, digits, hyphens, underscores, or periods - if you type something that violates those rules (spaces, `<`, slashes), the output will still be generated but most parsers will reject it. There is no attribute support in this tool; values go in text content only.

How to use convert a list to xml

  1. 1Paste your list into the input panel, one value per line
  2. 2Set the Item tag - the element name wrapping each value (defaults to <item>)
  3. 3Set the Wrapper tag - the single parent element wrapping all the items (defaults to <list>)
  4. 4The output updates live as you type; blank lines are skipped and & < > are escaped for you
  5. 5Copy the XML or download it as an .xml file from the output panel

Keyboard shortcuts

Drive ListShift without touching the mouse.

Shortcut Action
Ctrl ZUndo last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor
EscExit fullscreen
Ctrl KOpen the command palette to jump to any tool
Ctrl SSave current pipeline draft Plus
Ctrl PRun a saved pipeline Plus

What this tool actually does

Fixed behaviors to know before you rely on the output.

One item per line, one element per item

Each non-blank line becomes exactly one element. There is no nesting, no grouping, and no attribute support - this is a flat builder by design. If you need nested documents, generate the inner fragment here and paste it into your larger template.

Automatic XML entity escaping

The three characters that break element text in XML - `&`, `<`, `>` - are converted to their entity forms (`&amp;`, `&lt;`, `&gt;`) on every line. You can paste content that contains HTML tags or ampersands and the output will still parse as valid XML.

Blank input lines are dropped

Empty lines and whitespace-only lines are filtered out before generation. That means the output never contains empty elements like `<item></item>` just because a line in your input happened to be blank. If you need empty placeholders, put a real value there (even a single space still has to be trimmed - currently it is dropped too).

Custom item and wrapper tags

Type any tag name into the Item tag or Wrapper tag fields - `user`, `product`, `row`, `entry`, `emails`, `catalog`, whatever your consuming system expects. The tool uses the name exactly as typed; make sure it is a valid XML name (starts with a letter or underscore, no spaces or slashes).

Fixed two-space indentation

Every child element is indented with two spaces relative to the wrapper, producing a consistent and diffable layout. There is no tab or four-space variant - this keeps output predictable across any editor without needing an indentation option.

Worked example

Blank lines dropped, `&` and `<lead>` escaped automatically.

Input
Alice & Bob
<lead>
Carol
Output
<list>
  <item>Alice &amp; Bob</item>
  <item>&lt;lead&gt;</item>
  <item>Carol</item>
</list>

Settings reference

Two options. Everything else - escaping, blank-line skipping, indentation - is fixed.

Setting What it does Effect on the sample
Item tag: item The element name used for each non-blank input line Each value is wrapped in <item>…</item>
Wrapper tag: list The single parent element that contains all the items All items are nested inside a single <list>…</list>
Escaping (automatic) Every `&`, `<`, and `>` in a value is replaced with `&amp;`, `&lt;`, `&gt;` `Alice & Bob` becomes `Alice &amp; Bob`; `<lead>` becomes `&lt;lead&gt;`
Blank lines (automatic) Empty and whitespace-only lines are dropped before elements are emitted The trailing blank line in the sample produces no `<item></item>`

FAQ

Does this tool escape `&`, `<`, and `>` for me?
Yes, automatically, on every line. `&` becomes `&amp;`, `<` becomes `&lt;`, and `>` becomes `&gt;`. You can paste content that contains literal angle brackets or ampersands and the output is still valid XML.
What happens to blank lines in my input?
They are skipped. A blank or whitespace-only line does not produce an empty `<item></item>` in the output - the emitter filters them out before generating elements.
Can I use custom tag names like `user` or `product`?
Yes, type whatever you need into the Item tag and Wrapper tag fields. The tool uses the name exactly as you type it, so make sure it is a valid XML name - no spaces, no slashes, and it must start with a letter or underscore.
Does this tool support attributes or nested elements?
No. This is a flat, one-level converter by design: one line of input, one child element of text content. For nested or attribute-rich XML, generate a fragment here and paste it into your larger template.
Can I convert XML back into a list?
Yes, use convert-xml-to-a-list tool - it extracts the text content of every element (or a specific tag name) back into one line per item.