Reshape

Convert wide pivot tables to long format by stacking columns into rows

Convert wide-format pivot tables to long format by stacking multiple columns into variable/value pairs.

🛡️ Your rows never leave your browser.
Why Onfyt: Auto-detects which columns are likely ID columns (low cardinality, stable values) vs value columns (numeric) to suggest unpivot configuration.

Interactive Sample Data

regionQ1Q2Q3Q4
Nairobi4500520048006100
Mombasa3200380035004200

How this tool works

Unpivoting (melting) transforms a wide pivot table—where each column represents a category value—into a long tidy format where each row represents one observation. Long format is required by most BI tools (Tableau, Power BI), statistical packages (R ggplot2, pandas), and tidy data conventions. The operation takes ID columns (kept as-is, e.g., 'region') and value columns (stacked, e.g., Q1, Q2, Q3, Q4) and produces a new CSV with the ID columns, a 'variable' column (holding the old column name), and a 'value' column (holding the cell value). Wide tabular layouts—where separate columns represent time periods (e.g. Jan, Feb, Mar)—are easy for humans to read but cannot be ingested into relational databases or analytics BI tools that require tidy long-form tables. Unpivoting melts column headers into key-value pairs across rows. DataFix melts wide datasets into standardized long format with customizable attribute and value column names, running entirely in browser memory. Melting wide summary tables into normalized long format transforms horizontal period columns into vertical key-value pairs, unlocking full relational database compatibility. Melting wide matrix layouts into normalized key-value records transforms horizontal time periods into tidy rows. Long-form tabular data integrates seamlessly with modern relational warehouses and BI visualizers. Automatic type inference retains original numeric and date formats across melted attribute columns, avoiding accidental string conversions during reshaping. Retaining static dimension columns ensures that key metadata remains attached to each melted attribute-value pair.

Things that usually go wrong

  • Forgetting to include all ID columns produces duplicate rows that look like the same observation.
  • Unpivoting non-numeric columns is valid but may produce unexpected results in subsequent analysis.

Edge cases we tested

🧪 Blank cells in value columns

Blank values result in rows with empty value column; optionally dropped.

🧪 Columns with mixed numeric and string values

All stacked as strings in value column; type preserved from source.

Frequently Asked Questions

When would I unpivot?

When a wide report (months as columns: Jan, Feb, Mar) needs to be converted to a long timeseries (one row per month) for a BI tool or database.

Is this the same as Excel's 'Unpivot Columns' in Power Query?

Yes — this tool does exactly the same transformation.

Related tools

Reshape

Transpose CSV

Flip a CSV matrix by turning rows into columns and columns into rows.

Open Tool →
Reshape

Pivot a CSV

Summarise long-format CSV data into pivot tables grouped by row and column keys.

Open Tool →
Reshape

Group By and Count

Aggregate CSV rows by one or more group-by columns with count, sum, mean, min, or max.

Open Tool →