Use the free CSV to Fixed Width Converter below: your data never leaves your browser — all work happens on your device, and nothing is uploaded to any server.
What this tool does
Sometimes the direction is reversed: you have a clean CSV file, but the system that must receive it only accepts fixed-width text. Older payroll tools, mainframe imports, and some government portals still demand columns aligned by character position. This free CSV to Fixed Width Converter pads every value with spaces so each column starts at the same position on every row, and it works entirely in your browser using the PapaParse CSV parser.
Column widths are calculated automatically from your data: each column becomes as wide as its longest value. You choose how many spaces separate one column from the next, and the tool produces aligned text you can paste into a form or save as a .txt file.
How to use it
Paste your CSV into the input box, or choose a CSV file from your device. Set the number of padding spaces between columns; two is a good default. Press Convert to fixed width. The aligned text appears in the output box, ready to copy or download.
The Try a sample button loads a small name, age, and city table so you can see the padding effect immediately. Notice how short values gain trailing spaces until they match the longest value in their column.
Why fixed width still matters
Fixed-width formats survive because they are simple to validate: a record is valid if each field sits at its expected position, and a misaligned file is obvious at a glance. Some receiving systems were written decades ago and cannot be changed without expensive rewrites, so they keep accepting the same layout year after year.
If you must deliver data to such a system, hand-aligning columns in a text editor is slow and error-prone. One value longer than expected shifts everything after it. Automatic padding removes that risk, because the tool measures every value before writing a single line.
Understanding automatic widths
The converter measures the longest value in each column, including the header, and uses that as the column width. That guarantees no value is cut off, but it also means one unusually long value widens the whole column. If a single entry is far longer than the rest, consider shortening it or splitting it before converting, especially if the receiving system has a maximum field length.
Padding spaces are added between columns on top of the measured width, so columns never touch. If your target system expects an exact total record length, count the result: total length equals the sum of column widths plus padding between columns. Adjust the padding value until the total matches the specification.
Tips for clean results
First, check your CSV for quoted values containing commas or line breaks. PapaParse handles those correctly, so a city written as “Springfield, Illinois” stays one value and is padded as one field. Second, remove empty trailing rows before converting; blank lines in the CSV become blank lines in the output, which some strict importers reject.
Third, confirm the character encoding of your download. The file is saved as UTF-8 text. If the receiving system expects an older encoding, open the downloaded file in a text editor and re-save it in the required encoding before sending it on.
Frequently asked questions
Is my CSV uploaded to a server? No. Parsing and padding happen in your browser with PapaParse, a well-known open-source CSV library. Your file never leaves your device.
Can I set widths by hand instead? This tool measures widths automatically for safety. If you need exact widths, convert once, check the measured widths from the output, then trim or pad values in your CSV and convert again.
What happens to numbers? Numbers are treated as text and left-aligned like every other value, which is the usual convention for fixed-width exports. If your target expects right-aligned numbers, align that column in a text editor after conversion.
Does it work with large files? Yes, within browser limits. Files with tens of thousands of rows convert quickly, because all work is local and there is no upload or download round trip.
