Fixed-width text is still the lingua franca of mainframes, bank file formats, printed reports and plain-text emails: every column starts at the same character position, so the data lines up without a spreadsheet. This tool measures the longest value in each CSV column, pads every cell with spaces to that width and writes a .txt file where the columns are perfectly aligned.
Paste the CSV, choose how many extra spaces to leave between columns and download the text file. Everything is computed in the browser, so the content of the file never leaves your computer.
How to use CSV to Fixed-Width step by step
Type the name of the output file; the .txt extension is added automatically.
Set "Column padding", the number of extra spaces added after each column (2 by default).
Paste the comma-separated CSV into the text area.
Click "Convert and download". The file contains the header, a line of dashes and the padded rows.
name surname city
---------------------------
Juan Pérez Madrid
Ana García Barcelona
Why use our CSV to Fixed-Width?
100% free and online: no payments, no software or extensions to install.
Privacy-first: processing happens in your browser, your data never leaves your device.
No sign-up: paste your data and get the result in one click.
Fast and reliable: handle small or large files in seconds, ready for Excel and other tools.
Common use cases
Produce a COBOL or AS/400 input file where each field must occupy a fixed number of characters.
Paste an aligned table into a plain-text email, a README or a code comment where Markdown tables are not rendered.
Create a legible dump of a query result for a printed report or a log file.
Generate test fixtures for a parser that reads positional (fixed-column) files.
Limits and tips
Columns are split on commas only; quoted values containing commas will be treated as several columns.
Column widths are computed from the longest value in each column plus the padding, so a single long cell widens the whole column.
A separator line of dashes is inserted after the header row; delete it from the file if the receiving system expects data on line 2.
The output uses CRLF line endings and is saved as .txt. Multi-byte characters such as accents count as one character for alignment in most editors but may misalign in fonts that are not monospaced.
Frequently asked questions
What is a fixed-width file?
A fixed-width (or positional) file is plain text where each column occupies a fixed number of characters, padded with spaces, instead of being separated by a delimiter. Column boundaries are defined by character positions, for example characters 1-10 for the name and 11-20 for the surname.
What is the difference between CSV and fixed-width?
CSV separates values with a delimiter and each row can have a different length, which makes it compact and easy to parse. Fixed-width pads every value to a set width, so the file is larger but human-readable without tools and compatible with legacy systems that read fields by position.
Can I choose each column width manually?
No. Widths are derived automatically from the longest value in each column plus the padding you set. If a system requires exact widths, add a dummy first row with values of the required length or adjust the file afterwards.
How do I convert back from fixed-width to CSV?
Use the Fixed-Width to CSV tool: paste the text, enter the width of each column separated by commas and download the CSV. The widths equal the longest value per column plus the padding used here.
Does it upload my file?
No. The padding and alignment are computed in your browser with JavaScript and the .txt file is created locally.
Related tools
Other free utilities you may find useful
Fixed-Width to CSV — Transform fixed-width text into a well-structured CSV file.
CSV to Excel — Convert a CSV file into a real Excel workbook (.xlsx) with separated columns and leading zeros preserved.
CSV to Delimited — Change the delimiter of your CSV (commas, semicolons, tabs).
CSV to GeoJSON — Convert CSV data with coordinates to GeoJSON format.