A price list, a result sheet or a timetable often starts in Excel and ends up on a web page. Rebuilding it by hand is slow and the usual shortcut, copying cells straight into an editor, can bring a pile of stray formatting with it. Our free Excel to HTML Table tool reads an .xlsx or .csv file, or cells you paste from Excel or Google Sheets, and gives you clean table code you can copy.
This guide covers every option, the three styling modes, how numbers are aligned, and the problems to expect. If you want a Markdown table instead, see how to make a Markdown table from Excel or Google Sheets.
What Excel to HTML Table does
It turns rows and columns into a <table> with a <thead> for the header row and a <tbody> for the rest. You see the code, a live preview, and the size of the result. It can also switch the same data to a Markdown table.
It reads the text each cell displays, so a date shows as Excel shows it and a formula shows its last calculated result. It does not carry over fonts, colours, column widths, merged-cell layout or hyperlinks. The table is data plus the styling you choose here.
How to use Excel to HTML Table, step by step
- Open Excel to HTML Table.
- Press "Choose an Excel or CSV file", or paste into the box labelled "Or paste cells copied from Excel or Google Sheets, or CSV text". Press Sample to try it first.
- If the workbook has several sheets, pick one in Sheet.
- Set the options in the Table options panel.
- Check the Live preview.
- Under Code, make sure Output format says "HTML table", then press "Copy HTML" or "Download .html".
The code updates as soon as you change an option.
Every option explained
Styling
This choice matters most, because it decides how much CSS goes into the code.
Inline styles (works anywhere) writes borders, padding and alignment into every tag. The table looks right in an email, a CMS or a page with no stylesheet:
<table style="border-collapse:collapse;width:100%">
<thead>
<tr>
<th scope="col" style="border:1px solid #d0d5dd;padding:8px 12px;text-align:left;background-color:#f2f4f7">Item</th>
<th scope="col" style="border:1px solid #d0d5dd;padding:8px 12px;text-align:right;background-color:#f2f4f7">Qty</th>
Classes only (your CSS) writes no styles. Number cells get the class num, and you can name the table's own class in the Table class box (the default is table):
<table class="table table-striped">
<thead>
<tr>
<th scope="col">Item</th>
<th scope="col" class="num">Qty</th>
The Table class box only appears in this mode. It accepts letters, digits, hyphens, underscores and spaces, so table table-striped works. Anything else is removed.
Plain, no styling writes bare markup: no style or class attributes at all, whatever else is ticked. "Right-align numbers" then only affects the Markdown table.
Caption (optional)
Text for the table's <caption>, up to 200 characters. A caption names the table for people using screen readers and gives search engines context. Leave it empty for no caption. In inline mode the caption is left-aligned and semi-bold.
Rows to include
All rows, or the first 10, 25, 50, 100, 500, 1,000 or 5,000 body rows. The header row is not counted. A note says "N more rows left out by “Rows to include”" when rows were cut. Use this for a sample or a "top 10" table.
Indent (HTML)
2 spaces, 4 spaces or Tabs. It changes only the layout of the code, not the table.
First row is the header
Ticked by default. The first row goes in <thead> as <th scope="col"> cells. Untick it if the sheet has no header; then every row is body, and the table has no <thead>.
Right-align numbers
Ticked by default. A column is right-aligned, header included, when at least 80% of its filled body cells look like numbers. That covers thousands separators, currency signs, percentages and brackets for negatives. Text, dates and values such as 007 or 01712345678 stay left. In an Excel file, any cell that Excel stores as a number counts, so a column of ID codes stored as numbers will be right-aligned. Untick the option if that looks wrong.
Skip empty rows
Ticked by default. Rows with no text anywhere are dropped.
What it accepts and its limits
- Files:
.xlsx,.xlsm,.xltx,.xltm, and.csv,.tsvor.txttext. Up to 100 MB. - Old
.xlsfiles: refused with a message asking you to save them as.xlsxfirst. - Pasted text: tab-separated cells copied from Excel or Google Sheets, or comma, semicolon or pipe separated text. The separator is detected automatically. A cell with a line break inside it is kept, and the break becomes
<br>. - Preview: the first 200 rows. The code has them all.
- Code box: shows the first 200,000 characters of a very large result. Copy and Download give everything.
- Paste box: it only appears when no file is loaded. Press Change file to go back to it.
- Merged cells: the value stays in the top-left cell and the others are empty, which is how Excel stores them.
Privacy
Excel to HTML Table runs in your browser. The file or pasted text is converted on your device and is never uploaded.
The output is safe to publish as far as the data goes. Every cell is escaped, so <, >, & and quotes in your data appear as text and cannot inject tags or scripts. The live preview is built from plain table cells, not by injecting the HTML.
A worked example
Copy these cells from a sheet (they arrive tab-separated):
Product Qty Price In stock
Notebook A5 120 $4.50 yes
Gel pen, blue 1,500 $1.25 yes
Desk lamp 8 $39.00 no
Sticky notes <3 300 $2.10 yes
Paste them. The tool right-aligns Qty and Price, and the last row's text is written as Sticky notes <3, so it shows as a literal "<3" on the page. The stat line reads 4 rows and 4 columns. Choose "Classes only", type Stock list as the Caption, and the code starts:
<table class="table">
<caption>Stock list</caption>
<thead>
That is the Sample button's data, so you can try it yourself.
Where to paste the code
- A CMS or blog editor: use a "Custom HTML" or "Code" block, not the visual editor, which may rewrite the markup. With Inline styles the borders survive most editors.
- An email: Inline styles is the safest mode, because many email programs ignore style sheets.
- Your own site: use Classes only and style
table,th,tdand.numin your CSS. Keep right alignment in.num { text-align: right; }. - A full page: press "Download .html" to get a complete document with
<!doctype html>,lang="en", a title taken from the file name, and a viewport tag.
Wide tables can overflow a phone screen. Wrap the table in a <div style="overflow-x:auto"> yourself if your page has many columns.
Tips to work faster
- Clean the sheet first: delete helper columns and notes under the data. The tool converts everything on the sheet.
- Use a short header row. Long headers make narrow screens harder to read.
- Set a Caption. It costs nothing and helps accessibility.
- If the numbers are stored as text with spaces or symbols, check the right-alignment in the preview before copying.
- For data headed into code rather than a page, Excel to JSON is the better fit.
Common problems and how to fix them
Dates look different from Excel
The tool shows the text Excel displays, so check the cell's number format in Excel. If it shows 46082, the cell was formatted as a number, not a date.
A number column is on the left
Fewer than 80% of its filled cells looked like numbers. A single unit such as 12 kg or a stray note in the column can cause this.
The table has no header
"First row is the header" is unticked. Tick it and the first row moves into <thead>.
The code is huge
Inline styles repeat the same CSS in every cell. Switch to Classes only, or limit the rows with Rows to include.
Links and bold text are missing
They are not carried over, because the table is built from cell text. Add links in your CMS after pasting.
Related tools
- Excel to JSON: the same sheet as JSON for an app.
- CSV to Excel: fix a CSV before turning it into a table.
- Markdown Previewer: check a Markdown table before you publish it.
- Developer Tools: the other converters in this group.
Quick checklist
- Choose Inline styles for email and CMS, Classes only for your own site.
- Add a Caption.
- Check which columns were right-aligned.
- Use Rows to include for a long sheet.
- Paste into a code or HTML block, not the visual editor.



