文本转 CSV 转换器
粘贴或上传任意分隔文本、列表或 JSON。数秒内即可获得干净的 CSV、TSV、竖线分隔、HTML 或 JSON 输出 — 全部在浏览器中完成。
此处将实时预览数据表格。
Tip: the output is set to CSV — switch the 输出为 menu to TSV, pipe, fixed-width, plain text, HTML table or JSON whenever you need a different format.
文本转 CSV — 以及另外九种格式
上方的转换器以最常见的任务——文本转 CSV——为核心,同时也支持导出用户最常需要的其他格式,让你几乎无需其他工具。
如何将文本转换为 CSV
粘贴或上传
将文本或列表粘贴到框中,或拖入 .txt / .csv 文件。工具会在浏览器中读取 — 不会上传到服务器。
检查预览
工具会自动识别分隔符并显示实时表格与行列数,方便下载前发现问题。
下载 CSV
保持输出为 CSV(或选择其他格式),点击下载或复制,文件立即保存到下载文件夹。
完整的文本与 CSV 转换器
智能分隔符识别
自动识别逗号、制表符、竖线和分号,支持手动指定,以及固定宽度解析对齐列。
实时表格预览
导出前以网格形式查看数据,并对列数不一致的行进行提示。
兼容 Excel
支持 UTF-8 BOM 编码,以及 Excel 安全模式保护前导零和长数字不被自动格式化。
十种输出格式
CSV、TSV、竖线、空格、分号、自定义分隔符、固定宽度、纯文本、HTML 表格和 JSON — 一个工具,全部格式。
隐私优先设计
所有解析均在浏览器本地完成,文本不会离开你的设备,可安全处理敏感或机密数据。
复制、下载、历史记录
复制结果、下载文件,或重新打开保存在本地的最近一次转换。
谁在使用 — 用于什么
从临时性一次性任务到日常数据工作流,以下是本转换器最能节省时间的常见场景。
整理粘贴的报告
从 PDF、邮件或网页表格中复制行、粘贴进来,立即得到可用于 Excel 或 Google Sheets 分析的干净 CSV。实时预览会在导入前发现列错乱问题。
转换日志或配置导出
竖线分隔的日志、空格对齐的配置转储、JSON API 响应,均可一步转换。选择正确的输入格式,输出为 CSV 或 TSV,并直接复制到代码中。
准备联系人列表导入
将纯文本的姓名、邮箱、电话列表转换为结构化 CSV,直接上传到 Mailchimp、HubSpot 或 Salesforce。使用表头行选项为每列正确加标签。
修复银行导出格式
许多银行导出使用分号或竖线分隔符,Excel 无法正确读取。转换为带 UTF-8 BOM 和 Excel 安全数字的逗号分隔 CSV,可保留前导零和长账号 ID。
整理关键词列表
粘贴来自 Google Search Console、Ahrefs 或 SEMrush 的多列关键词导出,自动识别分隔符,并下载可立即排序和筛选的干净 CSV。
处理固定宽度大型机文件
旧版 ERP 和银行系统常输出固定宽度文本文件。手动指定列宽,工具便可无需一行代码地把每一行切分为正确的列。
输出格式说明
Choosing the right output format is the difference between data that just works and a file another program rejects. Here is what each option in the 输出为 menu produces, and when to use it.
CSV (comma-separated values)
The default and most portable choice. Fields are separated by commas and any field containing a comma, quote or line break is wrapped in double quotes, following the standard CSV rules. CSV opens in Excel, Google Sheets, databases and virtually every data tool.
TSV, pipe, semicolon and custom delimiters
Sometimes your data already contains commas, or a target system expects another separator. Tab-separated (TSV) is the safest for messy text; pipe (|) and semicolon (;) are common in exports and European spreadsheets. Pick 自定义分隔符 to type any character.
Which delimiter should you pick?
For Excel and Google Sheets
CSV works everywhere; if your locale uses a comma as the decimal mark, semicolon-delimited may import more cleanly. Enable UTF-8 BOM so non-Latin text is read correctly.
For databases and legacy systems
Tab or pipe delimiters avoid clashes with comma-containing values. Many import tools and older systems specifically expect pipe-delimited or fixed-width files.
A note on quotes and encoding
Use 全部加引号 when an importer is strict, or 不加引号 for the simplest possible output. Keep encoding as UTF-8 to preserve accents and CJK characters.
Fixed-width and plain text
Fixed-width pads every column to a set width so the file lines up in a monospace view — still used in banking and mainframe feeds. Plain text strips structure for a human-readable list, one row or one cell per line.
HTML table and JSON
Generate an HTML <table> to paste straight into a web page, or export JSON (an array of objects keyed by your header row) for APIs and JavaScript. These are the convert csv to html table and json to csv jobs handled on their own pages too.
热门文本与 CSV 转换
Each of these has a dedicated, focused tool with examples and tips:
真实使用场景
- Tidy a copied list. Paste names, emails, addresses or a keyword list and get a structured CSV for a spreadsheet or import tool.
- Reshape an export. Convert a system's CSV into tab, pipe, space or fixed-width text so another tool can read it without writing code.
- Clean scraped or OCR text. Turn pasted, semi-structured text into a table you can analyze in seconds, not minutes.
- Prepare a database import. Standardize many text files into consistent CSV, then load them into a database or BI tool.
- Fix Excel headaches. Keep leading zeros, long IDs and encoding intact when opening CSV in Excel using BOM and Excel-safe number options.
- Convert for APIs. Export as JSON to feed your data directly to an API or JavaScript application without a separate conversion step.
深受信赖的快速转换工具
"粘贴了 2000 行的列表,几秒钟就得到了干净的 CSV。Excel 安全选项拯救了我的邮编,避免变成科学计数法。"
— 数据分析师"终于有一个不上传文件的转换器。分隔符识别就是好用,我每天都用竖线和 TSV 输出。"
— 后端开发者"表格预览能在导入前发现坏行。处理杂乱的旧系统导出时非常省时。"
— 运维工程师文本转 CSV 转换器 — 常见问题
如何将文本转换为 CSV?
Paste your text into the converter above (or upload a .txt file), and it instantly detects the delimiter and shows a table preview. Keep the output set to CSV and click 下载结果 or 复制. Everything runs in your browser, so your data is never uploaded.
如何选择合适的分隔符?
Leave the input on 自动检测 and the tool guesses comma, tab, pipe or semicolon from your data. If the columns look wrong, set the input format to 分隔文本 and pick the delimiter manually, or use 固定宽度 for space-aligned columns.
支持其他语言和 UTF-8 吗?
Yes. Text is handled as UTF-8, so accents, Chinese, Japanese and other characters are preserved. For Excel, tick UTF-8 BOM so it opens non-Latin characters correctly instead of showing garbled text.
能在 Excel 中正确打开吗?
Yes. Use CSV output and enable UTF-8 BOM for encoding, and Excel 安全数字 to keep leading zeros and long IDs from turning into scientific notation. See fix CSV Excel formatting issues for the full guide.
有文件大小限制吗?
There is no hard limit, but very large files depend on your device's memory since everything runs locally. For big jobs see the large text file to CSV converter, and for many files at once use the batch converter.
可以把 CSV 转换回文本吗?
Yes — use 交换, or open the CSV 转文本 and CSV to delimited text tools to export tab, pipe, space or fixed-width text from any CSV.
工具完全免费吗?
Yes. There is no sign-up, no account, no paywall and no file size tier. Every feature is available to everyone. The site is supported by unobtrusive advertising, which keeps it free without restricting any functionality.
可以上传哪些文件类型?
You can upload .txt, .csv, .tsv and .json files by clicking the drop zone or dragging a file onto it. You can also paste text directly from the clipboard, including rows copied from Excel, Google Sheets or any web table.
可以把 JSON 转换为 CSV 吗?
Yes. Select JSON as the input format (or leave it on Auto-detect) and the tool flattens a JSON array of objects into CSV rows, one object per row. Nested objects are stringified. For a dedicated view see the JSON 转 CSV page.
可以离线使用吗?
Once the page has fully loaded, the conversion engine works entirely without a network connection. All processing is done in your browser using JavaScript, so you can convert files even on an airplane or with a spotty connection.
"Excel 安全数字"是什么意思?
Excel automatically reformats certain values when it opens a CSV: zip codes starting with 0 become plain integers, and long numeric IDs (16+ digits) get converted to scientific notation. Enabling Excel 安全数字 wraps those values in quotes or adds an equals-sign prefix so Excel treats them as text and preserves every digit.
可以把每行一项的列表转换成 CSV 列吗?
Yes. If each line in your list represents a row, paste it in and use Auto-detect — the tool will treat each line as a single-column row. If you want multiple items per row joined by a delimiter, set the output to your preferred format and use the 文本列转 CSV tool for more control over multi-column layouts.