Unpivot and Reshape Data Tool

Reshape a spreadsheet the way charts, pivot tables and databases need it: wide to long, long to wide, transpose, explode lists and fill blanks, with a preview after every step.

Runs in your browser. Your files never leave your device. See how to check

…

How to do it

  1. 1
    Load data

    Open a CSV or Excel file, paste cells, or press Load sample.

  2. 2
    Add a step

    Press one of the + buttons, such as Wide to long (unpivot).

  3. 3
    Set it up

    Tick identifier columns, choose value columns and name the new headers.

  4. 4
    Chain steps

    Add Fill down, Split cells into rows, Transpose or Long to wide as needed.

  5. 5
    Check each stage

    Tap a step to preview the table after it.

  6. 6
    Export

    Press Result CSV or Excel, and Save steps to reuse the recipe.

About this tool

Spreadsheets made for reading are usually wide: one row per product with a column for every month. Tools made for analysis want them long: one row per product and month with a single value column. Pivot tables, charting libraries, Power BI, databases and statistics packages all prefer the long shape, while reports and printouts prefer the wide one, so the same data often has to change shape several times. Excel can unpivot through Power Query and Google Sheets needs a fiddly formula. This tool does it in a few clicks. Load a CSV, TSV, JSON or Excel sheet, or paste cells, and add steps. Each step takes the output of the step before it, so a typical clean-up such as filling down a region label and then turning twelve month columns into rows becomes a short recipe that you can save as a file and run again next month on a fresh export.

The five steps

Wide to long (unpivot) keeps the identifier columns you tick and turns every other column, or only the ones you tick, into two columns: one holding the old column header and one holding the value. You name both new columns, and blank values can be skipped so empty months do not become empty rows. Long to wide (pivot) does the opposite: choose the identifier columns, the column whose values become new headers and the value column. When several rows land in the same cell, choose how to combine them: sum, average, count, minimum, maximum, first, last or join with commas. The step reports how many cells had duplicates so nothing is combined silently, and empty cells can be filled with a value such as 0. Transpose swaps rows and columns. Split cells into rows turns a cell like red; blue; green into three rows, copying the other columns, using a comma, semicolon, pipe, slash, space or line break as separator. Fill down repeats the last value above into blank cells of the columns you choose, which repairs reports where a group label is only written once.

Working with steps

Tap a step to edit it and to see the table exactly as it looks after that step; tap Source to see the original. Steps can be moved up, removed, and every change can be undone. Steps refer to columns by header name, so a saved recipe still works when next month's file has its columns in a different order. Save steps writes the recipe as JSON and Load steps reads it back.

Export

Result CSV and Excel always use the output of the last step. The Excel file also contains the untouched source on a second sheet for reference.

Limits

The tool reshapes values only and does not carry over cell formatting or formulas. Pivoting with sum, average, minimum or maximum ignores cells that are not numbers. Very wide unpivots of large files multiply row counts quickly: 50,000 rows with 24 value columns become up to 1.2 million rows, which can be slow on a phone and too big for older Excel versions.

Worked example

A sales sheet has Region, Product and four month columns, with the region written only on the first of its two rows. Step 1 fills down Region. Step 2 unpivots Jan to Apr with Region and Product kept, naming the new columns Month and Units and skipping blanks. The 4 rows by 4 months give 16 cells, two of which are empty, so the long table has 14 rows such as South, Desk, Mar, 11. Adding a pivot step with Month as headers, Units as values and sum, with empty cells filled with 0, rebuilds the wide table with 0 where a month was blank.

Quick facts

Frequently asked questions

What does unpivot mean?

Turning several columns into rows: each former column header becomes a value in a new column, next to its number.

When do I need long data?

For pivot tables, most charting tools, databases and statistics software, which all expect one observation per row.

What happens to duplicate rows when I pivot?

They are combined with the method you choose, and the step tells you how many cells were affected.

Can I reuse the same steps every month?

Yes. Save steps writes them to a file, and they are also remembered in this browser.

My report only shows the group name once. Can I fix that?

Add a Fill down step for that column before unpivoting.

Is my file uploaded?

No. Every step runs in the browser.

Guides for this tool

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages