CSV to web table

CSV 转 HTML 表格转换器

将 CSV 数据转换为可直接粘贴的 HTML 表格标记。粘贴或上传 CSV,标记表头行,预览表格,并将干净的 <table> 代码直接复制到网页或电子邮件中。

免费无需注册在浏览器中运行兼容 Excel
开始转换
CSV 转 HTML 表格转换器
粘贴或上传文本以进行转换。
输入 — 粘贴或上传
Drag a file here, or browse (.txt, .csv, .tsv, .json)
输出
输入类型
输入分隔符
列宽
输出为
自定义分隔符
纯文本样式
引号处理
换行符

此处将实时预览数据表格。

This page outputs an HTML <table> — tick 首行为表头 to wrap your headings in <th>.

广告
功能一览

Convert CSV into an HTML table

Need your data on a web page? This tool does the convert csv to html table job: it reads your CSV and generates semantic <table> markup with rows and cells you can paste directly into a site, a CMS or an HTML email.

Mark the first row as a header and it is wrapped in a <thead> with <th> cells; the rest goes in a <tbody>. Special characters are safely escaped, so values containing <, > or & render correctly instead of breaking your page.

Want the data as a spreadsheet instead? Use text to CSV or CSV 转文本. For APIs, see JSON 转 CSV.

分步指南

How to use it

粘贴或上传

Add your text or drop a file — it is read locally in your browser, never uploaded.

Preview & adjust

Check the live table and the row / column counts, then tweak the delimiter or options if a column looks off.

Copy or download

Grab the result with Copy or Download. You can reopen recent conversions from this device too.

示例

Input and output example

CSV converted to semantic HTML table markup with a header row.

Input
name,city
Ada,NY
Lin,LA
输出
<table>
<thead><tr><th>name</th><th>city</th></tr></thead>
<tbody>
<tr><td>Ada</td><td>NY</td></tr>
<tr><td>Lin</td><td>LA</td></tr>
</tbody></table>
Details

Clean, paste-ready table markup

输出为纯 HTML,可按需自定义样式。

Header rows with <th>

With 首行为表头 ticked, your column titles become <th> cells inside a <thead>. That is better for accessibility and lets screen readers and CSS target headings separately from data.

Safe escaping

Any value containing <, > or & is escaped to its HTML entity, so the table displays the literal text and never injects unintended markup. This keeps the output safe to drop into a page.

Styling the table

The markup is intentionally minimal — no inline styles — so you can apply your own CSS classes or a framework. Add borders, striping and padding in your stylesheet to match your site.

Copy and paste workflow

Use the Copy button to grab the markup, then paste it into your HTML. Because everything runs locally, you can convert sensitive data without sending it anywhere.

Good to know

Tips and edge cases

  • Tick the header option for accessible, styleable headings.
  • Add your own CSS class to the <table> after pasting to control its look.
  • For data exchange rather than display, export CSV, TSV or JSON instead.
Good to know

From data to a web page

Pasting CSV into a page by hand is error-prone; generating the markup keeps every row and cell consistent. The output works in static sites, CMS editors, documentation and HTML email, and because it carries no inline styles it inherits your existing table CSS. For very large datasets, consider paginating or lazy-loading the table in your own template rather than rendering thousands of rows at once.

常见问题

CSV to HTML Table Converter — FAQ

Does it create a header row?

Yes, tick First row is header to wrap your titles in <th> inside a <thead>.

Are special characters safe?

Yes. <, > and & are escaped so the table renders the literal text.

Can I style the table?

Yes. The markup has no inline styles, so add your own CSS classes or framework.

Is my CSV uploaded?

No, the conversion happens entirely in your browser.