User Rating 0.0
Total Usage 0 times
Drop CSV file here or click to browse Supports .csv, .tsv, .txt • Max ~200 MB
Is this tool helpful?

Your feedback helps us improve.

About

Manually editing CSV files in a text editor to add a column is error-prone. A misplaced comma inside a quoted field corrupts every subsequent row. This tool implements a full RFC 4180-compliant parser that correctly handles quoted fields, embedded delimiters, escaped double-quotes (""), and newlines within cell values. It inserts a new column at any position k where 0 k n (total existing columns), then re-serializes the data preserving the original quoting rules. The tool auto-detects delimiters by frequency analysis across the first 5 lines, scoring candidates: comma, semicolon, tab, and pipe.

Fill modes include static text, incremental row index (starting from 1), or leaving cells empty for later population. For files exceeding 1 MB, processing offloads to a Web Worker to keep the UI responsive. Note: this tool operates entirely in-browser. No data leaves your machine. Maximum practical file size depends on available browser memory, typically around 100 - 200 MB on modern devices.

csv column insert csv editor data manipulation spreadsheet csv tool add column csv

Formulas

The column insertion operates on a zero-indexed position. Given a row represented as an ordered tuple of n fields:

R = (f0, f1, …, fn1)

Inserting a new field v at position k yields:

R = (f0, …, fk1, v, fk, …, fn1)

Where k {0, 1, …, n}. The resulting row length becomes n + 1. For row-index fill mode, the value v for row i (data rows, excluding header if present) is:

vi = i + 1

Delimiter auto-detection scores each candidate d by computing the standard deviation σ of occurrence counts across sampled lines. The candidate with the lowest non-zero σ and highest mean count wins. A field requires quoting in the output if it contains the delimiter character, a double-quote, or a newline.

Reference Data

DelimiterSymbolCommon UseAuto-Detect KeyRFC Standard
Comma,Most CSV files (US/UK locale)Highest frequency non-quotedRFC 4180
Semicolon;European CSV (Excel EU export)Common when comma is decimal separatorNo formal RFC
Tab\tTSV files, database exportsConsistent count per lineIANA text/tab-separated-values
Pipe|Legacy systems, mainframe exportsRare in natural textNo formal RFC
Quoted Field"..."Fields containing delimiters or newlinesStarts and ends with double-quoteRFC 4180 §2.6
Escaped Quote""Literal double-quote inside quoted fieldTwo consecutive double-quotesRFC 4180 §2.7
CRLF Line End\r\nWindows-origin filesNormalized to \n during parseRFC 4180 §2.1
LF Line End\nUnix/macOS-origin filesDefault line breakCommon practice
UTF-8 BOM\uFEFFExcel UTF-8 exportsStripped during parseUnicode §2.6
Header Row - First row as column namesUser toggleRFC 4180 §2.3 (optional)
Empty Field,,Missing data / NULL valuesZero-length between delimitersRFC 4180 §2.5
Trailing Delimiter,\nSome legacy exportersCreates phantom empty columnNot standard (common bug)

Frequently Asked Questions

The parser samples the first 5 lines of the file, counts occurrences of each candidate delimiter (comma, semicolon, tab, pipe) per line, then selects the delimiter whose per-line count has the lowest standard deviation (most consistent) and a mean count above zero. This fails when the file has fewer than 2 lines, when multiple delimiters appear with equal consistency, or when the file uses an exotic delimiter not in the candidate list. In such cases, manually select the delimiter from the dropdown.
The tool follows RFC 4180 quoting rules. Any field containing the active delimiter, a double-quote character, or a newline (CR or LF) is wrapped in double-quotes on output. Existing double-quotes within such fields are escaped by doubling them (""). Fields that do not require quoting are output as-is to minimize file size changes.
Each operation inserts one column. To add multiple columns, download the result and re-upload it, inserting the next column. This sequential approach prevents ambiguity in position indexing - inserting at position 3 and position 5 simultaneously would shift indices mid-operation, producing unexpected results.
Real-world CSV files often have rows with varying field counts due to missing trailing delimiters or data entry errors. The tool does not enforce uniform row length. It inserts the new field at position k regardless of the row's actual length. If a row has fewer than k fields, the new field is appended at the end of that row, effectively padding it. The preview table highlights rows with non-standard lengths in a warning color.
The tool runs entirely in the browser. Files under 1 MB process on the main thread in under 200 ms. Files over 1 MB use a Web Worker to avoid UI freezing. Practical limits depend on device RAM - most modern browsers handle 50-200 MB. Files beyond that may cause an out-of-memory error. Row count matters more than raw byte size: a 10 MB file with 500,000 short rows is heavier to process than a 10 MB file with 10,000 long rows, due to array allocation overhead.
The FileReader API decodes the file as UTF-8 by default. If your file uses Latin-1 (ISO-8859-1) or another encoding, non-ASCII characters may appear garbled. The tool strips a UTF-8 BOM (byte order mark) if present. For non-UTF-8 files, convert the encoding first using a dedicated encoding converter, then process the CSV here.