ModernCalcs

CSV Pivot Generator

region,Gadget,Widget
East,75,200
North,85,180
South,110,95

Empty cells appear where no data exists for that row/column combination. Non-numeric values in the Value field are skipped.

CSV Pivot Generator: Cross-Tabulate Data Without Excel or Python

Pivot tables are the standard way to summarize categorical data — sales by region and product, support tickets by team and priority, revenue by quarter and channel. Building them requires Excel or pandas or SQL. This generator does it in the browser: paste your CSV, pick your row dimension, column dimension, and value field, and get a clean pivot table as CSV.

Formula
Input: region,product,sales North,Widget,120 North,Gadget,85 South,Widget,95 Pivot (row=region, col=product, agg=sum): region,Gadget,Widget North,85,120 South,,95

Empty cells mean no data for that row-column combination. Output is valid CSV ready to copy into Excel or Google Sheets.

What Makes a Good Pivot

Pivot tables work best when the row and column dimensions are categorical (a bounded set of unique values) and the value field is numeric. If the column dimension has too many unique values, the pivot table becomes very wide. If it has too few, a simple GROUP BY would suffice. Good examples: region × product × total_sales; month × category × count; team × priority × avg_resolution_time.

Aggregation Choice

Sum is appropriate for additive metrics (sales, revenue, count of events). Count is for frequency analysis (how many records, not their sum). Average is for rates, scores, or normalized metrics. Min/Max are for identifying outliers within groups. Be careful with average — an average of an average is not an overall average, so use sum+count to compute meaningful group averages from sub-groups.

Exporting to Excel for Further Analysis

The pivot output is plain CSV. Copy it to Excel or Google Sheets, then apply Excel's own formatting: column width auto-fit, conditional formatting on values, sorting, and chart creation. This workflow gives you the data transformation (done here, browser-side) plus Excel's visualization layer.

Pivot Capabilities

  • Row dimension: any categorical column
  • Column dimension: any categorical column
  • Value field: numeric column
  • Aggregations: sum, count, avg, min, max
  • Output: valid CSV, ready to import

Frequently Asked Questions

What is a pivot table?

A pivot table summarizes data by cross-tabulating two categorical dimensions and aggregating a numeric value. The row dimension becomes the left column of the output, the column dimension becomes the column headers, and each cell contains the aggregated value (sum, count, average, min, or max) of all rows that match that row-column combination.

What aggregations are supported?

Sum: adds all values in the group. Count: counts the number of rows in the group (non-numeric values are counted). Average: sum divided by count. Min: smallest value in the group. Max: largest value in the group. Non-numeric values in the Value field are skipped for Sum, Avg, Min, and Max; Count counts all rows regardless of value type.

What if a row-column combination has no data?

The cell is left empty in the pivot output. This is equivalent to SQL's PIVOT producing NULL for combinations with no matching rows. For Sum and Avg, an empty cell means no data — it does not mean 0.

Can I export the pivot table?

Yes. Copy the pivot table output using the Copy button. The output is valid CSV — paste it into Excel, Google Sheets, or any CSV tool. In Google Sheets: paste into an empty range. In Excel: paste and use 'Text to Columns' with comma delimiter if needed.