Home › Developer Tools › CSV to HTML Table

CSV to HTML Table

Paste CSV or upload a file and get clean, properly escaped HTML table code with a live preview. Choose plain markup, CSS classes or inline styles for emails and CMS editors, then copy or download.

Last updated:

Converts automatically as you type. Nothing is uploaded.
Live preview
Advertisement
Advertisement

How to use the CSV to HTML Table

  1. Paste your CSV into the input box, upload a .csv/.tsv file, or click Sample.
  2. Check the header option: keep "First row is header" on to get a with cells.
  3. Pick a style: plain HTML, CSS classes or inline styles, then set borders, striping and colors.
  4. Look at the preview below the code to see exactly how the table renders.
  5. Copy the HTML into your page, email or CMS, or download it as a ready-to-open .html file.

What the generated table code looks like

With the default settings, a CSV such as Name,Price / Apple,1.20 becomes semantic, accessible table markup: header cells use <th scope="col"> inside <thead>, data goes in <tbody>, and numeric columns get a num class so they line up on the right.

<table class="data-table">
  <thead>
    <tr>
      <th scope="col">Name</th>
      <th scope="col" class="num">Price</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Apple</td>
      <td class="num">1.20</td>
    </tr>
  </tbody>
</table>

Choosing an output style

StyleWhat you getBest for
CSS classes + <style>Small markup with a class on the table and one short CSS block you can move into your stylesheetWebsites, blogs, documentation, static site generators
Inline stylesEvery cell carries its own style attribute; no stylesheet neededHTML email, newsletters, CMS editors and platforms that strip <style> tags
Plain HTMLClean structure only, no classes or stylesFrameworks with their own table styles (Bootstrap table, Tailwind, WordPress themes)

Tip: to use a CSS framework, pick Plain HTML or set the table class to the framework's class, for example table table-striped for Bootstrap.

CSV parsing rules

  • Fields are separated by the delimiter (comma, semicolon, tab or pipe). European spreadsheets often export with semicolons; auto-detect picks the one that splits the first lines most consistently.
  • Fields wrapped in double quotes may contain delimiters and line breaks, and a doubled quote "" stands for one literal quote, as described in RFC 4180.
  • Rows with fewer cells than the widest row are padded with empty cells so every row has the same number of columns.
  • A column is treated as numeric when every non-empty value is a number, optionally with a currency sign, thousands separators or a percent sign.

Frequently asked questions

How do I convert a CSV file to an HTML table?

Paste the CSV or upload the file. Each line becomes a <tr> row and each comma-separated value becomes a <td> cell. With the header option on, the first line becomes <th> cells inside <thead>. Copy the generated code into your HTML.

Which style option should I use for emails?

Use Inline styles. Many email clients, including Gmail and Outlook, ignore or strip <style> blocks, so styles written directly on each <table>, <th> and <td> element are the most reliable way to keep borders, padding and striping.

Are special characters escaped?

Yes. The characters &, <, >, " and ' in your data are converted to HTML entities, so text such as <b> or AT&T is displayed literally and cannot break your page or inject markup.

What happens with quoted fields that contain commas or line breaks?

The parser follows RFC 4180: a field wrapped in double quotes can contain the delimiter, line breaks and doubled quotes (""), and it stays in a single cell. Line breaks inside a cell can be kept as <br> tags.

Why is my table not showing the header row?

Make sure "First row is header" is ticked. If your CSV has no header line, untick it and every row is placed in <tbody> as data.

Is my data uploaded?

No. The CSV is parsed and the HTML is generated entirely in your browser with JavaScript, so your file never leaves your device.

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

JSON to HTML TableConvert a JSON array of objects into clean HTML table code with CSS styles and a live preview.HTML Table GeneratorBuild HTML tables in an editable grid with styles, header rows, CSV import and live preview.CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.CSV to JSONConvert CSV data to JSON with live preview.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.Markdown to HTMLConvert Markdown to clean HTML with a live editor.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.JSON to Go StructTurn JSON into Go structs with inferred types, nested structs and json tags.JSON to Python ClassGenerate Python dataclasses, Pydantic models or TypedDicts with type hints from JSON.JSON to C# ClassConvert JSON to C# classes or records with System.Text.Json or Newtonsoft attributes.DOCX to Markdown ConverterConvert Word .docx to clean Markdown with headings, lists, tables, links and images in a ZIP.ES6 to ES5 ConverterTranspile modern JavaScript (ES2015+) to ES5 with Babel: targets, module format and loose mode.JavaScript Object to JSONTurn JS object literals and Python dicts into valid JSON: quotes keys, fixes commas and values.JSON Graph VisualizerSee JSON as an interactive node graph with zoom, collapse and search; export PNG or SVG.KML ViewerOpen KML and KMZ files on an interactive map: placemarks, paths, polygons, folders, export.MySQL to PostgreSQL ConverterConvert MySQL dumps and CREATE TABLE statements to PostgreSQL: types, AUTO_INCREMENT, ENUMs, quotes.Text to CSV ConverterTurn space-aligned, fixed-width, pipe or tab separated text into clean CSV with a live preview.VCF File ViewerOpen vCard .vcf files as contact cards with photos, search and duplicate check, export CSV.XML ViewerBrowse XML as a collapsible tree with search, XPath of any node, attributes and big-file support.JSON SorterSort JSON keys A-Z recursively, sort arrays by value or by a key, then pretty-print or minify.CSV to SQL ConverterConvert CSV to SQL CREATE TABLE and INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server.IPv4 to IPv6 ConverterConvert IPv4 to IPv4-mapped, 6to4 and NAT64 IPv6, extract IPv4 from IPv6, and get int/hex/binary.cURL to Code ConverterConvert curl commands to JavaScript fetch, Axios, Python requests, Node.js, PHP and Go code.Code to ImageTurn code into a beautiful syntax-highlighted PNG with themes, window frame and background.Excel to JSON ConverterConvert Excel sheets (XLSX, XLS, ODS) to JSON with header row, type and shape options.CSV to Excel ConverterConvert CSV files to a real .xlsx workbook with typed numbers and dates, one sheet per file.CSV SplitterSplit a large CSV into smaller files by row count, file count or column value, header kept.CSV MergerCombine many CSV files into one, matching columns by name, with dedupe and a source column.VCF to CSV ConverterConvert vCard (.vcf) contacts to CSV for Google or Outlook, or turn a CSV back into a VCF.Calendar Event (.ics) GeneratorCreate an .ics calendar invite with time zone, reminders and repeats + Google/Outlook links.CSV Column ExtractorPick, reorder and rename CSV columns, filter rows by value, and export a new CSV or JSON.CSV Diff CheckerCompare two CSV files by key column and see added, removed and changed rows cell by cell.CSV Duplicate Row RemoverRemove duplicate rows from a CSV by all or selected columns and download the cleaned file.CSV to Markdown TableConvert CSV to a neatly aligned GitHub Markdown table with column alignment and live preview.CSV TransposeSwap rows and columns of CSV, TSV or pasted spreadsheet data, with delimiter auto-detect.Date Format ConverterConvert any date to ISO 8601, RFC 2822, Unix time and custom strftime, moment or Java patterns.ENV to JSON ConverterConvert .env files to JSON or YAML and JSON back to .env, with quotes and multiline values.File to Base64Convert any file to a Base64 string or data URI with MIME detection, line wrap and download.HTML Table to CSVExtract any table from HTML or page source to CSV, TSV or JSON, with colspan and rowspan handled.IEEE 754 Floating Point ConverterConvert decimals to 32/64-bit IEEE 754 floats: toggle bits, see hex, exact value and rounding error.
See all 129 Data & File Format Converters →