- Home
- Convert TXT File to CSV
Convert TXT File to CSV
Use this TXT to CSV converter to preview delimited text and download CSV, with all conversion happening in your browser and no file uploads.
How to convert TXT to CSV online
Convert TXT to CSV when your text already contains records separated into fields by tabs, commas, semicolons, pipes, or another consistent delimiter. This browser tool parses that structure, shows a table preview, and writes a CSV download without uploading your file contents. No signup is required. You can paste text or open a supported text file, then choose how its fields should be read. Keep your source document so you can compare the first and last records after conversion.
- Paste the delimited text or open a text file. Inspect the source to identify the character separating columns.
- Choose the input delimiter or try detection. The output uses commas between fields.
- Review trimming, empty-row handling, the first-row header display, BOM, and output line endings.
- Check the preview and download the CSV. Import it into your spreadsheet with the appropriate delimiter and column types.
Renaming records.txt to records.csv changes only the name. It does not turn tabs into commas, add required quotes, or repair inconsistent records. This converter reads fields and serializes them with comma separators, quoting values when necessary. It is useful for a structured export, a simple inventory list, or a tab-separated report. It cannot reliably infer columns from an ordinary paragraph that has no consistent field boundaries.
Choose an input delimiter
A delimiter marks the boundary between fields. Tab-separated text uses a tab character, while other exports use commas, semicolons, or pipes. Automatic detection is a starting point rather than a guarantee: punctuation in the first few records can be ambiguous. Select the delimiter explicitly if the preview puts an entire row in one column or spreads one field across unexpected columns. A wrong delimiter can still produce a downloadable file with the wrong structure.
Use this small tab-separated example as a controlled test. The gaps between values below are actual tabs:
id name quantity
1 Apples 3
2 Rice 1
With Tab as the input delimiter, the visible CSV records are:
id,name,quantity
1,Apples,3
2,Rice,1
The sample TXT downloads include this tab-separated file, so you can test the conversion without preparing your own data. Open the output in a plain text editor as well as a spreadsheet when investigating unexpected columns. That helps separate a conversion issue from the spreadsheet's import settings.
Spaces mode treats consecutive spaces or tabs as a field boundary, which can help with aligned text reports. Use it carefully when values themselves contain spaces. Custom mode accepts one delimiter character, excluding quotes and line breaks. Opened files and pasted UTF-8 text are limited to 5 MiB.
Quoted fields and multiline records
A delimiter inside a quoted field belongs to the field rather than starting a new column. The parser supports quoted fields, escaped double quotes, and newlines inside quoted values. For example, a correctly quoted name containing a comma remains one value. When writing CSV, fields containing commas, quotes, or newlines are quoted, and internal double quotes are escaped. This preserves the distinction between punctuation used as data and punctuation used as structure.
Quoted multiline content also explains why a record count can differ from a physical line count. A single address or note can span multiple lines inside one quoted field. Do not split such data by physical lines before converting unless you have checked the record boundaries. The text file splitter works with physical lines and does not parse CSV records. If the source has unclosed quotes or inconsistent columns, inspect and correct the data rather than treating a plausible preview as proof of a valid dataset.
Trimming, empty rows, and headers
Trimming surrounding whitespace and skipping empty rows are enabled by default. Trimming is convenient for exports with accidental padding, but spaces can be meaningful in identifiers, codes, or deliberately formatted text. Disable it if those spaces must survive. Similarly, an empty row can be an intentional separator in your source; keep it if the receiving process relies on that position. Review these options before converting data that must remain exact.
The first-row-as-header option changes how the preview presents the first record. It does not generate new column names, remove the first row, or reorder data. You can use it to make the table easier to read while still exporting that row. The preview shows up to 20 rows, so it helps assess the structure but does not display the entire input. Check later records in the downloaded file when source data may vary beyond the preview.
UTF-8, BOM, and CSV line endings
CSV output uses UTF-8, with the UTF-8 BOM option enabled by default. A BOM is an opening encoding signature, not an extra visible field. Some spreadsheet workflows recognize UTF-8 more readily with it; some data pipelines prefer a file without it. Choose the setting your receiving application expects. Output line endings default to CRLF, with LF also available. Embedded newlines inside quoted fields still belong to those field values, so use a CSV-aware importer to read them.
Opened files support UTF-8 and BOM-marked UTF-16 input; ASCII-only bytes are also valid UTF-8. Legacy encodings such as Windows-1252, GBK, and Shift-JIS are not supported. Save those files as Unicode in a suitable editor before opening them. If the characters are wrong in the input, selecting a delimiter will not fix the encoding. Read what a TXT file is and CRLF versus LF for more background on text bytes and newline conventions.
Import a text or CSV file into Excel
Excel can import delimited text directly. In supported desktop versions, use Data → From Text/CSV, select your file, inspect the delimiter and encoding in the import preview, and load the data. Microsoft's text and CSV import guide documents that workflow. Importing gives more control than opening a CSV with default settings, especially for dates and identifiers with leading zeros. Choose text column types where needed to preserve those values.
Convert text to CSV on Linux with LibreOffice Calc
On Linux, use Calc's File → Open, select your text file, choose the Text CSV filter, and enable Edit filter settings. In Text Import, choose the character set and field separator, then check the preview. Set identifier columns to Text to preserve leading zeros. Load the data, then use File → Save As → Text CSV and choose the export settings. LibreOffice's CSV guide covers opening and saving delimited files.
Check your converted file
Compare the number of columns, representative quoted fields, accented characters, and the final record against your source. The download remains a plain text CSV, rather than an Excel workbook with styles, formulas, and sheets. Conversion happens in the browser and file contents are not uploaded. To assemble several exports first, use the text file merger, keeping repeated headers and matching delimiters in mind. For a custom text input, the home editor can create a small file with the exact characters you want to test.
TXT to CSV questions
Only if the file already has the required CSV structure. Renaming does not replace delimiters or quote fields. The converter parses the input fields and writes them with comma separators.
Choose the character separating your fields, such as Tab, comma, semicolon, or pipe. Try detection as a starting point, then use the preview to verify that the columns are correct.
Yes. The parser supports quoted fields, escaped double quotes, and newlines inside quoted values. Check your source if quotes are unclosed or the preview shows inconsistent columns.
No. It styles the first row as a header in the preview. That row remains in the CSV output, and the option does not create or reorder column names.
The UTF-8 BOM option is enabled by default to help compatible importers recognize the encoding. Turn it off if your receiving system requires UTF-8 without BOM. You can also choose CRLF or LF output line endings.
File contents are converted in your browser without uploads or signup. The preview shows up to 20 rows; the downloaded CSV includes the processed input beyond the preview. Trimming and skipping empty rows are enabled by default.