Paste command output, a fixed-width export, a pipe-delimited file or any text arranged in columns and get a proper CSV file. Columns are detected automatically, and you can set exact column positions on a ruler when the data needs it.
Last updated:
Click a character position to add or remove a column break. Breaks are drawn as green lines.
Cleanup and output options
Column preview
Advertisement
Advertisement
How to use the Text to CSV Converter
Paste your text or open a .txt file. A sample report is loaded so you can see how it works.
Check the detected split shown next to the input title. Change Split columns by if the guess is wrong.
For fixed-width data, pick Fixed width and click the ruler to place column breaks, or type the start positions.
Clean up with the options: skip title lines, ignore comments, drop rule lines and trim spaces.
Review the column preview; rows highlighted in orange have an unusual number of columns.
Download the CSV or copy it into your spreadsheet, database import or script.
Which split mode fits your text?
Your text looks like
Use
Why
Tokyo⇥Japan⇥Asia (copied from a spreadsheet)
Tab
Spreadsheets and many exports put a tab between cells.
| 1 | Notebook | 3.50 |
Pipe |
Console tables, Markdown tables and many bank or EDI exports use pipes.
A-1001 Desk lamp 12
Spaces, 2+ gap
Columns are separated by wide gaps, while single spaces stay inside values.
user1 pts/0 10:22
Spaces, any run
Values never contain spaces, as in most command-line output.
00012345JOHNSON MARY
Fixed width
Each field always starts at the same character position, often with no gap at all.
id::name::price or mixed separators
Custom
Any string works, and a regex such as \s*[;|]\s* covers several separators at once.
Working with fixed-width files
Fixed-width (also called column-aligned or flat) files come from mainframes, payroll and banking systems, government data sets and old report printers. A record layout document usually lists each field with a start position and a length, for example Last name: positions 9-18. To convert such a file, choose Fixed width and type the start position of every column except the first, counting from 1. For the layout above you would enter 9 for the last name. The ruler numbers the characters so you can check that each break sits exactly where a field begins.
When the columns are separated by blank space, Detect columns finds every character position that is blank on all lines and places a break where text starts again. If a long title line or a note spans several columns, use Skip first lines or the comment prefix to keep it out of the detection.
Tips for a clean CSV
Keep the header: if the first line holds the column names, leave First row is a header ticked so the preview labels the columns. The header is still written to the CSV as its first row.
Watch the orange rows: a row with a different number of fields usually means an empty cell in space mode, a stray delimiter inside a value, or a summary line such as 3 rows in set that you can remove.
Leading zeros: CSV stores text, so 00012345 stays intact in the file. Excel may still drop the zeros when it opens the file; import the column as Text to keep them.
Big files: the converter handles files with many thousands of lines; the preview shows the first 200 rows while the download contains all of them.
Open the .txt file or paste its contents. The tool detects how the columns are separated (tabs, pipes, commas, aligned spaces or fixed positions) and writes CSV in the output box. Check the preview, then click Download .csv.
What is the difference between space-delimited and fixed-width text?
In space-delimited text the columns are separated by one or more spaces, so a value can be found by splitting on the gaps. In fixed-width text every column occupies the same character positions on every line, and values may touch each other with no space at all. Fixed-width files need column positions instead of a delimiter.
Why do some rows have fewer columns in space mode?
When a cell is empty, the gap between its neighbours just gets wider, so splitting on spaces cannot tell that a value is missing and the remaining values shift left. Switch to Fixed width: it cuts every line at the same positions, so empty cells stay empty.
How do I convert a table copied from a terminal or a SQL client?
Paste it as it is. Lines made of dashes, equals signs or +----+ borders are dropped, and the leading and trailing pipes are removed, so only the data rows remain. Box-drawing characters such as │ are treated like pipes.
Can a value contain a comma?
Yes. In the CSV output any value containing the delimiter, a double quote or a line break is wrapped in double quotes, and inner quotes are doubled, following RFC 4180. Spreadsheet apps read these values back correctly.
Which output delimiter should I choose for Excel?
Comma works in most setups. If your Excel uses a comma as the decimal separator (common in Europe), choose Semicolon so Excel splits the columns when you double-click the file, and tick Add UTF-8 BOM so accented characters display correctly.
Is my file uploaded?
No. The file is read and converted by JavaScript in your browser tab, and nothing is sent to a server.
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.