Fixed-Width to CSV Converter
Mainframe, bank and government extracts to spreadsheets, and back again.
Try before you buy.
- Free preview: the counts and the first rows of the table made from your file (up to 10), or the first lines of the fixed-width text made from your table (up to 20).
- Locked until you unlock it: download and copy.
- Unlock: Premium pass, ₹799 for 30 days or ₹249 for 1 week, a one-time payment that never renews. Unlock: Premium pass, $19.99 for 30 days or $7.99 for 1 week, a one-time payment that never renews.
Ways to unlock shows how to get the full result.
Printing this result is locked in the free preview.
1. Fixed-width file
Encoding and lines
0 = one record per line. Mainframe files often have records of 80 or 132 characters with no line breaks.
Record types to leave out, separated by commas.
2. Columns
Click between two characters to add or remove a column break. With the keyboard: focus the ruler, move with ← and →, and press Enter or Space.
| # | Name | Start | Length | Type | Decimals / format | Remove |
|---|
Type or paste a layout (start positions and lengths, or a COBOL copybook)
Save or reuse layouts
Layouts are kept in this browser only. Download one to use it on another device or to share it. A COBOL copybook (.cpy) opens as a layout too.
3. Table
1. Table
Open a CSV or Excel file, or paste cells from a spreadsheet.
Or paste the table (from Excel, Google Sheets or a CSV)
2. Widths
| Write | Column | Width | Align | Fill with | Numbers |
|---|
3. Fixed-width text
Locked in the free preview. Opens the ways to unlock this result.
Locked in the free preview. Batch runs unlock with a pass.
Locked in the free preview. Query results unlock with a pass.
About the Fixed-Width to CSV Converter
Fixed-width files put every field at a fixed character position — the account number in characters 1–10, the date in 12–19, the amount in 54–63 — with no commas between them. Bank statements, payroll and tax exports, government data releases and mainframe extracts still come this way. This converter turns them into CSV or Excel: it finds the columns from the spaces that line up in every row, lets you add or move a break by clicking on a character ruler, or takes the start positions and lengths from the file’s specification.
Fields can be read as text, numbers (with implied decimals such as 000012345 → 123.45, and a minus sign at the end), signed zoned numbers from COBOL programs, or dates such as YYYYMMDD; header and trailer records can be skipped, and EBCDIC files from mainframes are decoded. It also works the other way: a CSV or Excel sheet becomes fixed-width text with the widths, alignment and padding you choose. Layouts can be saved and reused. The file is read in your browser and never uploaded.
Without a pass, the free preview shows the first rows of the result; the CSV, Excel and fixed-width files and the copy unlock with a Premium pass.
How to use it
- Open the fixed-width file (TXT, DAT, PRN …) or paste its text. Tick The first line holds the column names if it does; under Encoding and lines you can skip header and trailer lines, skip record types, or read records without line breaks.
- Check the columns: they are found from the aligned spaces. Click between two characters on the ruler to add or remove a break, or edit the start and length in the table. To use a published layout, open Type or paste a layout and enter lines such as “Amount, 54, 10”, or paste the file’s COBOL copybook.
- Name the columns and choose their types: Number (with implied decimals), Signed number (zoned), Date with its format, or Leave out for filler. The preview and the notes under it show anything that does not fit.
- With a pass, or after unlocking this result, download the table as CSV or Excel, or copy it into a spreadsheet. Save the layout to reuse it for next month’s file. To go the other way, choose CSV / Excel → fixed width, set the widths and download the text (with a pass) and its layout.
Examples
0012345678 20260107 Card payment - Grocer 000000452- 0012345678 20260112 Salary 0000250000
Account,Date,Description,Amount 0012345678,2026-01-07,Card payment - Grocer,-4.52 0012345678,2026-01-12,Salary,2500
With the columns named Account, Date, Description and Amount; Amount is a Number with 2 implied decimals (the last two digits are cents) and its sign at the end, Date a Date in YYYYMMDD.
Employee ID, 1, 6 Name, 7, 25 Gross pay, 32, 9 Pay date, 41, 8
Four columns at characters 1–6, 7–31, 32–40 and 41–48.
Ranges such as 1-6, 7-31, 32-40, 41-48 or plain widths such as 6 25 9 8 work too.
Code,Name,Amount 7,Asha Rao,1234.50
00007Asha Rao 000123450
Code: width 5, right, zeros. Name: width 10, left. Amount: width 9, right, zeros, 2 implied decimals.
Common uses
- Opening bank, card or payroll extracts that arrive as fixed-width text in Excel or Google Sheets.
- Reading government statistical releases and mainframe reports published as fixed-width files with a layout document.
- Making the fixed-width files that some banks, payment processors and legacy systems require for uploads.
- Checking a fixed-width file against its specification: the notes point at values of the wrong type and text that crosses a column break.
How the columns are found
Every character position is checked in up to 5,000 lines. A position that is a space in every line is a gap, and a new column starts where a gap ends — which also keeps right-aligned numbers such as 12 and 1234 in one column. If a few long values spill into a gap, choose Allow 1 % or 5 % of lines with text in a gap. Fields that touch with no space between them (a date followed by a name, for example) cannot be told apart by spaces: click on the ruler to add that break. A red break on the ruler means text runs across it in many lines, which usually means it cuts a value in two.
Numbers, signs and dates
- Number: spaces and leading zeros go, a minus or plus sign may come before or after the digits (
452-), and an amount in brackets is negative. With implied decimals the last digits are the fraction: 000012345 with 2 is 123.45. - Signed number (zoned): COBOL’s signed display numbers carry the sign in the last character —
{andA–Istand for a final digit 0–9 of a positive number,}andJ–Rfor 0–9 of a negative one, so 0012345} is −1234.5 with 2 implied decimals. - Date: YYYYMMDD, DDMMYYYY, MMDDYYYY, YYMMDD, DDMMYY, MMDDYY, the day-of-year form YYYYDDD, and the same with separators; dates become YYYY-MM-DD. Two-digit years 00–69 are read as 2000–2069 and 70–99 as 1970–1999. A date of all zeros is left empty. Values that cannot be read are kept as written and listed in the notes.
Mainframe files
Files copied from a mainframe in binary keep IBM’s EBCDIC encoding, which no other program reads as text. Choose EBCDIC 037 (United States and Canada) or EBCDIC 500 (international) under Encoding and lines — the page also suggests 037 when a file looks like EBCDIC. Records with no line breaks are split by their record length (often 80 or 132). If the file comes with a COBOL copybook (its record description, such as 05 BALANCE PIC S9(7)V99.), paste it under Type or paste a layout or open the .cpy file under Save or reuse layouts: every field gets its position and length, X fields become text, 9 fields numbers with their implied decimals (the V), and S9 fields signed zoned numbers; groups, OCCURS, REDEFINES and FILLER are followed. Packed decimal (COMP-3) and binary (COMP) fields are binary numbers, not text, so they cannot be read here: they are set to Leave out, and the fields after them stay in their places.
From CSV to fixed width
Each column gets a width (suggested from its longest value), an alignment and a fill character: text is usually left-aligned with spaces, amounts right-aligned with zeros — a minus sign goes first, as in -00001200. Implied decimals write 123.45 as 12345 with 2 decimals. A value longer than its column stops the conversion with the row number, or is cut to fit if you choose so. Download the layout (column, start, length, end, alignment) with the file for whoever reads it.
Limitations
- Files up to 100 MB. Very large files take a few seconds to convert; the preview appears first.
- One record layout at a time. A file with several record types (header, detail, trailer) can be converted one type at a time by skipping the others with Skip lines that start with.
- Positions count characters. A layout given in bytes for a UTF-8 file with accented or non-Latin letters may not match; such files usually come in a one-byte encoding, which you can choose under Encoding and lines.
- Saved layouts stay in this browser; download a layout file to keep it elsewhere.
Privacy
On this device: nothing is sent
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
What do I get without a pass?
Without a pass, Fixed-Width to CSV Converter shows the counts and the first rows of the table made from your file (up to 10), or the first lines of the fixed-width text made from your table (up to 20). Until you unlock it, the result can’t be downloaded or copied. A Premium or Ultimate pass, a one-time payment that never renews, unlocks the full result. The pricing page lists the passes and their prices.
How do I convert a fixed-width text file to Excel?
Open the file here, check that the columns found from the aligned spaces are right (click on the ruler to add or remove a break), give the columns names and types, and, with a pass, press Download Excel.
What is an implied decimal?
Fixed-width files often store amounts without a decimal point, with an agreed number of decimal places: 0000150075 with 2 implied decimals means 1,500.75. Set the column’s type to Number and its decimals to 2.
Why do some numbers end in a letter or a brace, like 0012345{?
That is a signed zoned number from a COBOL program: the last character holds both the last digit and the sign. Choose Signed number (zoned) for the column and it is read correctly — { is a final 0 of a positive number, } a final 0 of a negative one.
Can I use the COBOL copybook of a mainframe file?
Yes. Paste the copybook under Type or paste a layout (or choose A COBOL copybook there) and press Use this layout, or open the .cpy file under Save or reuse layouts. The positions come from the PIC clauses — PIC X(30) is 30 characters of text, PIC 9(7)V99 9 digits with 2 implied decimals — with OCCURS repeated and REDEFINES and FILLER left out. Save the result as a layout to reuse it.
Can I make a fixed-width file from a spreadsheet?
Yes. Choose CSV / Excel → fixed width, open the sheet, set each column’s width, alignment and fill (spaces or zeros), and download the .txt file with a pass. The layout CSV lists each column’s start and length for the receiver.
Can I save the column layout for next time?
Yes: under Save or reuse layouts, give it a name and press Save. It is kept in this browser, so next month’s file needs only a click. Download layout saves it as a file you can open on another device.
Is my file uploaded?
No. The file is read and converted by this page in your browser, and the downloads are made there too.