User Rating 0.0 β˜…β˜…β˜…β˜…β˜…
Total Usage 0 times
Drop CSV file here or click to browse Supports .csv, .tsv, .txt up to 50 MB
or paste CSV text
Is this tool helpful?

Your feedback helps us improve.

β˜… β˜… β˜… β˜… β˜…

About

CSV files exported from databases, APIs, or spreadsheets rarely arrive with columns in the order you need. Manually rearranging columns in a text editor risks corrupting quoted fields, breaking escaped delimiters, or silently dropping data. This tool parses CSV input in compliance with RFC 4180, correctly handling quoted fields containing commas, newlines, and escaped double-quotes (""). It auto-detects the delimiter (d) by frequency analysis across the first 20 rows, supporting comma, semicolon, tab, and pipe characters. You reorder columns visually and export a correctly re-quoted file.

The tool operates entirely client-side. No data leaves your browser. It handles files up to 50 MB and displays a live preview of the first 100 rows. Note: this tool assumes rectangular data. Rows with inconsistent column counts are flagged but preserved. For fixed-width or multi-character delimiter formats, pre-convert to standard CSV first.

csv column sorter csv reorder csv editor data tool spreadsheet csv columns file tool

Formulas

Delimiter auto-detection scores each candidate delimiter d by computing the modal column count across sampled rows:

score(d) = mode({ count(d, rowi) : i ∈ [1, n] })

The delimiter with the highest consistent score (and score > 0) is selected. Column reordering applies an index permutation Οƒ to each row:

rowβ€² = [row[Οƒ(0)], row[Οƒ(1)], …, row[Οƒ(k βˆ’ 1)]]

Where k is the total column count and Οƒ is the user-defined column order. Fields requiring quoting are wrapped per RFC 4180: any field containing the delimiter d, a double quote ", or a newline character is enclosed in double quotes, with internal quotes escaped as "".

needsQuote(field) = field contains (d ∨ " ∨ \n)

Where d = active delimiter, field = cell content string, Οƒ = permutation array of column indices, k = number of columns, n = number of sampled rows for detection (max 20).

Reference Data

DelimiterCharacterCommon SourceAuto-DetectedRFC 4180Notes
Comma,Excel, Google Sheets, APIsYesYesDefault standard delimiter
Semicolon;European Excel, SAPYesNoUsed where comma is decimal separator
Tab\tTSV exports, databasesYesNoCommon in bioinformatics data
Pipe|Legacy systems, mainframesYesNoRarely appears in field data
Double Quote"All CSV sourcesN/AYesStandard text qualifier
Escaped Quote""Fields containing quotesN/AYesTwo consecutive double quotes
Newline in Field\nAddress fields, notesN/AYesMust be inside quoted field
BOM MarkerU+FEFFWindows Excel UTF-8 exportStrippedN/AByte Order Mark removed on parse
CRLF\r\nWindows systemsNormalizedYesConverted to \n internally
LF\nUnix/Mac systemsNativeYesStandard internal line ending
CR\rClassic Mac OSNormalizedNoLegacy, converted to \n
UTF-8EncodingModern systemsDefaultRecommendedTool reads as UTF-8
Empty Field,,Sparse datasetsN/AYesPreserved as empty string
Trailing Delimiter,\nSome exportersHandledAmbiguousCreates empty last column
Header RowFirst rowMost CSV filesAssumedOptionalToggle available in tool

Frequently Asked Questions

The parser splits each of the first 20 rows by each candidate delimiter (comma, semicolon, tab, pipe) and counts the resulting fields. The delimiter that produces the most consistent (modal) field count across rows wins. If two delimiters tie, comma takes priority per RFC 4180. You can always override the detected delimiter manually.
The parser implements a state machine that tracks whether the current position is inside a quoted field. Commas and newlines within double-quoted fields are treated as literal characters, not as delimiters or row separators. When exporting, these fields are re-quoted correctly with internal double-quotes escaped as two consecutive double-quote characters ("").
Yes. Tab to the column chip you want to move, then press the left or right arrow keys to shift its position. Each keypress swaps the column with its neighbor. Press Enter or Space to confirm placement. The preview table updates immediately. Screen readers announce the new column position via an aria-live region.
Rows with fewer columns than the header are padded with empty strings during reorder. Rows with more columns than the header retain extra fields at the end of the reordered row. A warning toast is displayed indicating the count of irregular rows. The data is never silently truncated.
The tool processes files up to 50 MB in the browser. Beyond that threshold, memory constraints in the browser tab may cause slowdowns or crashes depending on available RAM. For files exceeding 50 MB, consider using a command-line tool like csvkit or Miller. The preview table always shows only the first 100 rows regardless of file size to maintain UI responsiveness.
No. All parsing, reordering, and export operations run entirely in your browser's JavaScript runtime. No data is uploaded to any server. The file is read using the FileReader API, processed in memory, and the export is generated as a local Blob download. Closing the tab releases all data from memory.