Back

Fixed-width text to CSV

Data conversion

Loading

Loading tool

The tool is loaded only when you open it.

All processing for this tool happens in your browser. Your input is not sent to a server.

About this tool

Set character widths or end boundaries, inspect every cut, and export CSV locally. No uploads or stored inputs. Widths count Unicode code points, not bytes, UTF-16 units, grapheme clusters or screen columns. Emoji count as one code point each; combining marks, variation selectors and ZWJ count separately. No Unicode normalization.

Common uses

  • Convert fixed-field report exports while preserving leading-zero identifiers as text.
  • Inspect Unicode-aware boundaries before importing records into a spreadsheet or database.
  • Locate short, long, tab-containing or malformed records without silently truncating them.

How to use it

  1. 1.Paste fixed-width text or choose a UTF-8/UTF-16 file. Select an explicit encoding or BOM detection.
  2. 2.Enter widths or cumulative end positions, then choose trimming, short/long-line, tab, blank-line and header policies.
  3. 3.Preview and convert. Inspect raw boundaries, processed fields, source-line diagnostics and transformation counts. CSV remains blocked on unresolved errors. Copy or download complete UTF-8 CSV, or download the full diagnostic report. Input edits, options, cancellation and navigation clear old results.

Executable conversion examples

Example 1

{"spec":"3,6,5","trim":"right"}
001Ada   00123
002猫😀    00456
"column1","column2","column3"
"001","Ada","00123"
"002","猫😀","00456"

Apply the shown option overrides to the defaults, then convert the source text. The complete expected CSV is shown; every field is quoted and records end with CRLF.

Example 2

{"spec":"1,1,2,1"}
猫😀éX
"column1","column2","column3","column4"
"猫","😀","é","X"

Apply the shown option overrides to the defaults, then convert the source text. The complete expected CSV is shown; every field is quoted and records end with CRLF.

Example 3

{"spec":"3,4,2","short":"allow"}
001Ada
"column1","column2","column3"
"001","Ada",""

Apply the shown option overrides to the defaults, then convert the source text. The complete expected CSV is shown; every field is quoted and records end with CRLF.

Example 4

{"spec":"3,3","long":"remainder"}
001AdaExtra
"column1","column2","_remainder"
"001","Ada","Extra"

Apply the shown option overrides to the defaults, then convert the source text. The complete expected CSV is shown; every field is quoted and records end with CRLF.

Example 5

{"spec":"3,5,6","layout":"boundaries"}
001ABx
"column1","column2","column3"
"001","AB","x"

Apply the shown option overrides to the defaults, then convert the source text. The complete expected CSV is shown; every field is quoted and records end with CRLF.

Example 6

{"spec":"3,5","header":"none"}
001"a,b"
"001","""a,b"""

Apply the shown option overrides to the defaults, then convert the source text. The complete expected CSV is shown; every field is quoted and records end with CRLF.

Example 7

{"spec":"4,2","tabs":"expand"}
A	BC
"column1","column2"
"A   ","BC"

Apply the shown option overrides to the defaults, then convert the source text. The complete expected CSV is shown; every field is quoted and records end with CRLF.

Example 8

{"spec":"2,4","header":"first","trim":"right"}
IDName
01Ada 
"ID","Name"
"01","Ada"

Apply the shown option overrides to the defaults, then convert the source text. The complete expected CSV is shown; every field is quoted and records end with CRLF.

Example 9

{"spec":"3,3","header":"custom","names":"=id\nname"}
001Ada
"'=id","name"
"001","Ada"

Apply the shown option overrides to the defaults, then convert the source text. The complete expected CSV is shown; every field is quoted and records end with CRLF.

Example 10

{"spec":"5","header":"none"}
 =1+2
"' =1+2"

Apply the shown option overrides to the defaults, then convert the source text. The complete expected CSV is shown; every field is quoted and records end with CRLF.

Example 11

{"spec":"1","short":"allow"}
A

B
"column1"
"A"
""
"B"

Apply the shown option overrides to the defaults, then convert the source text. The complete expected CSV is shown; every field is quoted and records end with CRLF.

Example 12

{"spec":"1","blank":"skip"}
A

B
"column1"
"A"
"B"

Apply the shown option overrides to the defaults, then convert the source text. The complete expected CSV is shown; every field is quoted and records end with CRLF.

Example 13

{"spec":"3,3","trim":"both"}
  A B 
"column1","column2"
"A","B"

Apply the shown option overrides to the defaults, then convert the source text. The complete expected CSV is shown; every field is quoted and records end with CRLF.

Checks before export

  • Widths 3,6,5 are equivalent to boundaries 3,9,14. Boundaries are 1-based inclusive end positions. Every character from position 1 is covered; no gap or discard columns.
  • LF, CRLF and CR delimit records; a final terminator adds no phantom row. U+2028/U+2029 remain data. File BOM is removed only when matched to its encoding; pasted BOM remains data. Tab expansion happens before cutting. Empty-line skipping means zero characters, not space-only lines. Browsers may normalize pasted line endings; use a file to inspect original line-ending counts.
  • Short line: actual / configured length.
  • Long line: actual / configured length; overflow is retained in the preview.
  • Prefix risky cells and headers with an apostrophe. This changes exported text, not the field preview. It is not a universal spreadsheet security guarantee; import columns as text to retain leading zeros.

Limits and notes

  • Raw file and decoded text ≤ 1,048,576 bytes; 10,000 physical lines; 50 output columns; 200,000 cells. Layout ≤ 4,096 code points; each expanded line ≤ 16,384; expanded text ≤ 2 MiB; CSV ≤ 4 MiB; five-second deadline.
  • Short-line allowance keeps partial text and inserts empty missing fields; it does not invent padding. Long-line remainder policy adds a column to every row, even if empty. There is no discard-overflow mode.
  • Generated headers use column1…; the overflow header is _remainder. First-line header mode keeps its nonempty overflow name, otherwise uses _remainder. Custom names specify configured columns only; the remainder header is automatic. Blank, invalid or duplicate headers block CSV.
  • Trimming removes U+0020 only, not tabs, NBSP or Unicode spacing characters. Input text is not numerically parsed, date-converted, case-folded or normalized. CSV quoting does not prevent spreadsheets from stripping zeros on import.
  • Tab expansion replaces each tab with spaces up to the next code-point-based interval, starting at position zero in each physical line. It is not display-width expansion. Control characters other than tab/line endings and unpaired surrogates block CSV. Diagnostics retain all reported issues within the row cap, even though the display is paginated. JSON diagnostic exports include options, custom header names and counts, so review before sharing.

Frequently asked questions

Does a Chinese character or emoji occupy two columns?

No: each Unicode scalar code point counts once. A combining sequence or family emoji can contain several code points. Byte-oriented or terminal-display fixed-width files need a different layout specification; this tool does not guess their widths.

Are spaces and leading zeros preserved?

Yes by default. Only explicitly selected ASCII-space trimming or tab expansion changes field text. CSV always quotes fields and never converts strings into numbers. Spreadsheet import settings can still coerce values; import columns as text.

Why are exports disabled after a preview?

A rejected short/long line, tab, invalid character or header blocks the whole CSV. The preview retains available fields and overflow. Fix the source or choose a documented permissive policy; the tool never silently discards a malformed row.

What encodings and line endings are supported?

Strict UTF-8, UTF-16LE and UTF-16BE. Auto mode uses a recognized BOM and otherwise UTF-8; there is no heuristic charset guessing. UTF-32, malformed bytes and mismatched BOMs are rejected. CSV is UTF-8 without BOM and uses CRLF.

Related tools