Online Tool Store Online Tool Store

CSV to Fixed Width

Convert a CSV into a fixed-width text file by setting a column width per field, padding or truncating values to line up in a monospace layout.

🔒 This tool runs entirely in your browser. Your files are never uploaded to a server.

Example shown — replace with your own CSV (first row is treated as headers).

Column widths

Fixed-width output

 

How CSV to Fixed Width works

  1. Paste CSV data — the first row is treated as column headers by default.
  2. The tool parses it (respecting quoted fields) and proposes a width for each column, sized to fit its longest value.
  3. Adjust any column's width directly — the output realigns instantly as you type.
  4. Each row is rendered by padding every value with trailing spaces up to its column width (or truncating it, if that option is checked), producing a monospace-aligned fixed-width text block.

Why fixed-width still matters

Many legacy systems — mainframe batch jobs, older EDI feeds, some banking and payroll imports — expect data in fixed-width flat files rather than delimited CSV, where every field occupies an exact, predictable number of characters with no separator needed. This tool bridges that gap for a one-off export without needing a full ETL pipeline.

FAQ

How are the default column widths chosen?

Each column starts at the length of its longest value (header included) plus 2 characters of padding, so nothing is clipped by default — you can then widen or narrow any column individually before exporting.

What happens to a value longer than its column width?

With "truncate values" checked, it's cut to exactly the column width. Unchecked, the full value is kept (with at least one trailing space) even if it overflows the column — useful when you'd rather inspect a long value than silently lose data, at the cost of column alignment for that row.

Does it handle quoted CSV fields with commas inside them?

Yes — the parser follows standard CSV quoting rules: a field wrapped in double quotes can contain commas or newlines, and a doubled quote ("") inside a quoted field is read as a single literal quote character.

How we compare

Feature Online Tool Store Padding strings in a spreadsheet formula A Python/awk script
No file upload — runs in your browser N/A
No sign-up required
Free, no watermark

A spreadsheet PAD formula gets fiddly fast once column widths vary, and writing a script is overkill for a one-off file. This tool computes sensible widths automatically and lets you fine-tune each one visually before copying the result.

Explore related tools

Embed this tool

Paste this on your own site — it stays free, and every file still stays in your visitor's browser, not yours or ours.