TapCub is live — analytics, insights and live chat, free on one platform
Glossary

Data Normalization: Normal Forms and Feature Scaling

Data normalization means two things: splitting database tables into normal forms and rescaling numbers. One worked example of each, including a nearest-neighbor result that flips after scaling.

Lin Zhou Reviewed by Su He Also called database normalization Last updated Dec 3, 2026 Glossary

Quick answer

Data normalization puts data into a standard form. In databases it means organizing tables into normal forms so each fact is stored once; in statistics and machine learning it means rescaling numbers, for example to a 0–1 range or to z-scores, so variables can be compared.

Formula: Min-max: x′ = (x − min) ÷ (max − min); z-score: x′ = (x − mean) ÷ SD

What is data normalization?

Data normalization means putting data into a standard form so that it can be stored or compared consistently. The phrase names two quite different techniques, and mixing them up wastes a lot of meeting time:

Database normalizationFeature scaling
FieldRelational database designStatistics and machine learning
What changesHow data is split into tablesThe numeric values in a column
GoalStore each fact once, avoid update anomaliesPut variables on comparable scales
Typical stepsFirst, second and third normal formMin-max, z-score, log transform
Information lostNone, if tables can be joined backOriginal units, unless you keep the parameters

If a developer says "this table isn't normalized", they mean the left column. If an analyst says "normalize the features before clustering", they mean the right one.

Database normalization: 1NF, 2NF and 3NF

E. F. Codd introduced the relational model and the idea of a normal form in 1970. Microsoft's description of database normalization puts the aim plainly: organize tables and relationships to protect the data and to eliminate redundancy and inconsistent dependency. Three forms cover most practical design:

Normal formRule in plain wordsViolation to look for
First (1NF)One value per field, no repeating groups, each row identified by a keyA "products" cell holding a list; columns named item1, item2, item3
Second (2NF)Every non-key field depends on the whole key, not part of itIn an order-line table, a product name that depends only on the product ID
Third (3NF)Non-key fields do not depend on other non-key fieldsA customer's city stored on each order, when it depends on the customer

William Kent's widely cited guide compresses the second and third forms into one line: a non-key field must provide a fact about the key, the whole key, and nothing but the key. Higher forms exist, but Microsoft's article calls third normal form the highest level necessary for most applications.

Worked example: normalizing an orders table

Sample data. A shop exports orders like this, with a list in one cell:

order_idorder_datecustomer_idcustomer_cityitems
5001Nov 2C7LeedsP1 Mug × 2 at $9; P2 Notebook × 1 at $5
5002Nov 3C7LeedsP2 Notebook × 3 at $5
5003Nov 3C9HamburgP1 Mug × 1 at $9

Step 1, 1NF. Give each order line its own row. The key becomes (order_id, product_id).

order_idproduct_idorder_datecustomer_idcustomer_cityproduct_nameqtyunit_price
5001P1Nov 2C7LeedsMug29
5001P2Nov 2C7LeedsNotebook15
5002P2Nov 3C7LeedsNotebook35
5003P1Nov 3C9HamburgMug19

Now every cell holds one value, but facts repeat. If customer C7 moves, three rows must change. Miss one and the same customer lives in two cities.

Step 2, 2NF. product_name depends only on product_id; order_date, customer_id and customer_city depend only on order_id. Move each group to its own table.

Step 3, 3NF. customer_city depends on customer_id, which is not the key of the orders table. Move it to a customers table.

TableColumns (key first)Rows
customerscustomer_id, city2
productsproduct_id, name2
ordersorder_id, order_date, customer_id3
order_itemsorder_id + product_id, qty, unit_price4

C7's move is now one update in one row. Note where unit_price stayed: it is the price charged on that line at that time, so it is a fact about the order line, not about the product. A current list price would belong in products. Normalization depends on what each field means, not on which values happen to repeat today.

The check is that joining the four tables returns the four order lines of step 1, with revenue unchanged: 18 + 5 + 15 + 9 = $47.

When to denormalize

Normalized tables are good for writing and for consistency. Analytical queries often read many rows across many joins, so warehouses and reporting layers deliberately copy attributes back into wide or star-shaped tables. Microsoft's article makes the practical point too: many small tables may degrade performance, and it may be more feasible to apply third normal form to the data that changes often.

A usable rule: normalize the system of record, denormalize copies built from it, and make sure the copies are rebuilt rather than edited by hand. Deciding which version of a customer's city an old order should show (then or now) is a modeling choice that normalization forces you to make explicitly.

Feature scaling: min-max and z-score

In the second sense, normalization changes numbers so that a variable measured in dollars does not dominate one measured in sessions. The common methods, with formulas as given in Google's machine learning course:

MethodFormulaResultGood when
Min-max (linear scaling)x′ = (x − min) ÷ (max − min)Range 0 to 1Stable bounds, few outliers
Z-score (standardization)x′ = (x − mean) ÷ standard deviationMean 0, standard deviation 1Roughly bell-shaped values
Log scalingx′ = ln(x)Compresses a long tailHeavily skewed, positive values
Clippingcap values at a thresholdLimits extremesA few outliers distort everything

Libraries use the words loosely. In scikit-learn, StandardScaler computes z-scores, MinMaxScaler does min-max, and the class actually called Normalizer does a third thing: it rescales each row to unit length.

Worked example: scaling two features

Sample data: five accounts described by sessions in 30 days and monthly spend. The means are 10 sessions and $140; the population standard deviations are 4.90 and $181.74.

AccountSessionsSpendSessions min-maxSpend min-maxSessions zSpend z
A4$200.0000.000−1.22−0.66
B6$350.1430.031−0.82−0.58
C10$500.4290.0630.00−0.50
D12$950.5710.1560.41−0.25
E18$5001.0001.0001.631.98

For account B: sessions min-max = (6 − 4) ÷ (18 − 4) = 0.143; z = (6 − 10) ÷ 4.90 = −0.82.

Why it matters. Ask which account is most similar to C, using straight-line distance:

Distance from CRaw valuesMin-maxZ-score
to B15.50.290.82
to D45.00.170.48
NearestBDD

On raw values, dollars swamp sessions, so B looks closest. After scaling, both features count and D is closer. A clustering or nearest-neighbor method would put C in a different group depending on this one preprocessing choice.

The outlier problem. E's $500 squeezes the other four into 0 to 0.16 on spend. Taking logs first and then applying min-max spreads them to 0.00, 0.17, 0.28, 0.48 and 1.00. scikit-learn's documentation recommends robust scalers, which use more robust estimates of center and range, when data has many outliers.

Which method should you use?

  • Comparing people or products on several measures, or using distance-based methods: z-score, or log then z-score for skewed money and counts.
  • Feeding a score that must stay between 0 and 1, with known limits: min-max with those fixed limits, not with whatever today's sample shows.
  • Tree-based models: scaling usually changes little, because splits depend on order.
  • Reporting to people: keep original units and add a rate instead.

That last one is a third everyday meaning, rate normalization. Sample: page A logs 120 errors in 60,000 sessions and page B 90 errors in 30,000. B has fewer errors but a higher rate, 3.0 against 2.0 per 1,000 sessions.

Normalization vs standardization vs data cleaning

TermWhat it doesOrder
Data preparationThe whole path from raw data to analysis-ready dataContains the others
Data cleaningFixes errors, duplicates and inconsistent formatsFirst
Standardization (z-score)One specific scaling methodAfter cleaning
Normalization (scaling)Umbrella term, sometimes meaning min-max onlyAfter cleaning

Scaling a column that still contains test accounts or mixed currencies only makes the errors harder to see. See data cleaning techniques for that first step.

Common normalization mistakes

  • Not saying which meaning you intend. Write "3NF" or "z-score".
  • Fitting the scaler on all the data. Compute min, max, mean and standard deviation on the training set only and reuse them on new data; otherwise information leaks from the test set into the model.
  • Re-fitting every week. A score of 0.4 then means something different each time.
  • Dividing by zero. A constant column has no range and no standard deviation; drop it.
  • Normalizing away history. Overwriting a customer's city loses where past orders shipped; keep the value on the transaction if reports need it.

Where TapCub fits

TapCub is not a database design tool and does not scale features. It helps with the step before scaling: getting consistent inputs out of behavioral data.

  1. Fix one meaning per property. In All-platform analytics › Data › Property dictionary, check each key's type and intake rules, so an amount is not sometimes text.
  2. Pull one row per subject. In All-platform analytics › Behavior › SQL query, a query such as SELECT subject, COUNT(*) AS sessions FROM v_sessions WHERE {filters} GROUP BY subject gives a feature column; download the result as CSV (up to 50,000 rows).
  3. Use rates on dashboards. In All-platform analytics › Behavior › Metrics & SQL, define per-person or ratio metrics so that large and small segments can be compared.
  4. Scale outside. Apply min-max or z-scores in your spreadsheet or code, and store the parameters with the model.

Sources

Was this explanation clear?

We use your answers to fix and expand this page.

Lin Zhou

Product Experience Specialist

Writes about product experience, practical workflows, and growth, turning complex processes into clear steps for everyday decisions.

FAQ

Questions people ask

Short answers to the follow-up questions that come up most.

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

What is the difference between normalization and standardization?

In machine learning, standardization usually means z-scores: subtract the mean and divide by the standard deviation. Normalization often means min-max scaling to 0–1, though some use it for any rescaling. In databases normalization is unrelated: it concerns how data is split into tables.

What are 1NF, 2NF and 3NF?

First normal form means one value per field and no repeating groups. Second normal form means every non-key field depends on the whole key. Third normal form means non-key fields do not depend on other non-key fields. Third normal form is enough for most applications.

Should I normalize data before machine learning?

For methods that use distances or gradient steps, such as nearest neighbors, clustering or regularized regression, scaling usually matters. Tree-based models are much less sensitive. Fit the scaling parameters on training data only and reuse them on new data.

Does database normalization slow queries down?

It can, because reading related facts requires joins and many small tables may cost performance. That is why reporting systems often keep denormalized copies built from a normalized system of record. Measure with your own queries before deciding.

See this number on your own site

Add one script tag for web and apps, and the first reports fill in within minutes.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics