FormatterHQ

Excel to HTML Table Converter

Turn a worksheet into clean table markup you can paste into a web page, CMS or email. Preview the result, add optional styling, and keep the file on your own computer.

Input CSV
Output HTML
Ready.

How to use the Excel to HTML Table Converter

  1. Drop an .xlsx, .xls, .ods or .csv file on the dropzone, or click it to choose one.
  2. Type a sheet name or number if you do not want the first sheet, and keep First row is header ticked so row 1 becomes the <thead>.
  3. Pick a Layout and a Styling option (No CSS, Bordered or Striped rows).
  4. Click Convert to HTML and open the Preview tab to see the rendered table.
  5. Copy the markup, or use Download to save it as an .html file.

Excel to HTML: publish a sheet as a table

When a schedule, price list or results sheet has to appear on a website, in a help center article or in a newsletter, retyping it cell by cell is slow and error-prone. This excel to html converter reads the workbook and writes a standard <table> with a <thead> built from the header row and one <tr> per data row, ready to paste into an HTML editor.

The markup contains no classes, inline styles or spreadsheet-specific attributes, so it picks up the styles of the page you paste it into. If you want a styled table out of the box, add one of the two built-in themes.

Example

A sheet named Schedule with the columns Day, Session and Room converts, with the default options, to:

<table>
  <thead>
    <tr>
      <th>Day</th>
      <th>Session</th>
      <th>Room</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Mon</td>
      <td>Kickoff &amp; goals</td>
      <td>A1</td>
    </tr>
  </tbody>
</table>

Special characters such as &, < and > in cells are escaped, so text like Kickoff & goals displays correctly and a cell cannot inject markup into your page.

Layout options

  • Auto – writes one flat table for a single sheet. When you tick Convert all sheets, it produces an outer table with one row per sheet: the sheet name in a <th> and that sheet's table nested in the cell next to it.
  • Single flat table – always one table with a header row. Fine for one sheet; with several sheets it would squeeze the whole workbook into one very wide row, so convert sheets one at a time instead.
  • Nested tables – for a single sheet, the same table in compact form with each row on one line (<tr><td>Mon</td><td>…</td></tr>). The shorter markup is handy for email templates and CMS fields with size limits.

Styling options

No CSS outputs the bare table. Bordered adds a small <style> block above the table with collapsed 1px borders, cell padding, a blue header row with white text and a light highlight on row hover. Striped rows adds the same rules plus a light gray background on every second body row.

The style block targets the table, th and td selectors directly. That is convenient for a standalone page, but on a site with its own table styles it will affect other tables too. In that case pick No CSS and style the table through your own stylesheet or a class you add.

Web page or email?

For a web page or CMS, paste the table into the HTML or source view of the editor rather than the visual view, which would show the tags as text. For email, keep in mind that many mail clients drop or ignore <style> blocks, so borders and stripes may not survive; mail clients generally keep plain table structure. Test with the client your readers use.

The Preview tab renders the table as it will look in a browser. If you download while the Preview tab is active, you get a complete HTML page including the styling; from the Code tab you get the table markup alone.

What is carried over from Excel

Only cell values are converted. Fonts, fills, borders, column widths and conditional formatting are not read. Numbers appear as stored values without currency or thousands formatting, dates as YYYY-MM-DD, and a blank header cell becomes column1, column2 and so on, by position. Merged cells are not re-created as colspan or rowspan; the value appears only in the first cell of the merged range.

To build or edit a table by hand, the HTML table generator gives you a grid editor. If your data is already a CSV export, CSV to HTML does the same job from text, and Excel viewer lets you look through a workbook before deciding what to publish.

Privacy

The spreadsheet is read and converted inside your browser, and the file is not uploaded. Only the optional Save & Share feature stores content on our server.

Convert Excel to an HTML table in Python

Python has no built-in reader for .xlsx files; openpyxl is the usual choice. Load the workbook with data_only=True, otherwise a formula cell returns its formula text, such as =1+2, instead of the result saved in the file. iter_rows(values_only=True) then yields each row as a tuple of cell values. Empty cells come back as None, so replace them before you build the table, and pass all text through html.escape(). The example writes a small sample file first so that it runs as shown.

# pip install openpyxl
import html

from openpyxl import Workbook, load_workbook

wb = Workbook()                       # build a tiny sample file
wb.active.append(["product", "price"])
wb.active.append(["Tea & Code", 24.5])
wb.active.append(["Desk Lamp", None])
wb.save("sample.xlsx")

ws = load_workbook("sample.xlsx", data_only=True).active
print("<table>")
for row in ws.iter_rows(values_only=True):
    cells = ("" if value is None else html.escape(str(value)) for value in row)
    print("  <tr>" + "".join(f"<td>{cell}</td>" for cell in cells) + "</tr>")
print("</table>")

To turn a real workbook into a table without writing code, drop the file into the converter above.

Frequently asked questions

Does the HTML keep my Excel colors and fonts?
No. The converter reads cell values only, not cell formatting. Use the Bordered or Striped rows styling for a clean default look, or apply your own CSS to the plain table.
How do I put the table into WordPress or another CMS?
Copy the output, switch the editor to its HTML or code view (in WordPress, a Custom HTML block), and paste it there. Pasting into the visual editor may show the tags as text.
Are merged cells converted to colspan or rowspan?
No. The value of a merged range appears in its top-left cell and the other cells are empty. Unmerge the cells in Excel and fill in the values if every row should show them.
Can I convert several sheets into one page?
Yes. Tick Convert all sheets and keep Layout on Auto. Each sheet name appears as a heading cell with that sheet's table next to it.
Why do numbers show without the currency symbol?
Excel stores 24.5 and displays it as $24.50 through a number format. The HTML gets the stored value. Format the column as text in Excel, or edit the cells in the output, if the symbol must appear.

Last updated October 3, 2026

Related tools