文本生成 CSV 文件

将文本转换为 CSV 文件

从文本创建真正的 CSV 文件。粘贴列表或上传文本,选择如何按列分割,下载可在 Excel、Google Sheets 或任何数据库工具中打开的 .csv 文件。

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

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

Turn any text into a downloadable .csv file — output defaults to CSV.

广告
功能一览

How to make a CSV file from text

If your goal is specifically to create a CSV file from text — not just see a result, but get a proper .csv you can save and share — this tool walks it through end to end: paste or upload, set the columns, and download the file.

It handles the parts people get stuck on: choosing a delimiter, keeping a header row, and protecting values that contain commas or quotes so the file opens cleanly in Excel and other tools. Everything runs locally, so the file is built on your device.

Already have a file to upload? Use TXT 转 CSV. Want the online, browser-first framing? See text to CSV file online.

分步指南

Steps to convert text into a CSV file

Add your text

Paste a list or rows, or upload a text file. The tool reads it locally and shows a preview.

Set columns and header

Confirm the delimiter so the data splits into the right columns, and tick header if the first row has names.

Download the .csv

Keep the output on CSV, enable Excel-safe numbers if you have IDs or zip codes, and click Download.

示例

Input and output example

A plain list is turned into a downloadable CSV file in a couple of clicks.

Input
Ada Lovelace, London
Lin Tan, Singapore
输出
"Ada Lovelace","London"
"Lin Tan","Singapore"
Details

Getting a file that opens cleanly

正确的 CSV 文件不仅仅是逗号 — 这些设置让它更可靠。

Choosing how text becomes columns

Decide what separates your fields. If each line already uses commas, tabs or pipes, Auto-detect handles it; for a plain list, each line becomes a one-column row until you add a delimiter within the lines.

Headers and data types

Tick 首行为表头 to keep column names. Enable Excel 安全数字 so IDs like 007 and long codes are not mangled into 7 or scientific notation when the file opens in Excel.

Encoding for international text

Turn on the UTF-8 BOM if the file will be opened in Excel and contains accented or non-Latin characters, so they display correctly.

Saving and sharing

The download is a standard .csv, so it opens in Excel, Google Sheets, Numbers and database import tools, and can be emailed or uploaded like any other file.

Good to know

Getting it right the first time

The difference between a CSV that just works and one that frustrates the next person usually comes down to three choices made before you click download: the delimiter that splits your text into the intended columns, whether the first line is a header, and whether numeric-looking values need protecting from Excel. Decide those up front and the resulting file opens cleanly the first time, in any tool. Because everything is built locally, you can iterate quickly — tweak a setting, watch the preview update, and export only when the table looks exactly right.

常见问题

Convert Text into CSV File — FAQ

How do I create a CSV file from text?

Paste or upload your text, set the delimiter and header, keep the output on CSV, and click Download to save a .csv file.

How do I choose the columns?

The delimiter determines the columns. Use Auto-detect, or set it manually under Input is → Delimited.

Will it open in Excel correctly?

Yes. Use UTF-8 BOM for encoding and Excel-safe numbers to protect zeros and long IDs.

Is the file built locally?

Yes, entirely in your browser; nothing is uploaded.

输出结果

What makes a proper CSV file

并非每次文本导出都能得到真正的 CSV。以下是此工具的输出内容及其重要性。

A real .csv file, not just renamed text

A genuine CSV file follows RFC 4180: fields are comma-separated, fields containing commas or quotes are wrapped in double quotes, and line endings are consistent. Many tools that "export CSV" skip these rules and break when the data contains commas. This converter applies them correctly so the file opens cleanly in Excel, Google Sheets, databases and any import tool.

How to create a CSV file from text

Paste your text above — a list, a table copied from a browser or document, or an export from another tool. The converter auto-detects the delimiter (comma, tab, pipe or semicolon) and shows you a live column preview. If the columns look right, click 下载结果 and a .csv file lands in your downloads folder immediately. Change the 输出为 setting to TSV, pipe or fixed-width if your target system needs a different format.

Make a CSV file from a plain list

If your input is a single-column list (one item per line), paste it in and enable 首行为表头 if the first line is a column name. You get a one-column CSV with a proper header — ready to import as a lookup table or reference list.

Encoding: when to use UTF-8 BOM

By default the file is UTF-8, which handles accented characters, Chinese, Arabic and other scripts correctly. If you plan to open the file directly in Microsoft Excel, tick UTF-8 BOM before downloading. Excel uses the BOM (byte order mark) to recognise the encoding; without it, non-ASCII characters may appear garbled.