Spreadsheet to HTML Table Converter
Convert spreadsheet data from Excel, Google Sheets, CSV, or TSV into clean semantic HTML table code. Paste or upload, preview, and copy instantly.
Paste spreadsheet data here (Ctrl+V)
or drop a CSV / TSV file
About
Transferring tabular data from spreadsheets into web pages introduces encoding errors, broken markup, and inconsistent delimiters more often than most developers expect. Excel alone uses three different clipboard formats depending on OS version, and CSV files from European locales swap commas for semicolons - a single misidentified delimiter corrupts every row. This converter parses raw clipboard or file input using RFC 4180-compliant logic, auto-detects the delimiter via frequency analysis, escapes all HTML entities to prevent XSS injection, and outputs clean semantic <table> markup ready for production. It handles quoted fields, embedded newlines, and cells containing special characters like &, <, and > without corruption.
Limitations: this tool processes plain-text representations of spreadsheet data. It does not parse binary .xlsx or .ods formats directly - paste from your spreadsheet application or export to CSV/TSV first. Maximum practical file size is around 50MB depending on browser memory. Pro tip: when pasting from Excel, the clipboard already contains tab-separated values - no export step is needed.
Formulas
Delimiter auto-detection uses frequency analysis. For each candidate delimiter d in the set {\t, ,, ;, |}, the algorithm counts occurrences per row and computes a consistency score:
The delimiter with the highest score and a count ≥ 1 per row wins. Ties are broken by priority order: tab > comma > semicolon > pipe.
CSV field parsing follows RFC 4180 as a finite state machine with three states: FIELD_START, QUOTED, UNQUOTED. Transitions occur on characters: delimiter d, double-quote ", newline \n, and any other character. Within QUOTED state, two consecutive quotes "" emit a literal quote. This handles embedded delimiters, newlines inside cells, and escaped quotes correctly.
HTML entity escaping applies the replacement chain: & → &, then < → <, then > → >, then " → ", then ' → '. Order matters: ampersand must be first to avoid double-escaping.
Reference Data
| Delimiter | Symbol | Common Source | Auto-Detected | RFC Standard | Notes |
|---|---|---|---|---|---|
| Tab | \t | Excel, Google Sheets (paste) | Yes | IANA TSV | Default clipboard format for spreadsheets |
| Comma | , | CSV exports (US/UK locale) | Yes | RFC 4180 | Fields with commas must be quoted |
| Semicolon | ; | CSV exports (EU locale) | Yes | - | Excel uses this in German, French, etc. |
| Pipe | | | Database exports, logs | Yes | - | Rare in user data, low false-positive rate |
| Double Quote | " | Field enclosure | N/A | RFC 4180 | Escaped as "" inside fields |
| Newline (CRLF) | \r\n | Windows systems | Normalized | RFC 4180 | Converted to \n internally |
| Newline (LF) | \n | Unix/macOS systems | Normalized | - | Primary line terminator |
| HTML Entity: & | & | User cell data | Escaped | HTML5 | Prevents broken markup |
| HTML Entity: < | < | User cell data | Escaped | HTML5 | Prevents XSS / tag injection |
| HTML Entity: > | > | User cell data | Escaped | HTML5 | Prevents broken markup |
| HTML Entity: " | " | User cell data | Escaped | HTML5 | Safe attribute values |
| HTML Entity: ' | ' | User cell data | Escaped | HTML5 | Safe attribute values |
| UTF-8 BOM | \uFEFF | Excel CSV export | Stripped | Unicode | Invisible character at file start |
| Empty Row | - | Trailing newlines | Trimmed | - | Trailing empty rows removed from output |
| thead Generation | - | First row option | Toggle | HTML5 | First row wrapped in <thead> |