Pivot CSV
A pivot turns a long table, with one measurement per row, into a wide table that has one column per category. A typical case is a sales export where each row is a single sale with a region, a quarter, and an amount, and you want one line per region with the quarters running across the top. This pivot CSV tool performs that reshape in the browser, so you do not have to build a pivot table in a spreadsheet first.
Choose the column that should become each output row, the column whose distinct values should become new headers, and the column holding the numbers. Then pick how repeated combinations are combined and copy or download the wide CSV.
Key features
- Row key, column key, and value columns picked from the header row
- Sum, Count, and First aggregation for repeated combinations
- Blank cells for combinations that never appear
- Duplicate header check before any output is produced
About the long-format CSV to wide CSV format
The output header is the row-key column name followed by one column for every distinct value in the column-key column, in the order those values first appear in the file. Each cell aggregates the value column across all input rows that share that row key and column key. A combination that never occurs is left empty rather than written as zero, so an empty cell means no data was recorded.
Sum adds the numeric values and skips empty cells. When every value cell in a combination is empty, Sum writes an empty cell, not 0. Count returns how many rows share the combination, whether or not their value cell is filled. First keeps the value from the earliest matching row in file order.
How it works
The tool reads each data row once and files its value under the pair formed by the row key and the column key. Once every row is read, each cell is computed from the values collected for its pair, using the aggregation you chose.
Common use cases
- Turning a transaction log into one row per customer with a column for each month.
- Reshaping survey responses so each respondent is a row and each question becomes a column.
- Building a region-by-quarter grid for a slide from a raw export that lists every order.
- Counting how many events of each type happened on each day before charting them.
How to use this tool
- Paste the long table, one measurement per row, or upload it with its header line first.
- Set the row key column, which names the entity each output row describes.
- Set the column key column, whose values become headers, and the value column that holds the numbers.
- Choose the aggregation, then confirm each blank cell matches a combination you expected to be absent.
Example
Input (long CSV, five rows)
region,quarter,revenue
North,Q1,1200
North,Q2,1350
South,Q1,980
South,Q3,1100
North,Q1,300Output (region by quarter, Sum)
region,Q1,Q2,Q3
North,1500,1350,
South,980,,1100Tips for best results
- Run Count first on an unfamiliar file. It shows how many records sit in each cell, which tells you whether a Sum will mean anything.
- Letter case creates separate columns, so q1 and Q1 in the column-key field become two headers. Normalize the values before pivoting if the export is inconsistent.
- Row and column totals are not calculated. Add them after download if the destination needs them.
Common errors and how to fix them
- Row key, column key, and value must be three different columns.
- Two of the three column fields name the same header. Pick three different columns; pivoting a column against itself produces nothing useful.
- Column "revenue" has a non-numeric value, so it cannot be summed.
- Remove currency symbols and thousands separators from that column, or switch the aggregation to Count or First if you only need the shape of the grid.
- Pivot would create duplicate column names.
- A value in the column-key column matches the row-key header, for example a region called region. Rename the row-key header first with Rename CSV Columns.
Frequently asked questions
Why do some cells come out empty?
No input row had that row key and column key together. The tool writes an empty cell instead of 0, so you can tell a missing combination from a real zero.
Can it pivot two value columns in one run?
No. Each run uses one value column. Run the tool twice on separate value columns and join the two outputs with Join CSV on the row key.
For more background on data formats and conversion workflows, read our format guides.