> For the complete documentation index, see [llms.txt](https://doc.duaer.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/tools/markdown-table-to-excel.md).

# Markdown table to Excel (works on AI chat tables)

A free Duaer tool: paste a Markdown table, including one from an AI chat reply, and download Excel or CSV. Several tables become several sheets.

Interactive converter (runs in the browser, no upload): https://doc.duaer.com/tools/markdown-table-to-excel/

## How to use it

1. Copy the reply (or the raw Markdown) from your AI chat and paste it into the text box above.
2. Click "Convert" and check the preview.
3. Click "Download .xlsx" or "Download .csv".

## Conversion rules

- A table needs a separator row like `|---|---|` under the header; text around tables is ignored.
- `**bold**` and code markers are removed, `<br>` becomes a line break inside the cell, and `\|` turns back into a pipe.
- Numbers become numeric cells; long codes stay text.

## Automate it in Duaer

When an AI Agent node replies with a Markdown table, a Duaer Code node can split it into items before [Convert to File](/integrations/builtin/core-nodes/duaer-nodes-base.converttofile.md) › Convert to XLSX:

```
const separator = /^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/;
const out = [];
for (const item of $input.all()) {
  const rows = String(item.json.output ?? '')
    .split('\n')
    .filter((line) => line.trim().startsWith('|') && !separator.test(line))
    .map((line) => line.trim().replace(/^\||\|$/g, '').split('|').map((cell) => cell.trim()));
  const [header, ...body] = rows;
  for (const row of body) {
    out.push({ json: Object.fromEntries(header.map((name, i) => [name, row[i] ?? ''])) });
  }
}
return out;
```

`output` is the AI Agent reply field; change it to your field name.
## Questions

### The table I copied from a chat has no pipes.

Some chat apps copy a formatted table. Look for "Copy Markdown" or "Copy raw" first, then paste it into the Duaer converter.

### The reply has several tables.

The Duaer converter puts each table on its own sheet, and you can pick which one to export as CSV.

## Related

- [Free file converters from Duaer](https://doc.duaer.com/tools.md)
- [CSV to Excel converter (free, no upload)](https://doc.duaer.com/tools/csv-to-excel.md)
- [Excel to CSV converter (UTF-8, no upload)](https://doc.duaer.com/tools/excel-to-csv.md)
- [JSON to CSV converter (nested JSON flattened)](https://doc.duaer.com/tools/json-to-csv.md)
- [Split an array into separate items in Duaer](https://doc.duaer.com/snippets/split-array-into-items.md)

