Summarise a CSV as a pivot table: group rows by one or two columns and show the sum, count, average, median or another total for each group, with row and column totals.
Initializing in your browser…
Open a CSV as a sortable, searchable table, edit cells, rows and columns with undo, and download the result. Runs in your browser.
Turn a CSV into CREATE TABLE, INSERT, UPDATE or UPSERT statements for PostgreSQL, MySQL, SQLite, SQL Server or Oracle, with types detected and every value escaped.
Convert CSV to JSON or JSON back to CSV, keeping zip codes, IDs and quoted text exactly as written and listing anything the conversion changes.
Sixteen orders from four sales regions over four quarters. You want revenue per region per quarter, and one order has no amount filled in.
orders.csv (excerpt)
Order,Region,Quarter,Product,Units,Amount 1001,North,Q1,Laptops,3,3600 1004,North,Q1,Accessories,12,384 1009,North,Q3,Monitors,2,540 1012,North,Q3,Accessories,15, 1014,North ,Q4,Laptops,5,6000 ... (16 orders in all)
Sum of Amount by Region and Quarter, group names ignoring spaces
Region Q1 Q2 Q3 Q4 Total North 3,984 4,800 540 6,000 15,324 South 2,400 1,638 3,600 800 8,438 West 1,080 640 1,200 4,020 6,940 Total 7,464 7,078 5,340 10,820 30,702
North's Q1 cell is 3,600 plus 384. Its Q3 cell is only 540, because order 1012 has an empty amount and an empty cell is left out rather than counted as zero. Order 1014 was typed as "North " with a trailing space; with exact matching it appears as a separate row holding 6,000, and the page suggests Ignore spaces, which folds it into North's Q4 and gives North a total of 15,324. The grand total of 30,702 is the same either way, because no order is lost, only regrouped.
Choose a column for the rows, an optional column for the columns, a value to summarise and how to summarise it, and the pivot table appears straight away with totals on both edges. It works like a spreadsheet pivot table, but in your browser and without importing anything, and it tells you which values it left out and why.
How it works. A pivot table answers questions like "how much did each region sell in each quarter?" Pick Region for Rows, Quarter for Columns, Amount for Values and Sum for Summarise by, and you get one row per region, one column per quarter, each cell holding the total for that combination, plus a Total row and column. Leave Columns at None for a simple list of groups with one figure each. The table rebuilds the moment you change a setting, so you can try Count, Average or Maximum on the same data in a few clicks.
Thirteen ways to summarise. Sum, Average, Median, Minimum and Maximum work on numbers. Count counts cells that hold something, Count rows counts every row in the group including empty cells, and Count distinct counts different values, which answers questions such as how many customers bought each product. First and Last return the first or last value in file order, Concatenate joins the values with a separator you choose, and there are both population and sample standard deviations. Totals are worked out from the underlying values, so the total of an Average column is the average of all the values in that row, not the average of the averages.
Numbers and gaps. Values are read as numbers when they are numbers; cells such as N/A or pending are left out of a sum or average rather than counted as zero, and the page says how many were skipped with examples. If your amounts are written with thousands separators, like 1,234.50, switch on the matching option under More options so they are read correctly. Empty cells in the grouping columns form their own group, shown in italics, so no row disappears.
Group names. By default names are matched exactly, which keeps genuinely different values apart. Real exports often contain slips such as "North" and "North " with a trailing space, or "north" in lower case. When that happens the page points it out, and Match group names under More options can ignore spaces, or spaces and case, and list which spellings were combined.
Taking it further. Download the pivot as a CSV with plain numbers (no thousands separators, so any spreadsheet reads them as numbers) and a UTF-8 byte order mark, or copy it and paste it straight into Excel or Google Sheets, where it lands in separate cells. Your data is processed in the browser and never uploaded.
Total revenue per region per quarter or month from an order export, with totals for each region and each period.
Count survey answers by question and option, or support tickets by team and priority, using Count or Count rows.
Average order value per customer segment, or average delivery time per courier, with Average or Median.
Rebuild a pivot from the raw export to confirm the figures in a report, including how many values were skipped.
With Product as Rows, Columns set to None, Units as Values and Average, the sample gives Accessories 16.2, Laptops about 2.86 and Monitors 4.25 units per order.
Count distinct on a Customer column, with Product as Rows, shows how many different customers bought each product rather than how many orders there were.
In the sample, order 1012 has no amount, so North's Q3 total is 540 from one order, and the empty cell is not counted as zero.
Because the two names are not exactly the same, usually a trailing space or a difference in capital letters. The page points out such pairs. Under More options, set Match group names to Ignore spaces, or Ignore spaces and case, to merge them; the page then lists which spellings were combined.
Count counts cells in the value column that hold something, so empty cells are not counted. Count rows counts every row in the group, whether or not the value cell is empty.
Totals are computed from all the underlying values. For Average, the total of a row is the average of every value in that row, which differs from averaging the cell averages when groups have different sizes. For Sum and the counts, the two agree.
Numeric summaries only use cells that are numbers. Text such as N/A or pending is skipped, and the page lists how many cells were skipped with examples. If your numbers contain thousands separators, turn on the option for them under More options.
Yes. Set Columns to None and you get a simple grouped summary: one row per group with a single figure, like GROUP BY in SQL.
Press Copy and paste into a sheet, and each value lands in its own cell. Or press Download CSV; numbers are written without thousands separators so they are read as numbers in any language setting.
Yes. The file is read and summarised in your browser and is never uploaded.
Rows and columns are parsed and transformed in memory in your browser. No record ever reaches a server.