Convert CSV Columns to Rows
Convert specific columns in your CSV data into rows. Restructure wide-format data into long-format by unpivoting selected columns into row entries. The inverse of the rows-to-columns operation.
Input CSV
Options
Output CSV
What It Does
Convert specific columns in your CSV data into rows. Restructure wide-format data into long-format by unpivoting selected columns into row entries. The inverse of the rows-to-columns operation.
How It Works
Convert CSV Columns to Rows changes data from Columns into Rows. That is more than a cosmetic rewrite. Field layout, quoting, nesting, and even type representation can shift because the destination format has different rules and limits.
Conversion tools are constrained by the destination format. If the source can express nesting, comments, repeated keys, or mixed data types more richly than the target, the output may need to flatten or reinterpret part of the structure.
All processing happens in your browser, so your input stays on your device during the transformation.
Common Use Cases
- Convert monthly columns (Jan, Feb, Mar) into a single Month column with row entries
- Unpivot a wide survey response table into a long-format analysis table
- Reshape wide-format data for import into databases that expect normalized rows
- Convert crosstab reports into flat list format
- Prepare data for visualization tools that require long-format input
How to Use
- Paste your CSV data into the input.
- Specify which columns to convert to rows.
- Set the name for the new key and value columns.
- Click Convert and copy the long-format output.
Features
- Select multiple columns for conversion to rows
- Generates key-value pair rows from column headers and values
- Preserves non-selected columns as repeated identifiers
- Handles empty cells in converted columns
- Produces clean long-format output
Examples
Below is a representative input and output so you can see the transformation clearly.
A,1,3 B,2,4
A,B 1,2 3,4
Edge Cases
- Very large inputs can still stress the browser, especially when the tool is working across many columns. Split huge jobs into smaller batches if the page becomes sluggish.
- Source values that look similar can map differently in the target format when data types are inferred, flattened, or serialized.
- If the output looks wrong, compare the exact input and option values first, because Convert CSV Columns to Rows should be repeatable with the same settings.
Troubleshooting
- Unexpected output often means the input is being split or interpreted at the wrong unit. For Convert CSV Columns to Rows, that unit is usually columns.
- If a previous run looked different, check for hidden whitespace, changed separators, or a setting that was toggled accidentally.
- If nothing changes, confirm that the input actually contains the pattern or structure this tool operates on.
- If the page feels slow, reduce the input size and test a smaller sample first.
Tips
Name your key column descriptively — instead of 'variable,' use 'month' or 'metric' or whatever the converted columns represent. This makes the output self-documenting.
Frequently Asked Questions
How many rows will the output have?
Output rows = original data rows × number of columns being unpivoted. If you have 100 rows and unpivot 4 columns, the output has 400 rows.
What happens to empty cells in the unpivoted columns?
Empty cells produce rows with empty value fields. You can filter these out afterward if they represent missing data.
Can I unpivot all columns?
You need at least one column to serve as an identifier (kept as-is). If you unpivot all columns, there is no identifier to associate the values with their original row.
How do I reverse this operation?
Use the CSV Rows to Columns tool to pivot the data back to wide format.
Does the column header become a data value?
Yes. The column name becomes the value in the new 'key' column. For example, unpivoting columns 'Jan', 'Feb', 'Mar' produces rows where the key column contains 'Jan', 'Feb', or 'Mar'.
Can I unpivot by a pattern instead of listing every column?
This tool requires explicit column selection. If you have many columns following a pattern, list them individually.