Convert Markdown to HTML Table Online
Convert a Markdown table into a standalone HTML <table> element. The table is read in your browser and never uploaded.
Drop a CSV or Excel file here
CSV · XLSX · XLS · XLSM · XLSB
Ready to download as a binary file.
How to convert a Markdown table to HTML
Three steps from shortcuts.md to an HTML table.
1. Paste the table
Paste a Markdown pipe table or drop a .md file.
2. Check it in the grid
Look for inline Markdown in cells. This converter handles the table structure, not inline formatting, so the backticks around Ctrl+C stay as text.
3. Set the markup options
Keep or drop thead/tbody, escaping and minifying, add a class name, then copy the markup or download data.html.
Example: Markdown in, HTML out
A keyboard shortcut table with inline code in every data cell.
| Action | Windows | macOS |
| ------------- | -------------- | ------------- |
| Copy | `Ctrl+C` | `Cmd+C` |
| Paste as text | `Ctrl+Shift+V` | `Cmd+Shift+V` |<table>
<thead>
<tr>
<th>Action</th>
<th>Windows</th>
<th>macOS</th>
</tr>
</thead>
<tbody>
<tr>
<td>Copy</td>
<td>`Ctrl+C`</td>
<td>`Cmd+C`</td>
</tr>
<tr>
<td>Paste as text</td>
<td>`Ctrl+Shift+V`</td>
<td>`Cmd+Shift+V`</td>
</tr>
</tbody>
</table>If the shortcuts should be wrapped in <code>, run the whole document through a Markdown renderer such as marked or markdown-it. This page is for when you want just the table, as text.
What changes between Markdown and HTML
Markup
The header row becomes <th> cells inside <thead>, the data rows go into <tbody>. Untick thead/tbody for bare <tr> rows (the first still uses <th>). Minify removes indentation and line breaks.
Escaping
&, <, >, " and ' are turned into entities, so cell text can never inject markup. Untick Escape HTML only if a column holds markup you want the browser to render.
Inline Markdown stays literal
Cells are read as text, not rendered: `Ctrl+C` keeps its markers in the HTML. An escaped \| inside a cell becomes a plain |.
When to convert Markdown to HTML
- Moving a table from Markdown docs into a CMS that only accepts HTML.
- Getting table markup for an email or a page where no Markdown renderer runs.
Markdown to HTML in JavaScript
A pipe table is easy to split by hand. Then every value is escaped into a <table>.
import { readFile } from 'node:fs/promises';
const lines = (await readFile('shortcuts.md', 'utf8')).split('\n').filter((l) => l.includes('|'));
const cells = (line) => line.trim().replace(/^\||\|$/g, '')
.split(/(?<!\\)\|/).map((c) => c.trim().replace(/\\\|/g, '|'));
const header = cells(lines[0]);
const rows = lines.slice(2).map(cells); // lines[1] is the separator
const esc = (v) => String(v ?? '').replace(/&/g, '&').replace(/</g, '<')
.replace(/>/g, '>').replace(/"/g, '"');
const tr = (cells, tag) => '<tr>' + cells.map((c) => `<${tag}>${esc(c)}</${tag}>`).join('') + '</tr>';
console.log(`<table>\n<thead>${tr(header, 'th')}</thead>\n<tbody>\n` +
rows.map((row) => tr(header.map((_, i) => row[i]), 'td')).join('\n') + '\n</tbody>\n</table>');Like this page, the split skips the separator line and honours escaped pipes.
Frequently asked questions
Is the column alignment kept as CSS?
No. The :---: and ---: markers are dropped when the table is read, and the HTML has no style attributes. Set text-align in your CSS.
Do I get a full HTML page?
No, only the <table> element. Paste it into your page or template, where your CSS styles it.
Is bold, code or link formatting kept?
It is kept as literal text, not interpreted. **bold** keeps its asterisks and [text](url) stays as written. Clean the cells in the grid if you want plain values.
Is the table accessible?
Header cells are real <th> elements inside <thead>, which screen readers use to announce column names. Add a <caption> yourself if the table needs a title.
Does shortcuts.md get uploaded when I convert it to HTML?
No. The table is read in your browser and never uploaded.