User Rating 0.0
Total Usage 0 times
Drop CSV file here or browse Supports .csv, .tsv, .txt — Max 10 MB
0 chars
Is this tool helpful?

Your feedback helps us improve.

About

Transposing a CSV file means converting its rows into columns and its columns into rows. The element at row i, column j in the source becomes row j, column i in the output. This operation is critical when data orientation does not match the expected input format of statistical software, database import wizards, or visualization pipelines. Feeding a column-oriented dataset into a tool that expects row-oriented records produces silent errors - wrong aggregations, broken joins, corrupted charts. This tool parses CSV strictly per RFC 4180, handles quoted fields with embedded delimiters and newlines, auto-detects the delimiter, and transposes the matrix in-browser with no server upload.

Limitations: jagged rows (unequal column counts) are padded with empty cells. Files over 10 MB are rejected to prevent browser memory exhaustion. Encoding is assumed UTF-8. The parser does not interpret data types - all cells remain strings. For extremely wide CSVs (thousands of columns), the resulting transposed file will have thousands of rows, which is normal but may affect downstream tools with row-count limits.

csv transposer transpose csv swap rows columns csv tool csv rows to columns csv converter data transformation

Formulas

The transpose operation maps every element from its source position to a swapped position in the output matrix.

Bj,i = Ai,j

Where A is the input matrix of dimensions m × n (rows × columns), and B is the transposed output of dimensions n × m. For every row index i [0, m1] and column index j [0, n1], the value at row i, column j in A is placed at row j, column i in B.

Delimiter auto-detection counts occurrences of each candidate delimiter in the first 5 lines. The candidate with the highest consistent count across all sampled lines is selected. Tie-breaking order: comma semicolon tab pipe.

The CSV parser uses a finite state machine with three states: FIELD_START, UNQUOTED, and QUOTED. Transitions occur on encountering the delimiter character, the quote character, or a newline. This guarantees correct handling of fields that contain the delimiter itself, embedded newlines, or escaped quotes ("" ").

Reference Data

DelimiterSymbolCommon File ExtensionsTypical Use CaseAuto-Detected
Comma,.csvStandard CSV exports (Excel, Google Sheets)Yes
Semicolon;.csvEuropean locale CSV (decimal comma conflicts)Yes
Tab\t.tsv, .txtDatabase dumps, clipboard paste from spreadsheetsYes
Pipe|.txt, .datLegacy mainframe exports, log filesYes
CustomUser-definedAnyNon-standard delimited filesNo (manual)
RFC 4180 Rules
Rule 1Each record is on a separate line, delimited by a line break (CRLF)
Rule 2The last record may or may not have an ending line break
Rule 3An optional header line may appear as the first line
Rule 4Fields may be enclosed in double quotes
Rule 5Fields containing line breaks, double quotes, or the delimiter must be quoted
Rule 6A double quote inside a quoted field is escaped by preceding it with another double quote
Transpose Properties
SymmetryTransposing twice returns the original matrix: (AT)T = A
DimensionsAn m × n matrix becomes n × m
Cell CountTotal cells preserved: m n = n m
Jagged HandlingShort rows padded with empty strings to match the longest row before transposing

Frequently Asked Questions

The tool samples the first 5 non-empty lines of your input. For each candidate delimiter (comma, semicolon, tab, pipe), it counts occurrences per line. The delimiter that appears with the most consistent count across all sampled lines is selected. If two delimiters tie, comma takes priority, followed by semicolon, tab, then pipe. You can always override auto-detection by selecting a specific delimiter manually.
Before transposing, the tool determines the maximum column count across all rows. Any row with fewer columns is padded with empty strings to match that maximum. This ensures the transposed output is a proper rectangular matrix. The padded cells appear as empty fields in the output CSV.
Yes. The parser follows RFC 4180 strictly. Fields containing the delimiter, double quotes, or newline characters are correctly parsed regardless of position. After transposing, the serializer re-quotes any field that contains the active delimiter, a double quote, or a newline. Double quotes within fields are escaped as two consecutive double quotes.
File uploads are limited to 10 MB to prevent browser memory exhaustion. For text pasted directly, the practical limit depends on your browser's memory, but the tool processes data in chunks for inputs exceeding 50,000 total cells. If your CSV has 1,000 rows and 200 columns (200,000 cells), the transpose will still complete but may take a few seconds with a visible progress indicator.
Yes. The auto-detection algorithm recognizes tab characters as delimiters. Simply upload or paste your TSV data and the tool will detect tabs automatically. The output will also use tabs as the delimiter, matching the input format. You can switch the output delimiter independently if needed.
Transpose is an involution on rectangular matrices. Applying the mapping Bj,i = Ai,j twice yields Ci,j = Bj,i = Ai,j, recovering the original. This property is useful for verification: transpose your output and compare it to the source.