K-anonymity
Intermediate
What you need first. Nothing else on this path comes first. This page is part of Applications.
In privacy, k-anonymity is a requirement that every combination of quasi-identifiers in a released table appears at least k times. A hospital or a bank holds a table of person-specific records and wants to give researchers a copy. Deleting the name does not finish the job. A row that still carries a birth date, a ZIP code, and a sex can match one person on a public voter list, and the medical or financial fact travels with the match. K-anonymity is a requirement on the released table: every pattern of those linking fields appears often enough that the match is a group. [1]
K-anonymity
| Fact | Value |
|---|---|
| Topic | Applications |
| Listed on | Applications |
| Worked example | 1 |
Motivating example
States collect hospital records that include ZIP code, birth date, sex, and ethnicity. A voter list carries name, address, ZIP code, birth date, and gender. The two files share the ZIP code, the birth date, and the sex. Linking on those fields attaches a diagnosis to a named person even though the hospital file never contained the name. The holder needs a release in which that link does not single anyone out, and in which the diagnoses are still useful for research. [1]
Intuition
Some fields are not names and still behave like names when they are combined. A birth date is common. A birth date together with a 5-digit ZIP code and a sex is often unique. Those fields are the quasi-identifier: the columns an outsider might already know from another source. Sweeney records the term as Dalenius’s. K-anonymity does not hide the quasi-identifier. It forces every pattern of it that is published to be shared by at least rows, so the outsider’s match is a group of size at least rather than a single person. [1]
Definition
Let be a table with one row per person, and let be the quasi-identifier associated with it. The table satisfies -anonymity if and only if every sequence of values in the projection onto appears at least times in that projection. Equivalently, the information in the release about any one person cannot be distinguished, on the quasi-identifier, from at least other people whose rows appear as well. Each row is assumed to describe one person, and no person appears twice. [1]
The usual ways of producing such a table are generalisation and suppression. A ZIP code becomes . A rare combination that still appears once can be dropped. The diagnosis, or whatever the analysis needs, is left intact inside the group. How far to generalise is the trade against usefulness. The systems Datafly, -Argus, and -Similar were built to enforce the frequency requirement. [1]
Statistical use
Before a microdata file is shared, the holder marks the quasi-identifier, chooses , and coarsens or suppresses until the frequency test passes. Analyses that need only coarse geography and age bands can proceed on the released file. Analyses that need the exact ZIP code cannot, because that precision was the identifying part. The holder is assumed to know which fields also appear in external information. If that judgment is wrong, and an outsider knows a field that was left out of the quasi-identifier, the frequency test on the declared columns is the wrong test. [1]
Differential privacy is a different standard. Dwork’s formulation asks that participation in the database not increase what can be learned about a person, relative to what could be learned without that participation, and treats the release as a randomised mechanism. K-anonymity certifies a table by counting repeated rows. It does not add random noise, and repeated queries of the same table reveal the same groups. A table can be -anonymous and still move sharply when one person is included, if the sensitive fields inside a group are extreme. The two guarantees answer different questions. [2] [1]
Worked example
Four rows are released with quasi-identifier :
| ZIP | Sex | Diagnosis |
|---|---|---|
| 02138 | F | cold |
| 02138 | F | flu |
| 02138 | F | cold |
| 02139 | M | asthma |
The pair appears three times. The pair appears once. The minimum frequency is 1, so the table is not 2-anonymous. [1]
Your turn. A second row with ZIP and sex M is added. What is the minimum frequency, and does the table satisfy 2-anonymity?
Both pairs now appear at least twice. The minimum frequency is 2, so the table satisfies 2-anonymity.
Common misconceptions
Deleting names is not -anonymity. A table can be free of explicit identifiers and still have unique quasi-identifier rows. The integer is not a probability of re-identification. It is a minimum group size against an outsider who knows the quasi-identifier and nothing else that distinguishes the rows. Sharing a -anonymous file does not license a second file of the same people with a different coarsening, because the two files can be linked. [1]
K-anonymity does not mean the sensitive field is hidden from someone who matches the whole group. If everyone in the group has the same diagnosis, the outsider who knows the quasi-identifier learns the diagnosis without learning which row is which. That homogeneity is a limit of the definition, not a failure of the frequency count. The definition constrains the quasi-identifier columns only. [1]
The four-row release makes the count concrete. The pattern 02138 and F occurs three times, and the pattern 02139 and M occurs once, so the minimum frequency is one and the table fails 2-anonymity. One added row with ZIP 02139 and sex M raises the rare pattern from one row to two, and the minimum becomes two. The diagnosis column is never part of that arithmetic. If the three rows that share 02138 and F had all listed the same illness, an outsider who knew that ZIP code and that sex would learn the illness for every person in the pattern, and the frequency test would still pass once every pattern met the threshold. Generalising both ZIP codes to the coarser value 0213* would put all four rows, or all five after the added row, into a single pattern. The frequency test would then be easy to meet, and the geographic detail that distinguished the two hospitals would be gone. The choice of and the choice of how far to coarsen are the same decision seen from the count and from the usefulness of what remains. [1]
Connections
A statistical disclosure problem is the decision to release records that still support research. K-anonymity is one formal constraint on that release. Differential privacy bounds the change in a randomised analysis when one person is added or removed, which is Dwork’s replacement for a goal that asked the release to teach nothing about a person that could not be learned without the database. Linkage of a medical file to a voter list is the attack Sweeney’s frequency condition is built to block, and it fails open if the quasi-identifier was chosen too narrowly. The policies that accompany the model — which fields count, and what else may be released — are part of the protection. [1] [2]
Check yourself
Try these questions before opening an answer.
Minimum frequency
Three rows share one quasi-identifier pair and one row has a different pair. What is the minimum frequency?
The minimum frequency is 1, so the table is not 2-anonymous.
After one added row
A second row with the rare pair is added. What is the minimum frequency, and is the table 2-anonymous?
The minimum frequency is 2, so the table satisfies 2-anonymity.
See also
Abundance estimation · Actuarial science · Astrostatistics · Biostatistics · Business analytics · Censoring · Chemometrics · Computational biology
References
- ^ a b c d e f g h i j k l a. (p. 557, §1) b. (pp. 557, 563, §1 and Example 2) c. (pp. 563–564, Definition 2 and Definition 3) d. (pp. 562–564, §3 and Definition 3) e. (p. 562, §3) f. (pp. 563–564) g. (Definition 3) h. (Definition 3) i. (pp. 557, 564) j. (Definition 3) k. (pp. 562–564, Definition 3) l. (pp. 557, 562–564) Sweeney, L. (2002). k-Anonymity: A Model for Protecting Privacy. International Journal of Uncertainty, Fuzziness and Knowledge-Based Systems, 10(5), 557–570. https://doi.org/10.1142/S0218488502001648
- ^ a b a. (§1) b. (§1) Dwork, C. (2006). Differential Privacy. In Automata, Languages and Programming, ICALP 2006 (pp. 1–12). Springer. https://doi.org/10.1007/11787006_1
Cite this page
StatWiki (2026). "K-anonymity." StatWiki. Last updated 2 December 2026. https://www.statwiki.io/articles/k-anonymity.html
@misc{statwiki_k_anonymity,
author = {{StatWiki}},
title = {{K-anonymity}},
year = {2026},
url = {https://www.statwiki.io/articles/k-anonymity.html},
urldate = {2026-12-02},
note = {StatWiki, last updated 2 December 2026}
}