b2KIT

Fixed-Width Text Converter

Parse fixed-width text files by defining column positions and convert to CSV or JSON.

Tested tool guide Tested browser tools Checked August 16, 2026

What Fixed-Width Text Converter does, with a checked example

Fixed-Width Text Converter restructures line-oriented records whose fields occupy known character spans. Enter or paste the records, name each field, define its span, and choose CSV or JSON output. The same map is applied to every line, making the tool appropriate when separators are absent but column boundaries are documented. The common mistake is trusting visual alignment: a tab, an extra character, or a record with a different layout can put later values under the wrong field even when the source looks columnar.

Worked example

A concrete input and expected output from the current implementation.

Input

Fields:
code = first 2 characters
status = next 3 characters

Text:
AAnew
BBold

Format: JSON

Expected output

[
  {"code":"AA","status":"new"},
  {"code":"BB","status":"old"}
]

Each five-character record is divided after its second character. The first slice becomes code, and the remaining three characters become status.

How the result is produced

1

Define the record map

For every output field, provide a name and the exact portion of the record that belongs to it. The converter repeats that positional selection for each line; it does not need separator characters to find values. Unassigned positions can remain outside the map when they are merely padding. A comma inside a selected span is content, not a field boundary.

2

Choose the output structure

Choose CSV to obtain one column per defined field and one row per record, or JSON to obtain records whose keys are the defined field names. CSV quoting matters when extracted values contain commas or quotation marks, while JSON requires its own escaping. Review identifiers such as 001 before another program applies numeric conversion and removes meaningful leading zeros.

Good uses

  • Convert a mainframe-style export after receiving a layout that specifies the positions of account codes, dates, amounts, and status values.
  • Turn a vendor feed made of padded, delimiter-free lines into CSV for review while leaving filler positions outside the field map.
  • Create JSON fixtures from fixed-column test records so each positional value can be addressed by a descriptive field name.

Limits and checks

  • Column specifications may use one-based or zero-based numbering and may treat the ending position as inclusive or exclusive. Translate the specification carefully and test boundaries with distinctive sample values.
  • Do not assume byte offsets in a legacy specification match the positions visible after decoding. Tabs and non-ASCII text can make visual width, character count, and byte count differ.
  • One uniform map cannot correctly describe unrelated header rows, trailers, continuation lines, or multiple record types. Separate those records or map each type independently before trusting the converted structure.

Common questions

Can it discover the column boundaries automatically?

No. The converter expects the field positions to be defined. Repeated spaces may be padding or may belong to a field, so visual patterns in a small sample do not establish a reliable schema. Use the producer's layout when available, then verify the map against records containing known values at every boundary.

What happens if some records are shorter or longer?

The positional map does not change with line length. A short record has no source text for positions beyond its end, while extra trailing characters are not represented unless a defined span includes them. Because an absent slice may be represented differently from an empty value, inspect a deliberately short test record before converting a mixed-length file.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools