✕
CN EN

Table utilities / Long ↔ wide conversion

Your data stays in your browser: files are read and processed on your device, never uploaded to any server, and cleared when you close the page. Free, no sign-in.

How to read it

Long ↔ wide conversion

A wide table has one column per sample (or variable) — easy to read and used by most statistics software; a long table has one observation per row (ID, variable name, value), the layout many plotting tools need (e.g. grouped box plots, facets).

Wide → long: choose the ID column and tick the value columns to gather; unticked columns are carried along on every row.

Long → wide: in the mapping choose the ID column, the names column (whose values become new column names) and the values column; when an ID–name pair occurs several times, keep the first, or take the mean, sum, count or a joined list.

The two conversions are inverses: long → wide followed by wide → long restores the data (row order may differ).

Method

Tidy data: Wickham 2014 (J Stat Softw 59(10)); equivalent to R tidyr pivot_longer / pivot_wider and pandas melt / pivot.

Data size

Up to 500,000 rows; long → wide creates at most 5,000 columns.

Need a full analysis?

Send us your data and research question and you will receive a written plan within 1 working day: analysis steps, parameter rationale, deliverables and timeline. Quoted per project.