UTILS.
100% in-browser
▮c

Fixed-Width to CSV

Convert fixed-width, mainframe or COBOL column-position text into CSV by defined field widths.


      
output

About this tool

Fixed-Width to CSV is a free, in-browser tool that slices column-position text — the kind produced by mainframes, COBOL programs and legacy reports where each field occupies a fixed range of characters — into clean CSV. Define the layout as a list of field widths like 10,8,20, or as one-based start-end ranges like 1-10,11-18, and each line is cut at those boundaries. An optional trim removes the padding spaces, and a live preview shows exactly where the column boundaries fall.

Everything runs locally in your browser using JavaScript — your data is never uploaded or stored. The tool cuts on character positions rather than on any delimiter, so tightly packed columns with no separators are handled, and the resulting CSV re-quotes any field that needs it. Output and preview update live as you adjust the width spec.

Frequently asked questions

How do I write the field width specification?
Either list the width of each field in order, such as 4,10,10 for a 4-character then two 10-character fields, or give one-based inclusive ranges such as 1-4,5-14,15-24. Mixing the two styles is not allowed — use all widths or all ranges.
What does the boundary preview show?
It displays the first few input lines with a │ marker inserted at every field boundary, so you can confirm the columns line up with your data before trusting the CSV output.
What does the trim option do?
Fixed-width fields are usually padded with spaces to fill their column. With trim on, leading and trailing spaces are stripped from every extracted field; with it off, the padding is preserved exactly as in the source.
What CSV conventions does the output follow?
Fields are joined with the chosen delimiter (comma, semicolon, tab or pipe); any field that contains the delimiter, a double quote or a newline is wrapped in double quotes with inner quotes doubled. Characters beyond the last defined field on a line are ignored.

More tools