Home › Developer Tools › HTML Table Generator

HTML Table Generator

Type or paste your data into the grid, choose a style, and get clean, accessible HTML table code with matching CSS and a live preview. Nothing is uploaded: the table is built in your browser.

Last updated:

Click a cell to type. Enter moves down, Shift+Enter adds a line break, Tab moves right. Pasting several cells from a spreadsheet fills the grid.

Live preview

Advertisement

How to use the HTML Table Generator

  1. Enter your data: click a cell and type, or paste a block of cells copied from Excel or Google Sheets. Use Paste CSV / Excel to import a whole file's text.
  2. Adjust the structure with + Row, + Column, − Row and − Column; they act on the selected cell.
  3. Choose the look: style preset, borders, alignment, padding, header row or column, stripes and hover.
  4. Pick the CSS output: a class with a style block, inline styles for emails and CMS editors, or plain HTML for your own stylesheet.
  5. Copy the code with Copy HTML and Copy CSS, or download a complete HTML page.

Anatomy of an accessible HTML table

The generator outputs semantic markup that browsers, search engines and screen readers understand:

ElementPurpose
<table>The container for tabular data.
<caption>A visible title for the table; screen readers announce it first.
<thead>, <tbody>Group header rows and data rows. Browsers can repeat thead on each printed page.
<tr>A table row.
<th scope="col">A column header cell.
<th scope="row">A row header cell (the Header column option).
<td>A data cell.

Table styling tips

  • Use border-collapse: collapse so adjacent cell borders merge into single lines. Without it, every cell draws its own border with a gap between them.
  • Right-align numbers and use font-variant-numeric: tabular-nums so digits line up and amounts are easy to compare. The generator detects numeric columns such as prices, percentages and counts automatically.
  • Zebra stripes (tr:nth-child(even)) help readers follow long rows; a subtle hover color does the same on desktop.
  • Keep the header readable: strong contrast between header text and background (the Green and Dark header presets use white text on a dark fill).
  • Wide tables on phones: wrap the table in a container with overflow-x: auto instead of shrinking the text.
  • Emails: many email clients ignore <style> blocks, so choose Inline styles for newsletters and keep widths simple.

Importing data

The importer accepts comma, semicolon, tab and pipe separated text and detects the separator from the first line. Quoted CSV fields can contain commas, line breaks and doubled quotes ("He said ""hi"""). Markdown tables (| a | b |) are imported too, with the |---| divider line skipped. Need the reverse direction? Turn CSV into JSON with the CSV to JSON converter, or explore a large file first in the CSV viewer.

Frequently asked questions

How do I create a table in HTML?

A table is a <table> element containing rows (<tr>) made of header cells (<th>) and data cells (<td>). Put the header row in <thead> and the data rows in <tbody>, add a <caption> to describe the table, and give header cells scope="col" or scope="row" so screen readers can announce them. This generator writes that structure for you.

How do I convert an Excel sheet to an HTML table?

Select the cells in Excel or Google Sheets, copy them, click the first cell of the grid here and paste. The tab-separated data fills the grid, and the HTML updates instantly. You can also paste CSV text into the Paste CSV / Excel panel.

Should I use inline styles or a CSS class?

Use a class with a style block or stylesheet for websites: it keeps the HTML small and lets you restyle every table at once. Use inline styles when the destination strips <style> tags, such as many email clients and some CMS editors. Hover effects need CSS, so they are only available with the class option.

How do I make an HTML table responsive?

Keep the Responsive scroll wrapper option on. It wraps the table in a <div> with overflow-x: auto, so wide tables scroll sideways on phones instead of breaking the page layout.

How do I merge cells (colspan and rowspan)?

The grid creates a regular table without merged cells. After copying the code, add colspan="2" or rowspan="2" to the cell that should span and delete the cells it covers. Keep merged cells to a minimum because they make tables harder to read for screen readers.

Are tables bad for layout?

Tables are the right element for tabular data such as prices, schedules and comparisons. Do not use them to lay out page sections; use CSS grid or flexbox for that.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

CSV to JSONConvert CSV data to JSON with live preview.Markdown to HTMLConvert Markdown to clean HTML with a live editor.HTML FormatterBeautify and indent HTML code with a live preview.CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.CSS Selector TesterTest CSS selectors on your HTML: highlighted matches, match count and specificity.Google Maps Embed GeneratorTurn an address or coordinates into responsive Google Maps iframe embed code, no API key.HTML Color CodesAll 140 HTML color names with HEX and RGB codes, plus the 216 web-safe colors. Click to copy.HTML Editor (Live Preview)Write HTML, CSS and JavaScript and see a live, sandboxed preview as you type.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.JSON to CSVConvert JSON data to CSV for spreadsheets.Excel to CSVConvert XLSX spreadsheets to CSV.Excel Viewer (XLSX / XLS)Open XLSX, XLS and ODS spreadsheets in your browser without Excel.Line Ending ConverterConvert text and files between CRLF, LF and CR line endings.XML to JSONConvert XML to JSON with validation.Text Encoding ConverterDetect and convert text file encodings like UTF-8, UTF-16 and Latin-1.JSON ViewerExplore JSON as a collapsible tree, search keys and values and copy any node's path.TTF to WOFF2 ConverterConvert TTF and OTF fonts to WOFF2 or WOFF and get a ready @font-face CSS snippet.Chmod CalculatorConvert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation.JSON to TypeScriptGenerate TypeScript interfaces or types from JSON, with nested types and optional fields.Morse Code TranslatorTranslate text to Morse code and back, then play it as sound or a blinking light, or save a WAV.Hex to Text ConverterConvert hex to text and text to hex with UTF-8 support and space, 0x, \x or comma formats.JSON to XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.HTML to Markdown ConverterTurn HTML or pasted rich text into clean Markdown with tables and live preview.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.JSON ValidatorCheck JSON with the exact line and column of each error, fix tips and one-click auto-fix.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Base64 to ImagePaste a Base64 string or data URI to preview, identify and download the image.JSON CompareCompare two JSON documents and see every added, removed and changed path.Hex to DecimalConvert hex to decimal instantly with steps and signed mode.Decimal to HexConvert decimal to hex instantly with steps and signed mode.Binary to DecimalConvert binary to decimal instantly with steps and signed mode.Decimal to BinaryConvert decimal to binary instantly with steps and signed mode.Two's Complement CalculatorDecimal to two's complement binary and back for 4-64 bits, with invert-and-add-1 steps.XML to CSV ConverterConvert XML to CSV: detects repeating records, flattens nested data, pick your columns.CSV to XML ConverterConvert CSV to well-formed XML with custom root and row names, escaping and pretty print.TOML to JSON ConverterConvert TOML to JSON and JSON to TOML with a full v1.0 parser and clear error lines.CSV CleanerClean messy CSV in one click: trim spaces, drop empty rows and columns, fix headers, dedupe.CSV VLOOKUP ToolJoin two CSV or Excel files on a key column like VLOOKUP, with left, inner and full joins.Remove Duplicates in ExcelFind and remove or highlight duplicate rows in XLSX or CSV files by the columns you choose.GeoJSON ViewerView GeoJSON on a map, inspect and edit properties, validate against RFC 7946 and export.GPX ViewerOpen GPX tracks on a map with distance, elevation profile, moving time, speed and splits.JSON Repair ToolFix broken JSON automatically: trailing commas, quotes, comments, truncated data, with a diff.Karnaugh Map SolverSolve 2–6 variable K-maps: click cells or enter minterms to get the minimal SOP or POS with groups.Merge Excel FilesCombine XLSX, XLS and CSV files into one workbook or append all rows into a single sheet.Parquet File ViewerOpen Apache Parquet files in your browser: schema, rows, filters and CSV or JSON export.Query CSV with SQLRun SQL on CSV, Excel, JSON and Parquet files in your browser with DuckDB. Join and export.Online Serial MonitorTalk to Arduino, ESP32 and USB serial devices in your browser: log, send, plot and save.Split Excel FileSplit an Excel sheet into several files by row count or by each value in a column, as ZIP.SQL Create Table GeneratorDefine columns, keys, defaults and indexes; get CREATE TABLE SQL for MySQL, Postgres and more.SQL IN Clause GeneratorTurn a pasted list into a SQL IN ('a','b') clause with quoting, dedupe and 1,000-item chunks.SQL Online CompilerRun SQL queries online on SQLite with sample databases, a result grid, CSV export and .db save.SQL to ER DiagramPaste CREATE TABLE statements and get an entity-relationship diagram with keys and links.XML to XSD GeneratorGenerate an XML Schema (XSD) from sample XML: types, occurrences, attributes and namespaces.XML ValidatorCheck if XML is well-formed, see the exact line and column of each error and pretty-print it.Wildcard Mask CalculatorConvert a subnet mask or CIDR to a wildcard mask for ACLs and OSPF, with range and binary.CSV to VCF ConverterConvert a contacts CSV into a vCard (.vcf) file, mapping columns to name, phone, email and more.CSV to YAML ConverterConvert CSV rows to a YAML list of mappings with type inference and delimiter detection.Endianness ConverterSwap byte order of 16, 32 and 64-bit hex values and see big- and little-endian integers and floats.Excel to SQL ConverterTurn an Excel sheet into CREATE TABLE and INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server.Excel to VCF ConverterTurn an Excel contact list into a vCard .vcf file for iPhone, Android, Google or Outlook.File to C ArrayConvert any file into a C or C++ byte array header, like xxd -i, with const and PROGMEM options.Image to C ArrayConvert images to monochrome, RGB565 or RGB888 C arrays for OLED, LCD and TFT displays.JSON Merge ToolDeep-merge two or more JSON objects with array concat, replace or union and a conflict rule.JSONL to CSV ConverterConvert JSON Lines / NDJSON to CSV with flattened columns; streams large files locally.PHP Unserialize OnlineDecode PHP serialize() strings to JSON, a tree or print_r, and serialize JSON back to PHP.SQL Dialect ConverterTranslate SQL between MySQL, PostgreSQL, SQLite, SQL Server, Oracle, BigQuery and more.
See all 129 Data & File Format Converters →