AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I convert an Excel file to XML?

Drop an .xlsx or .xlsm workbook into AnyTool Excel to XML, pick a sheet, name the root and row elements, and choose for each column whether it becomes a child element or an attribute. It reads the workbook with the ExcelJS engine, formats dates and formula results, escapes special characters, and shows the XML live. Everything runs in your browser, so the workbook is never uploaded.

  • Per-column toggle: write each field as an element or an attribute
  • Custom root and row element names (e.g. <data> / <record>)
  • Multi-sheet: convert one sheet or combine every sheet into one file
  • ISO / locale / serial date handling, CDATA-safe text, namespaces, 2/4-space indent
  • 100% in your browser — no upload, no signup, works offline

What is

Excel to XML Conversion

Excel to XML conversion turns the rows of a spreadsheet into a nested XML document. Each worksheet row becomes a repeating element inside a single root element, and each column becomes either a child element or an attribute on that row. Header names are sanitised into valid XML names — spaces and illegal characters become underscores and names that start with a digit get an underscore prefix — while dates and formula results are converted to text values.

Converters

Related terms

XML element vs attributeXLSX workbookCDATAXML namespace

Frequently Asked Questions

Yes. Click any column to toggle it between a child element and an attribute on the row.

Element mode wraps each cell value in its own child tag, while attribute mode places it as name="value" on the row element — handy for IDs and metadata. You can mix both in one document, and AnyTool de-duplicates attribute names and XML-escapes every value so the output stays well-formed.

Yes. Convert a single selected sheet, or combine every sheet into one XML file with a wrapper per sheet.

AnyTool lists every worksheet with its row and column counts. Pick one to export it on its own, or enable multi-sheet mode to nest each sheet in its own <sheet name="…"> wrapper inside the root element. Per-column element/attribute mapping is configured for each sheet independently.

No. Parsing and XML generation run entirely in your browser, so nothing is sent to a server.

The .xlsx file is read with the File API and converted to XML with the ExcelJS library on your device. No data is uploaded, there is no tracking, and the tool keeps working offline after the first load — which matters when the spreadsheet holds financial or customer data.

Formula results are used as values and dates are written as ISO, locale or Excel-serial text.

AnyTool reads the cached result of each formula rather than the formula text, and converts date cells to your chosen format: ISO (YYYY-MM-DD or full timestamp), your locale string, or the raw Excel serial number. Rich text and hyperlinks are flattened to their text, and every value is XML-escaped — or wrapped in CDATA if you enable it.

Detailed Explanation

Methodology

How the Excel to XML Converter Works

AnyTool Excel to XML reads the uploaded .xlsx or .xlsm workbook with the File API and parses it with the ExcelJS library, entirely in the browser. The first row of the selected sheet supplies the column names, and each subsequent row is wrapped in a configurable row element inside a single configurable root element. For each column the tool emits either a child element or, if you toggle that column, an attribute on the row. Cell values are normalised before they are written: formula cells use their cached result rather than the formula text, date cells are formatted as ISO, locale or Excel-serial values, and rich text and hyperlink cells are flattened to plain text. Header names are sanitised into valid XML names — illegal characters become underscores and names that start with a digit get an underscore prefix — and every value is XML-escaped. The XML regenerates live in a debounced effect as you change sheets, names or options, with nothing sent to a server.

  • ExcelJS engine parses .xlsx/.xlsm in the browser
  • Header row supplies column names; rows wrapped in a configurable row element
  • Per-column choice of child element or attribute on the row
  • Formula results used as values; dates as ISO, locale or Excel-serial
  • Conversion regenerates live in the browser — no server round-trip
How It Works

Element vs Attribute Mapping and Multi-Sheet Output

XML can represent a spreadsheet column two ways, and AnyTool lets you decide per column. Element mode writes each value as its own child tag (<email>alice@example.com</email>), which suits repeated or structured data; attribute mode writes it as name="value" on the row element (<record id="1">), which suits identifiers and metadata. Duplicate attribute names are de-duplicated automatically, and mapping is configured independently for each sheet. Workbooks with several sheets can be handled two ways: convert a single selected sheet, or enable multi-sheet mode to nest each sheet in its own <sheet name="…"> wrapper inside the root element. For text containing markup-like characters you can wrap element content in CDATA — always or only when a value contains <, > or & — with any embedded ]]> sequence split safely. The document can include an XML declaration, an optional default namespace and a 2- or 4-space indent.

  • Click any column to switch it between element and attribute output
  • Independent per-sheet mapping; mixed element/attribute in one file
  • Single-sheet export or combined multi-sheet output with <sheet> wrappers
  • Optional CDATA wrapping with safe ]]> splitting
  • Optional XML declaration, namespace URI and 2- or 4-space indent
Privacy & Security

Privacy and Offline Use

The entire conversion — parsing the workbook and generating the XML — runs in client-side JavaScript with the ExcelJS engine, so the file never leaves the device, there is no account or tracking, and the tool works offline after first load. That matters because spreadsheets frequently contain financial, HR or customer records. Unlike most online Excel-to-XML services, which upload the workbook to a server for processing, AnyTool keeps it local. Output can be downloaded as a .xml file in UTF-8, UTF-16 or ISO-8859-1, or copied to the clipboard, all within a 50 MB input cap and uploading nothing.

Excel to XML: in-browser (AnyTool) vs typical online converters
CapabilityAnyToolTypical online converters
ProcessingRuns in your browserUsually uploaded to a server
PrivacyWorkbook never leaves the deviceFile transmitted and often stored
Element vs attributePer-column toggle, mixed in one fileOften all-elements only
Custom namesRoot and row element names editableFrequently fixed <root>/<row>
Multi-sheetOne sheet or all sheets combinedOften first sheet only
Dates / formulasISO/locale/serial dates, formula resultsOften raw serials or blanks
Works offlineYes, after first loadNo
Cost / signupFree, no signupOften gated, capped or ad-heavy

AnyTool parses the workbook and writes the XML entirely in the browser and uploads nothing.