Synthetic data vs anonymization: which actually protects privacy?
4 min read
Anonymization protects privacy by masking the identifying parts of real records; synthetic data protects it by generating new, artificial records that mimic the statistics of the real ones. Both can work — but synthetic data is only as private as the model that produced it, and that model can memorise and leak real individuals, whereas masking a record is a direct, auditable transformation you can verify field by field. For many practical jobs — sharing a document, prompting an AI, preparing a dataset — anonymization is the more transparent and checkable choice.
TL;DR
- Anonymization = transform real data (mask/generalise) so individuals can’t be identified.
- Synthetic data = generate fake data from a model trained on real data, keeping the aggregate patterns.
- Synthetic data can leak via memorisation and membership-inference attacks — it is not automatically anonymous.
- Anonymization is verifiable per record; synthetic-data privacy is a statistical property of the generator.
- Under GDPR, neither is automatically out of scope — both must actually prevent re-identification (Recital 26).
How each one works
Anonymization starts from your real records and removes or generalises the identifying parts: mask the name and national ID, coarsen the birth date, group rare categories. The row still corresponds to a real event — you’ve just made the person unidentifiable. (See anonymization vs pseudonymization.)
Synthetic data trains a generative model on the real dataset, then samples brand-new rows from it. No synthetic row is any specific real person; the goal is to preserve distributions and correlations so downstream analysis or model training still works.
Where synthetic data leaks
The appealing pitch — “no real people, so no privacy risk” — is not automatically true. The privacy of synthetic data lives entirely in the generator, and generators can betray their training data:
- Memorisation: an over-fit model can reproduce real records almost verbatim, especially outliers.
- Membership inference: an attacker can often tell whether a specific real person was in the training set.
- Outlier exposure: rare, extreme individuals (the highest earner, the one rare diagnosis) are the hardest to hide and the easiest to leak.
So “synthetic” is a claim about a process, not a guarantee. Without formal privacy bounds (e.g. differential privacy) and testing, a synthetic dataset can still relate to identifiable people — which keeps it inside GDPR.
Synthetic data vs anonymization — comparison
| Anonymization | Synthetic data | |
|---|---|---|
| Source rows | Real, transformed | Newly generated |
| Privacy comes from | Removing identifiers | The generator’s design |
| Verifiable per record? | Yes — inspect each field | No — it’s a statistical property |
| Main leak risk | Re-identification via quasi-identifiers | Memorisation / membership inference |
| Preserves exact real events? | Yes (masked) | No (approximated) |
| Effort to produce | Low–moderate | High (train + validate a model) |
| GDPR status | Out of scope if irreversible | Out of scope if truly non-identifying |
When to use which
Reach for anonymization when:
- You need the actual document or record, just without the identities (contracts, tickets, AI prompts).
- You want a transformation you can audit and prove field by field.
- You need results now, without training and validating a generative model.
Consider synthetic data when:
- You need a large, shareable dataset that preserves statistical structure but no real rows.
- You can invest in generating and privacy-testing the model properly.
- Exact real values don’t matter — only the distribution does.
The two aren’t mutually exclusive: a common robust pattern is to anonymize first, then generate synthetic data from the masked set, so the generator never sees raw identifiers.
FAQ
Is synthetic data automatically anonymous under GDPR? No. If the generator can leak or memorise real individuals, the output may still relate to identifiable people and stay in scope (Recital 26). It must be tested, not assumed.
Is anonymized data safer than synthetic data? Neither is “safer” in the abstract — but anonymization is more verifiable, because you can inspect each masked field, whereas synthetic-data privacy depends on the generator’s properties.
Can you combine them? Yes. Anonymizing before training the generator means it never learns raw identifiers, reducing leakage risk.
What is membership inference? An attack that determines whether a specific real record was part of the training data — a key way synthetic data can leak.
Which is cheaper? Anonymization is usually far quicker to apply. Synthetic data requires building, validating, and privacy-testing a model.
Amaze anonymizes real documents and datasets by masking names (including Polish inflected forms), PESEL, NIP, REGON, KRS, emails, phones and IBANs — a direct, auditable transformation performed entirely on your own machine. See how it works.
Part of our complete guide to data anonymization.