ExcelTool.io

HTML to Excel Converter

Paste HTML table markup or upload an HTML file, preview the detected table, and download it as a private .xlsx workbook.

Preview

RegionQuarterRevenue
NorthQ142000
SouthQ136500

How to Convert HTML Tables to Excel

  1. Paste or upload HTML - Paste markup into the box, or upload a saved .html or .htm file. A whole page is fine; only its tables are read.
  2. Pick the table - Every <table> in the markup appears in the Detected table list with its row count. The preview below shows the first 20 rows of the one you choose.
  3. Name the sheet - The Sheet name box starts at "HTML Table". Clear it to fall back to the table's <caption> instead.
  4. Convert and download - Press Convert to Excel, then Download Excel to save the .xlsx.

What the converter does with your markup

The markup is read by a small tag scanner rather than by the browser's HTML parser, so the same input produces the same rows whether the page is rendered on the server or in your browser. It walks the text looking for <table> elements and collects them in document order, naming each one after its <caption> where there is one and Table 1, Table 2 and so on where there is not.

  • Rows and cells - <tr> starts a row; each <td> and <th> adds one cell. <th> is not treated as anything special: a header row becomes the first row of data, not a frozen or bold header. <thead>, <tbody> and <tfoot> are read through in source order.
  • Cell text- what the browser would report as the cell's text content. Tags inside a cell are dropped and their text kept, so <b>Ada</b> &amp; <i>Grace</i> becomes Ada & Grace. Only the ends are trimmed. <br> adds no separator at all, so a<br>b arrives as ab in one cell.
  • Noise - <script> and <style> bodies are thrown away rather than treated as cell text, and comments, doctypes and processing instructions are skipped. A > inside a quoted attribute, as in title="a > b", does not end the tag early.
  • Broken markup - an unclosed <td> or <tr> is closed by the next one, so the tag soup you get from an old CMS still converts.
  • Empty cells - a cell holding nothing but whitespace becomes a blank cell rather than a space.
  • File encoding - an uploaded file is decoded from its byte order mark first, then by testing for UTF-16, then UTF-8, and only then falling back to Windows-1252. A page saved as Latin-1 by an older system reads correctly instead of arriving as mojibake.

Every cell arrives as text

HTML carries no type information - 42000 and 00123are both just characters between two tags - so the converter writes every cell to the workbook as a string. Excel marks those cells with the green "Number stored as text" triangle, and SUM over the column returns 0 until they are converted.

The trade is a real one rather than an oversight. Writing everything as text is what keeps 00123, a leading-zero ZIP code and a phone number starting 0044 intact; guessing at numbers would silently destroy all three. When you do want real numbers, select the column in Excel and use Convert to Number, or run the downloaded file through Convert Text to Number.

Edge cases

  • colspan and rowspan are ignored. Attributes are not read, so a cell spanning three columns produces one cell and the rest of the row shifts left. Merged header cells are the usual casualty.
  • Nested tables split apart. A table inside a cell becomes its own entry in the dropdown, and the cell that contained it comes through empty in the outer table.
  • Ragged rows stay ragged. Each row keeps however many cells it had; nothing is padded out to a rectangle.
  • Links lose their URLs. An <a href> contributes its visible text only. Images, form controls and CSS classes contribute nothing.
  • Unknown named entities stay literal. &amp;, &nbsp;, &mdash; and the rest of the common set are decoded, as are all numeric references; anything outside that list is left in the cell exactly as written.
  • Sheet names get cleaned. Excel forbids : \ / ? * [ ] in a sheet name and caps it at 31 characters, so those characters become spaces and long captions are truncated.
  • Layouts made of divs are invisible. If the grid on the page is built from <div> elements rather than a real <table>, nothing is detected.

When to use a different tool

Frequently Asked Questions

Related Tools