CSV Pivot Table
Group CSV records into a pivot table with counts or exact decimal sums, without uploading your data.
This tool runs entirely in your browser. Your data is never uploaded, never stored, and never leaves your device.
CSV Pivot groups a table into category columns, counts records or sums plain decimals exactly, and exports a CSV with per-group totals and explicit zero cells for missing combinations.
How to use it
- 1Paste or load CSV, choose the delimiter and read its columns.
- 2Select a row group, a column category, and count or exact-decimal sum.
- 3Review the group/category counts and overall total, then download the pivot CSV.
Example
- Input
- region,month,sales North,Jan,0.1 North,Jan,0.2 North,Feb,10.50 South,Jan,7
- Output
- North: Jan 0.3, Feb 10.5, row total 10.8 South: Jan 7, Feb 0, row total 7 Overall sum: 17.8
Sum mode uses exact decimal arithmetic, not floating-point addition.
What happens to your data
CSV parsing, grouping, arithmetic and export happen on this device. No source rows need to leave the browser. Editing a setting removes the previous result so an outdated pivot cannot be downloaded.
Last updated October 2026
Create a pivot table from CSV by choosing a row group, a column category and a calculation. Count source records or sum plain decimal values exactly, then download a wide summary with a total for every group. It is useful for turning event exports into category counts or combining decimal amounts by region and month.
The sum uses scaled integers rather than binary floating-point arithmetic. For example, 0.1 plus 0.2 produces 0.3, and large whole-number amounts are not rounded through JavaScript Number. This is aggregation, not CSV Transpose: many source records can contribute to one result cell.
How it works
Paste CSV or load a local UTF-8 file, select comma, semicolon or tab, then read the columns. Choose the field that identifies output rows and the field whose distinct values become output columns. Count records needs no numeric field. Sum exact decimals additionally requires a value column and validates every source record before returning a complete result.
Groups and categories compare exact text and retain their first-seen order. Leading zeros, letter case and spaces are significant. Empty group and category values are kept rather than dropped. Category headers use the prefix value: followed by a JSON-quoted label. This makes value:"" an empty category and value:"[empty]" a different, literal category; embedded quotes and line breaks are escaped unambiguously. The first column is group: followed by the selected group field, and the final column is row_total.
Count records adds one for every input data row. It does not count only nonempty values in another column, and it does not deduplicate records. Sum accepts signed plain decimal notation, including 12, +12.5, -.25 and 1. Values may contain up to 100 digits in total and 30 digits after the decimal point. Blanks, surrounding spaces, currency symbols, thousands separators, scientific notation, NaN and Infinity are rejected with a record and line location. Invalid values are never silently skipped or treated as zero. Clean or deliberately filter your source first when such values are expected.
All sums are exact within those input limits. Results are normalized plain decimal strings: trailing fractional zeros are removed, negative zero becomes 0 and no currency rounding is applied. A missing group/category combination is explicitly 0. Row totals include every category; the overall total shown above the preview includes every source record. No separate total row is inserted, so a real group called Total cannot collide with a synthetic row. Mixed currencies or unlike units must be separated by your source or grouping choices; the tool does not know their business meaning.
The source is limited to 2 MiB, 10,000 records including its header, 200 fields per record and 200,000 cells. Headers must be unique and nonempty. Output is bounded to 198 categories, 200 columns including group and row_total, 200,000 cells including the header and 10 MiB of CSV. A header-only source cannot form a pivot. High-cardinality categories can create a sparse, very wide result; filter to the categories you need before pivoting. This is a single-group, single-category summary, not a multi-level spreadsheet pivot engine.
The file stays in browser memory, and the result is generated locally. Editing the source, delimiter, selected columns, calculation or protection option invalidates the previous result. Downloads use the selected delimiter, UTF-8, CRLF record endings and no BOM. Optional formula protection prefixes formula-like exported values, including negative totals, with an apostrophe. It changes those exported strings and may make spreadsheet cells text; it does not change the calculation. The preview remains unmodified and shows at most eight rows and six columns, abbreviating long text.
Worked example: Sum sales by region and month without decimal drift
- Input
- region,month,sales North,Jan,0.1 North,Jan,0.2 North,Feb,10.50 South,Jan,7 Group: region; category: month; sum: sales
- Result
- group:region,"value:""Jan""","value:""Feb""",row_total North,0.3,10.5,10.8 South,7,0,7
The exact overall sum is 17.8. South/Feb has no source records and therefore becomes 0. In count mode the North cells would instead be 2 and 1.
Common use cases
- Counting support events by team and status
- Summarizing same-currency decimal amounts by region and month
- Turning long category exports into wide importer-ready tables
- Reviewing exact totals without rounding large identifiers or amounts
Frequently asked questions
How is a pivot different from transposing CSV?+
Transpose swaps row and column positions without combining values. Pivot groups records and calculates a count or sum. Repeated group/category pairs become one aggregate cell rather than separate rows.
Does count ignore blank values?+
No. It counts every input data record in its group and category. Empty group or category labels are real labels. There is no separate count-nonempty-values mode.
Why is my amount rejected?+
The sum accepts plain decimal notation only, with at most 100 digits and 30 decimal places. Values such as 1,000, $12, 1e3, a blank or a value surrounded by spaces need deliberate cleaning first. The error identifies the offending record instead of silently changing it.
Are decimal totals rounded?+
No. Values are added exactly with scaled BigInt arithmetic, then printed without unnecessary trailing fractional zeros. It does not apply currency or tax rounding rules. The total can contain more than 100 digits when many valid inputs are added.
Why do output category headers contain quotation marks?+
They encode the category label unambiguously, including blank labels, line breaks and literal quotation marks. The CSV writer then escapes those header quotes according to CSV rules. A CSV reader restores the exact header text.
Can I use several grouping fields, averages or percentages?+
This version supports one row-group field, one category field and either record count or exact-decimal sum. It does not provide averages, distinct counts, calculated percentages, subtotals or multiple aggregation fields.
Related tools
CSV Join
Match two CSV tables by exact text keys, review unmatched records and download the joined data locally.
CSV Filter
Filter CSV rows, select output columns and download a focused table without uploads.
CSV Transpose
Turn CSV rows into columns with an explicit header choice and exact text values, without uploads.
CSV to Excel Converter
Create a safe XLSX with encoding detection, typed columns, protected IDs and an optional audit sheet.