How to convert a fixed-width file to CSV
- Open a decoded text file or paste records. Choose whether positions mean Unicode code points or UTF-8 bytes.
- Analyze the rows. Automatic suggestions look for repeated starts after whitespace; they are hypotheses, not proof.
- Drag the vertical boundary markers, use their arrow keys, or enter exact zero-based offsets. Every boundary begins a new field.
- Review short-row and UTF-8 split diagnostics, edit column names, and compare several source lines in the table.
- Choose the CSV safety options and download or copy the complete conversion.
Character positions versus byte positions
A fixed-width layout is incomplete unless its unit and text encoding are known. Character mode counts Unicode code points, so an emoji counts once even though JavaScript internally represents it with two UTF-16 code units. UTF-8 byte mode re-encodes the already-decoded text and counts bytes; if a boundary divides one multi-byte character, the row is flagged and CSV export is blocked.
Byte mode does not identify or recover the original file encoding. Opening a legacy file as ordinary text may already have replaced bytes before this page sees it. Keep the original and use an encoding-aware decoder when the source is EBCDIC, a Windows code page, or another non-UTF-8 format.
What automatic suggestions can and cannot infer
The suggestion pass samples up to 2,000 included rows and looks for positions where populated fields repeatedly begin after whitespace. It works well for consistently left-aligned columns. Right-aligned numbers, blank optional fields, wrapped descriptions, tabs, record variants, and damaged rows can hide or invent apparent starts. The original text is never altered; suggestions become useful only after visual review.
Short rows remain in the preview and receive empty trailing fields. Empty lines are ignored only when that checkbox is selected. Trimming is also opt-in and visible: turn it off when padding is meaningful data.
Data safety boundary
A tidy preview does not establish that the layout is correct. Compare field positions with the producing system’s copybook, record specification, or known control totals. Mixed record types may need separate layouts. Check row counts, identifiers, numeric totals, signs, leading zeroes, dates, decimal conventions, and a sample from the end of the file before importing the CSV elsewhere.
Frequently asked questions
Why are positions zero-based?
Boundary 0 is the start of a record, and boundary 10 begins with the eleventh displayed character or byte. This matches substring offsets and makes adjacent spans unambiguous: a field from 0 to 10 contains positions 0 through 9.
Does trimming remove spaces inside a field?
No. It removes whitespace only from the start and end of each sliced field. Interior spaces remain. Turn trimming off to preserve fixed-width padding exactly.
Why prefix formula-like CSV cells?
Spreadsheet applications can interpret cells beginning with formula characters as active expressions. The default export adds a literal apostrophe to those cells. Disable the clearly labeled option when exact source values matter more and the destination safely treats every field as text.
What does a saved layout contain?
Only boundary positions, column names, position mode, parsing choices, and export options. It is stored in this browser’s local storage. The input file and parsed values are not saved.