Quick answer
Categorical data is data that places each record in a group or label, such as channel, device, country or plan, instead of measuring an amount. You can count and compare groups, but you cannot meaningfully add or average the values themselves.
Formula: Share of group = count of group ÷ total records
What is categorical data?
Categorical data is data that puts each record into a group instead of measuring an amount. Traffic channel, device type, country, plan name, browser and "bought or not" are all categorical: every visitor falls under one label, and the labels are what you count.
The test is simple: does arithmetic on the values make sense? The average of 120 and 150 sessions is 135 sessions, which means something. The average of "mobile" and "desktop" does not exist. If you can count the rows in each group but cannot add, subtract or average the values themselves, the data is categorical. The measurement-scale idea goes back to Stevens (1946), who separated nominal and ordinal scales from interval and ratio ones. This page is about the data itself and how to summarize it; the same idea seen as a column in a table is a categorical variable, and the full set of kinds is in data types.
What are the types of categorical data?
| Type | Rule | Examples | What you can do |
|---|---|---|---|
| Nominal | Labels with no natural order | Channel, device, country, browser | Count, share, mode |
| Ordinal | Labels with a meaningful order but unequal gaps | Satisfaction (1–5), plan tier (Free, Pro, Business), "never / sometimes / often" | Everything above, plus rank, median, percentile of rank |
| Binary | Only two values (a special case) | Bought or not, logged in or not | Count, share (a rate) |
The gap between ordinal levels is not guaranteed to be equal: the step from "satisfied" to "very satisfied" is not necessarily the same size as the step from "neutral" to "satisfied". That is why a median is safe for ordinal data and a mean is only an approximation. See ordinal variable and ordinal data examples.
How is categorical data different from numerical data?
| Categorical | Numerical | |
|---|---|---|
| Values | Labels | Numbers with meaning |
| Typical summary | Counts, shares, mode | Mean, median, spread |
| Typical chart | Bar chart, table | Histogram, line, scatter plot |
| Typical question | Which group is biggest? | How much, how many? |
| Edge case | Age bands ("25–34") are categorical | Exact age is numerical |
The edge case matters: the same fact can be either, depending on how it is recorded. Binning a number into bands loses detail and turns it into a category. A number that is really an ID (a postcode, a product code) is categorical too, even though it looks numeric.
How do you summarize categorical data?
You have three tools: count, share (count ÷ total), and mode (the largest group). You can also compare an outcome rate across groups.
Sample data: 1,000 sessions on a site, with orders placed.
| Device | Sessions | Share of sessions | Orders | Conversion rate |
|---|---|---|---|---|
| Mobile | 560 | 56.0% | 28 | 5.0% |
| Desktop | 380 | 38.0% | 38 | 10.0% |
| Tablet | 60 | 6.0% | 2 | 3.3% |
| Total | 1,000 | all sessions | 68 | 6.8% |
- Count and share. 560 ÷ 1,000 = 56.0% of sessions are mobile. The mode is Mobile.
- Outcome by group. Desktop converts at 38 ÷ 380 = 10.0%, twice the mobile rate of 28 ÷ 560 = 5.0%.
- Read both together. Mobile is the biggest group but converts at half the desktop rate, which is a more useful finding than either column alone.
- Mind small groups. Tablet has 2 orders: one more or less moves its rate by 1.7 points. Do not draw conclusions from 2 events.
What goes wrong when you treat categories as numbers?
Spreadsheets and databases often store categories as codes: Mobile = 1, Desktop = 2, Tablet = 3. The codes are still labels. Averaging them gives (560 × 1 + 380 × 2 + 60 × 3) ÷ 1,000 = 1.5, which says nothing; "between mobile and desktop" is not a device. The same applies to any averaged or summed ID.
The ordinal case is subtler. Averaging a 1–5 satisfaction score is common practice, but it assumes the steps are equal. Report the distribution (share per level) next to any average.
What if a category has too many values?
Cardinality is the number of distinct values. A device column has a handful; a page URL or a search term can have thousands, and each has only a few rows. A bar chart with 500 bars is unreadable, and shares become noise.
Practical rules:
- Show the top 10 and group everything else as "Other", then state how much "Other" holds.
- Merge near-duplicates before counting (utm_source = "Google" and "google"; "/pricing" and "/pricing/").
- Group into a parent level (page → section, city → country).
- For modelling, high-cardinality categories need special encoding; the Google Machine Learning Crash Course covers the common ones.
Which charts and checks suit categorical data?
- Bar chart sorted by size for nominal data; keep the natural order for ordinal data.
- Table with count, share and an outcome rate.
- Avoid pie charts with more than five slices.
- Check that groups are exclusive and complete. Each row should belong to exactly one group; add an explicit "Unknown" rather than dropping blanks.
- Compare shares with counts shown. 50% of 4 and 50% of 4,000 are not equally trustworthy.
Common mistakes with categorical data
- Inconsistent labels. "US", "USA" and "United States" are three groups until you merge them; shares for each look smaller than the truth.
- Dropping blanks. If 8% of sessions have no country, a table that silently leaves them out overstates every other share. Show "Unknown".
- Comparing shares across different bases. Mobile is 56% of sessions but could be 40% of revenue; always say what the percentage is of.
- Reading a rate from a tiny group. Two orders out of 60 is 3.3%, and one more order makes it 5.0%.
- Treating overlapping categories as exclusive. A visitor who used two browsers belongs to two rows, so the shares can add to more than 100%.
How do you look at categorical data in TapCub?
In analytics tools, categories are the dimensions you break numbers down by. Starting from the device example above:
- Open a breakdown. Web analytics › Audience lists browser, operating system, device type and country with visitors, pageviews, bounce, average duration and share per row. Web analytics › Sources does the same for channels and UTM parameters.
- Compare an outcome across groups. Click a row to add it as a filter, then open Web analytics › Goals to see goal conversions for that group only. Real people are counted separately from bots, so crawlers do not inflate a category such as "Desktop".
- Look at your own event properties. All-platform analytics › Data › Events & properties shows counts, unique visitors and share for each event and a breakdown of property values, which is where a category like "plan" or "button label" appears.
- Watch the long tail. All-platform analytics › Data › Data quality has a High cardinality tab that flags properties with too many distinct values, such as a URL stored in a property. In All-platform analytics › Data › Property dictionary, a whitelist of allowed values keeps those values and stores everything else as
__other, which is the "top N plus Other" rule applied at collection time. - Know what TapCub does not do. It counts and shares categories; it does not run chi-square or other significance tests, so judge small groups yourself with the rule of thumb above.
Sources
- Stevens, S. S. (1946). On the Theory of Scales of Measurement. Science, 103(2684), 677–680.
- Google for Developers, Machine Learning Crash Course: Working with categorical data.
Was this explanation clear?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Data Analyst
Explores traffic sources, conversion funnels, and retention, using clear metric definitions and concrete examples to explain what the numbers mean.