Home › Developer Tools › CSV Transpose

CSV Transpose

Swap the rows and columns of CSV, TSV or cells pasted from a spreadsheet: the first column becomes the header row and every row becomes a column. Quoted fields, commas and line breaks inside cells are handled correctly.

Last updated:

Your data is processed locally in this tab and never uploaded. Tip: copy the result with Tab output and paste it straight into Excel or Google Sheets.

Advertisement
Advertisement

How to use the CSV Transpose

  1. Paste your data into the left box, open a .csv, .tsv or .txt file, or copy cells from a spreadsheet and paste them. A sample is loaded so you can see the result.
  2. Check the delimiter: Auto-detect works for most files; pick comma, semicolon, tab, pipe or a custom character if needed.
  3. Choose the output format: keep the same delimiter or switch, for example to Tab for pasting into Excel.
  4. Press Transpose CSV (it also updates live) and check the row and column counts and the preview table.
  5. Copy or download the transposed file, or press Swap to use it as the new input.

What transposing looks like

The first column of the original becomes the header row of the result, and the original header row becomes the first column. Cell (row r, column c) moves to (row c, column r).

Original CSV (3 rows × 3 columns)Transposed (3 rows × 3 columns, flipped)
Name,Q1,Q2
North,120,135
South,98,104
Name,North,South
Q1,120,98
Q2,135,104

A table with m rows and n columns always becomes n rows and m columns, and transposing twice gives back the original exactly.

When to transpose CSV data

  • Wide to long for charts: many charting tools expect one series per column. If your months run across the top, transposing puts them down the side.
  • Database and API imports: exports that list fields down the first column (a "key, value" layout per record) need to be flipped so each field becomes a column header.
  • Readable comparisons: a table with 3 products and 40 attributes is easier to read with the products as columns.
  • Survey and sensor data: instruments often write one row per measurement type; analysis tools usually want one row per sample.

Delimiters and quoting

FormatDelimiterWhere you see it
CSVComma ,Default in the US/UK, most apps and databases
CSV (European)Semicolon ;Excel in locales that use a decimal comma (Germany, France, Spain…)
TSVTabCells copied from Excel, Google Sheets or Numbers, many data exports
PSVPipe |Log files, legacy and mainframe exports

Under RFC 4180, a field that contains the delimiter, a double quote or a line break is wrapped in double quotes, and quotes inside it are doubled: "Spring ""launch"" promo". With Quote output fields: Only when needed the tool follows exactly this rule; choose Always if a strict importer expects every field quoted.

Frequently asked questions

What does transposing a CSV do?

Transposing flips the table along its diagonal: row 1 becomes column 1, row 2 becomes column 2, and so on. A file with 5 rows and 3 columns becomes 3 rows and 5 columns, and the cell at row r, column c moves to row c, column r. It is the same operation as Paste Special › Transpose in Excel or the TRANSPOSE function.

Does it handle commas and line breaks inside cells?

Yes. Fields wrapped in double quotes may contain the delimiter, line breaks and quotes written as two double quotes (""), as defined in RFC 4180. They are parsed as single cells and quoted again in the output where needed, so the structure is preserved.

How is the delimiter detected?

The tool tries comma, tab, semicolon and pipe on the first rows and picks the one that splits the most rows into the same number of columns. Data copied from Excel or Google Sheets is tab-separated, and many European CSV exports use semicolons. You can always override the choice.

What happens if rows have different lengths?

The table is first squared up: short rows are padded with empty cells to the length of the longest row, so every value keeps its position. The message tells you how many rows were padded.

How do I transpose in Excel or Google Sheets instead?

In Excel, copy the range, right-click the target cell and choose Paste Special › Transpose, or use =TRANSPOSE(A1:E10). In Google Sheets use =TRANSPOSE(A1:E10). This tool is quicker for CSV files you do not want to open in a spreadsheet, and it never changes values such as leading zeros or long numbers.

Will my numbers or dates be changed?

No. Every cell is treated as text and moved exactly as written, so leading zeros, long IDs, dates and formulas are not reformatted the way a spreadsheet might.

Is my data uploaded?

No. Parsing and transposing run in JavaScript in this page, so your file never leaves your device.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.CSV to JSONConvert CSV data to JSON with live preview.CSV SplitterSplit a large CSV into smaller files by row count, file count or column value, header kept.CSV MergerCombine many CSV files into one, matching columns by name, with dedupe and a source column.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.JSON to CSVConvert JSON data to CSV for spreadsheets.Excel to CSVConvert XLSX spreadsheets to CSV.Excel Viewer (XLSX / XLS)Open XLSX, XLS and ODS spreadsheets in your browser without Excel.Line Ending ConverterConvert text and files between CRLF, LF and CR line endings.Markdown to HTMLConvert Markdown to clean HTML with a live editor.XML to JSONConvert XML to JSON with validation.Text Encoding ConverterDetect and convert text file encodings like UTF-8, UTF-16 and Latin-1.JSON ViewerExplore JSON as a collapsible tree, search keys and values and copy any node's path.TTF to WOFF2 ConverterConvert TTF and OTF fonts to WOFF2 or WOFF and get a ready @font-face CSS snippet.Chmod CalculatorConvert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation.JSON to TypeScriptGenerate TypeScript interfaces or types from JSON, with nested types and optional fields.Morse Code TranslatorTranslate text to Morse code and back, then play it as sound or a blinking light, or save a WAV.HTML Table GeneratorBuild HTML tables in an editable grid with styles, header rows, CSV import and live preview.Hex to Text ConverterConvert hex to text and text to hex with UTF-8 support and space, 0x, \x or comma formats.JSON to XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.HTML to Markdown ConverterTurn HTML or pasted rich text into clean Markdown with tables and live preview.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.JSON ValidatorCheck JSON with the exact line and column of each error, fix tips and one-click auto-fix.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Base64 to ImagePaste a Base64 string or data URI to preview, identify and download the image.JSON CompareCompare two JSON documents and see every added, removed and changed path.Hex to DecimalConvert hex to decimal instantly with steps and signed mode.Decimal to HexConvert decimal to hex instantly with steps and signed mode.Binary to DecimalConvert binary to decimal instantly with steps and signed mode.Decimal to BinaryConvert decimal to binary instantly with steps and signed mode.Two's Complement CalculatorDecimal to two's complement binary and back for 4-64 bits, with invert-and-add-1 steps.XML to CSV ConverterConvert XML to CSV: detects repeating records, flattens nested data, pick your columns.CSV to XML ConverterConvert CSV to well-formed XML with custom root and row names, escaping and pretty print.TOML to JSON ConverterConvert TOML to JSON and JSON to TOML with a full v1.0 parser and clear error lines.JSON to Go StructTurn JSON into Go structs with inferred types, nested structs and json tags.JSON to Python ClassGenerate Python dataclasses, Pydantic models or TypedDicts with type hints from JSON.JSON to SQL ConverterConvert a JSON array of objects to CREATE TABLE and INSERT statements for MySQL, Postgres, SQLite.JSON to Swift StructTurn JSON into Swift Codable structs with CodingKeys, optionals and nested types.JSON to TOML ConverterConvert JSON to clean TOML with tables, arrays of tables, inline tables and dates.JSONL to JSON ConverterConvert JSON Lines / NDJSON to a JSON array and back, with line-level error reports.Properties to YAML ConverterConvert Java .properties to nested YAML (application.yml) and YAML back to properties.PX to EM ConverterConvert pixels to em using the parent font size, and em back to px, with conversion tables.Query String to JSONConvert URL query strings to JSON with nested brackets and arrays, and JSON back to a query string.REM to PX ConverterConvert CSS rem values to pixels for any root font size, with a quick 0.25–6rem table.SQL to JSON ConverterConvert SQL INSERT statements and dumps into a JSON array of row objects, with CSV export.TSV to CSV ConverterConvert TSV to CSV and back, or between tab, comma, semicolon and pipe, with correct quoting.TypeScript to JavaScriptConvert TypeScript or TSX to clean JavaScript instantly: strip types, keep or compile JSX.XML to YAML ConverterConvert XML to clean YAML with attributes, text nodes, lists and exact error lines.YAML to XML ConverterConvert YAML to pretty, well-formed XML with custom root, attributes and array item tags.Boolean Algebra SimplifierSimplify boolean expressions or minterm lists to minimal SOP and POS with Quine-McCluskey steps.Compare Excel FilesCompare two Excel spreadsheets cell by cell, highlight changes and export a diff report.CSV CleanerClean messy CSV in one click: trim spaces, drop empty rows and columns, fix headers, dedupe.CSV VLOOKUP ToolJoin two CSV or Excel files on a key column like VLOOKUP, with left, inner and full joins.Remove Duplicates in ExcelFind and remove or highlight duplicate rows in XLSX or CSV files by the columns you choose.GeoJSON ViewerView GeoJSON on a map, inspect and edit properties, validate against RFC 7946 and export.GPX ViewerOpen GPX tracks on a map with distance, elevation profile, moving time, speed and splits.JSON Repair ToolFix broken JSON automatically: trailing commas, quotes, comments, truncated data, with a diff.Karnaugh Map SolverSolve 2–6 variable K-maps: click cells or enter minterms to get the minimal SOP or POS with groups.Merge Excel FilesCombine XLSX, XLS and CSV files into one workbook or append all rows into a single sheet.Parquet File ViewerOpen Apache Parquet files in your browser: schema, rows, filters and CSV or JSON export.Query CSV with SQLRun SQL on CSV, Excel, JSON and Parquet files in your browser with DuckDB. Join and export.Online Serial MonitorTalk to Arduino, ESP32 and USB serial devices in your browser: log, send, plot and save.Split Excel FileSplit an Excel sheet into several files by row count or by each value in a column, as ZIP.SQL Create Table GeneratorDefine columns, keys, defaults and indexes; get CREATE TABLE SQL for MySQL, Postgres and more.SQL IN Clause GeneratorTurn a pasted list into a SQL IN ('a','b') clause with quoting, dedupe and 1,000-item chunks.SQL Online CompilerRun SQL queries online on SQLite with sample databases, a result grid, CSV export and .db save.
See all 129 Data & File Format Converters →