PicoToolkit
Extracted data:
View Settings
Applies to real TAB characters.
0 characters
0 without spaces
0 words
0 lines
IndexValue
No matching items found
Spotted a bug or have an idea for a new feature? Let us know here »

XML to CSV Converter

Turn any XML into CSV format with PicoToolkit

Turn any XML into CSV format with PicoToolkit

Convert XML files into clean CSV tables in seconds — ideal for analysts, developers and e-commerce teams who need spreadsheet-ready data. Online, no install required; supports commas, tabs, pipes and custom delimiters.

How to use

  1. Paste or upload your XML into the input area.
  2. Choose a record node (the XML element that represents one row) and pick a delimiter (comma, tab, pipe, semicolon).
  3. Preview the mapping — tag names become CSV headers, attributes appear as separate columns.
  4. Download the CSV or copy the output to your clipboard.

Note: the converter handles files up to what your browser and available memory can handle.

usage

Common use cases

  • Convert product feeds to CSV for Google Shopping or other marketplaces.
  • Extract logistics/warehouse feeds (availability, dimensions, weight, location).
  • Turn sitemap.xml or RSS/ATOM feeds into URL lists for analysis.
  • Flatten API XML responses for import into spreadsheets or databases.

Examples

Example A — Product feed (Google Shopping style)

Input (sample XML):

<products>
  <product>
    <id>123</id>
    <title>Blue T-shirt</title>
    <price currency="USD">19.99</price>
    <availability>in stock</availability>
    <gtin>0001234567890</gtin>
  </product>
</products>

Output (CSV):

id,title,price_currency,price,availability,gtin
123,"Blue T-shirt",USD,19.99,"in stock",0001234567890

Notes: element text becomes a column. Attributes (like price currency) become separate columns (price_currency above).

Example B — Logistics feed (availability & dimensions)

Input (sample XML):

<shipments>
  <item>
    <sku>A-11</sku>
    <available>true</available>
    <dimensions>
      <length>30</length>
      <width>20</width>
      <height>10</height>
    </dimensions>
    <weight unit="kg">1.5</weight>
    <location>WH-01</location>
  </item>
</shipments>

Output (CSV):

sku,available,dimensions_length,dimensions_width,dimensions_height,weight_unit,weight,location
A-11,true,30,20,10,kg,1.5,WH-01

Tip: numeric formats and units are preserved as text; normalize units before conversion if you need consistent numeric columns.

Example C — Sitemap / RSS

Input (sitemap):

<urlset>
  <url>
    <loc>https://example.com/page1</loc>
    <lastmod>2023-09-01</lastmod>
    <priority>0.8</priority>
  </url>
</urlset>

Output (CSV):

loc,lastmod,priority
https://example.com/page1,2023-09-01,0.8

Example D — Nested / repeated elements

Input (multiple images per product):

<products>
  <product>
    <id>222</id>
    <title>Sneakers</title>
    <images>
      <image>img1.jpg</image>
      <image>img2.jpg</image>
    </images>
  </product>
</products>

Two common outputs:

  • Flattened (one row per product; repeated values concatenated):
    id,title,images
    222,"Sneakers","img1.jpg|img2.jpg"
    Use a pipe or semicolon as a separator inside the cell.
  • Expanded (one row per repeated child):
    id,title,image
    222,"Sneakers",img1.jpg
    222,"Sneakers",img2.jpg
    Choose this when you need one record per child element.

example 1a

example 1b

Tips & edge cases

  • Attributes vs elements: attributes become separate columns (attribute names appended to the element column name if needed).
  • Missing tags produce empty cells — clean or normalize data first if needed.
  • Namespaces: tags with namespaces are converted using their full name (you may need to pre-clean namespaces for simpler headers).
  • Repeated child nodes: choose flattening (concatenate) or expansion (multiple rows) depending on your workflow.
  • Escaping: fields containing delimiters or newlines are quoted; embedded quotes are doubled per CSV rules.
  • Encoding: use UTF-8 for best results; ensure your browser handles the file encoding correctly.
  • Pre-process suggestions: remove irrelevant nodes, normalize date formats, or trim whitespace to get cleaner CSV output.

Troubleshooting & when not to use

  • If XML is extremely large or deeply nested and needs custom mapping (complex XPath transforms), consider a script or ETL tool instead.
  • If you require a strict schema mapping or advanced transformations, export to JSON first (use /text/xml-to-json) and process programmatically.

FAQ

Can I convert sitemap.xml to CSV?
Yes — choose the URL-level node (usually <url>) as the record node and export loc, lastmod, priority, etc.
How are XML attributes handled?
Attributes are converted into separate columns. For example, <price currency="USD"> becomes two columns: price_currency and price.
Can I convert multiple records in one file?
Yes — each chosen record node becomes a CSV row. Repeated child elements can either be concatenated into one cell or expanded into multiple rows.
Do I need to install anything?
No — the tool runs in your browser. Files are processed client-side.
What file sizes are supported?
Files are limited only by what your browser and device memory can handle.

Works best with other PicoToolkit converters

The XML to CSV Converter is part of the versatile PicoToolkit suite, which includes other useful converters such as CSV to XML, CSV to HTML table, HTML table to CSV, JSON to CSV, and Transpose CSV. Using these tools in combination allows for a comprehensive approach to data conversion.

Related tools

PicoToolkit evolves fast. Stay ahead.

Get early access to new tools, features, and productivity upgrades.

Unsubscribe anytime.
© PicoToolkit 2022-2026 All rights reserved. Before using this website read and accept terms of use and privacy policy. Icons by Icons8