CSV → XML

About the CSV ↔ XML playground

CSV ↔ XML converts tabular comma-separated data into structured XML and back again. Each CSV row becomes an XML element, with the header row supplying child element (or attribute) names. Going the other way, repeated XML elements are flattened back into rows and columns. It works in both directions, so you can move data between spreadsheet exports and XML-based systems without manual reformatting.

CSV (Comma-Separated Values) is a plain-text tabular format where rows are lines and fields are separated by commas, defined loosely by RFC 4180. XML (eXtensible Markup Language) is a hierarchical, tag-based markup language used for documents, configuration, and data interchange. This tool maps the flat grid of CSV onto a nested tree of XML elements, preserving every value while adapting to each format's structure.

HostedCSV ↔ XML runtime
mainentry file
single fileworkspace
stdinprogram input

How it works

1

Write

The main file is the entry point for each run.

2

Give it input

Use the Input panel to pipe standard input to your program when it needs data.

3

Run

Run sends your code to a fresh hosted runtime and streams the result into the output panel.

4

Keep or share

Your draft stays in this browser, and Share creates a separate snapshot link.

Input (CSV)

id,name,role
1,Ada,admin
2,Linus,user

Output (XML)

<rows>
  <row>
    <id>1</id>
    <name>Ada</name>
    <role>admin</role>
  </row>
  <row>
    <id>2</id>
    <name>Linus</name>
    <role>user</role>
  </row>
</rows>

Input (XML)

<rows>
  <row><city>Paris</city><code>FR</code></row>
</rows>

Output (CSV)

city,code
Paris,FR

Input (CSV with quoted comma)

id,name
1,"Smith, John"

Output (XML)

<rows>
  <row>
    <id>1</id>
    <name>Smith, John</name>
  </row>
</rows>

Input (CSV with special char)

id,note
1,a & b

Output (XML, escaped)

<rows>
  <row>
    <id>1</id>
    <note>a &amp; b</note>
  </row>
</rows>

Input (XML multiple rows)

<rows>
  <row><id>1</id><qty>2</qty></row>
  <row><id>2</id><qty>5</qty></row>
</rows>

Output (CSV)

id,qty
1,2
2,5

Input (CSV with empty field)

id,name,note
1,Ada,
2,Linus,vip

Output (XML)

<rows>
  <row>
    <id>1</id>
    <name>Ada</name>
    <note></note>
  </row>
  <row>
    <id>2</id>
    <name>Linus</name>
    <note>vip</note>
  </row>
</rows>

Input (XML with escaped entity)

<rows>
  <row><id>1</id><note>a &lt; b</note></row>
</rows>

Output (CSV)

id,note
1,a < b

How it works

The editor uses Monaco, the engine behind VS Code, with language-aware editing tools and familiar keyboard controls.

Both directions

Paste CSV to convert each row into a structured XML element.

Paste XML to flatten repeated elements back into rows and columns.

The CSV header row supplies child element (or attribute) names.

Grid-to-tree mapping

Each record row maps to one XML element under a single root.

Header names become the per-row child element or attribute names.

Every cell value is preserved as the conversion crosses formats.

When to use it

Moving spreadsheet exports into XML-based systems.

Pulling tabular data out of XML back into a flat CSV grid.

Privacy

Conversion runs locally in your browser — tabular data is never uploaded.

Works on exports with sensitive fields without leaving the page.

Every shortcut, searchable:

Editing

Undo
Ctrl+Z
Redo
Ctrl+⇧+Z
Select next occurrence
Ctrl+D
Delete line
Ctrl+⇧+K
Move line up / down
Alt+↑ / ↓
Copy line up / down
Alt+⇧+↑ / ↓
Toggle comment
Ctrl+/
Indent line
Ctrl+]
Outdent line
Ctrl+[

Navigation

Find
Ctrl+F
Find & replace
Ctrl+H
Go to line
Ctrl+G
Go to symbol
Ctrl+⇧+O

Selection

Select all
Ctrl+A
Select line
Ctrl+L
Select all occurrences
Ctrl+⇧+L
Shortcuts follow your OS — ⌘ becomes Ctrl on Windows and Linux.
It transforms CSV tabular data into nested XML elements, and can also flatten repeated XML elements back into CSV rows and columns.
Yes, it's bidirectional: convert CSV to XML or XML to CSV, so you can round-trip data between the two formats.
No. Everything runs in your browser; your CSV or XML is never sent to any server.
Yes, free to use with no limits or registration.
Reserved XML characters like &, <, and > are escaped as entities (&amp;, &lt;, &gt;) so the output stays well-formed.
plaintext
xml

Output

XML output

>_compilebytes

A fast place to write code and run it in isolated hosted runtimes. Free, forever.

Playgrounds

Python compilerC compilerJavaScript compilerC++ compilerTypeScript compilerGo compilerJava compilerRust compiler
All playgrounds →

Tools

JSON formatterRegex testerBase64 encoderJWT decoder
JSON formatterBase64 encoder & decoderRegex testerJWT decoder
All tools →

Company

TermsPrivacy[email protected]
© 2026 compilebytes115 runtimes · no signup115 runtimes · isolated sandboxes · no signup