Differential Privacy Explorer

Experiment with differential privacy mechanisms, visualise the privacy-utility trade-off, and understand how noise protects individual data.

What is Differential Privacy?

Differential privacy is a mathematical framework that provides rigorous, provable privacy guarantees when analysing or sharing data. The core idea: the output of a computation should be essentially the same whether or not any single individual's data is included in the dataset.

This is achieved by adding carefully calibrated random noise to query results. The noise is large enough to mask any individual's contribution, but small enough to preserve the overall statistical patterns in the data.

Pr[M(D) ∈ S] ≤ eε × Pr[M(D') ∈ S]

Where D and D' differ in one record, M is the mechanism, and ε (epsilon) is the privacy budget. A smaller epsilon means stronger privacy but noisier results. Organisations like Apple, Google, and the US Census Bureau use differential privacy to collect useful analytics while protecting individual users.

Laplace Mechanism Simulator

The Laplace mechanism adds noise drawn from a Laplace distribution to numeric query results. Adjust epsilon to see how privacy and accuracy trade off. The dataset contains 200 simulated employee salary records.

1.00
True Answer
Noisy Answer (avg)
Noise Scale (b)
Sensitivity / ε
Privacy Level
True Value
Noisy Results

Randomised Response Simulator

Randomised response is a technique for surveying sensitive topics. Respondents flip a coin — if heads, they answer truthfully; if tails, they flip again and answer "Yes" (heads) or "No" (tails) regardless of the truth. This provides plausible deniability for each individual while allowing estimation of the true proportion from aggregate results.

Survey Question (Sensitive)

"Have you ever used generative AI to complete a work assignment without disclosing it to your supervisor?"

1 Flip a coin (privately)
2 If Heads: Answer the question truthfully
3 If Tails: Flip again. Heads = say "Yes", Tails = say "No" (ignore the truth)
500
35%

Privacy Budget Tracker

Each query on a dataset "spends" some privacy budget (ε). The composition theorem states that running multiple queries accumulates privacy loss. Once the budget is exhausted, no more queries should be allowed. This simulator lets you plan a series of queries and see how quickly your privacy budget is consumed.

5
Total Budget
5.00
Spent
0.00
Remaining
5.00
Status