Excel Data to HTML Table Converter
Convert copied Excel or Calc spreadsheet data into clean, semantic HTML table code. Supports TSV parsing, header rows, and Bootstrap classes.
About
Spreadsheet data pasted into a CMS or codebase without conversion produces broken layouts, invisible tab characters, and accessibility failures. This tool parses the tab-separated value (TSV) format that Excel and Calc place on the clipboard, then outputs standards-compliant <table> markup with proper <thead> and <tbody> semantics. All cell content is HTML-entity-escaped to prevent cross-site scripting. Output optionally includes Bootstrap table classes for rapid integration into existing frameworks.
The converter handles quoted fields per RFC 4180 rules: a cell containing a literal tab, newline, or double-quote is preserved correctly when wrapped in double-quotes by the spreadsheet application. Limitation: merged cells in the source spreadsheet are flattened into the top-left cell value only. Column count is normalised to the longest row; short rows receive empty <td> elements to keep the grid rectangular.
Formulas
The conversion pipeline follows a deterministic three-stage process:
Where grid is a 2D array of dimensions R Γ C, with R = number of non-empty rows and C = max(colsi) across all rows. Padding rule: if len(rowi) < C, append (C β len(rowi)) empty strings.
Reference Data
| Feature | Description | Default |
|---|---|---|
| First Row as Header | Wraps first row cells in <th> inside <thead> | Enabled |
| Bootstrap Classes | Adds table table-striped table-bordered to <table> | Disabled |
| Compact Output | Removes indentation and newlines from HTML output | Disabled |
| Tab Character | U+0009 Horizontal Tab - Excel clipboard delimiter | - |
| Newline Handling | Supports CR, LF, and CRLF line endings | Auto-detect |
| Quoted Field Rule | Fields containing tabs or newlines are wrapped in double-quotes by Excel | RFC 4180 |
| HTML Escaping | & β &, < β <, > β >, " β " | Always |
| Max Columns Detected | Longest row determines column count; shorter rows are padded | - |
| Empty Cell Output | Generates <td></td> for blank cells | - |
| Clipboard API | Uses navigator.clipboard.readText() with fallback to manual paste | - |
| Copy Output | Copies generated HTML to clipboard via Clipboard API or execCommand fallback | - |
| Download | Exports output as .html file via Blob URL | - |
| LocalStorage | Persists input text and options across sessions | Enabled |
| Semantic Markup | Uses <thead>, <tbody>, <th scope="col"> | When header enabled |
| Accessibility | Output table includes role and aria attributes guidance | - |