Test Data Masking: How to Hide Personal Data in Test Files

The fastest way to get realistic test data is to copy production. It is also the fastest way to put real customers' names, emails and card numbers on a laptop, in a ticket or in a shared drive. Masking is the middle path: keep the shape of the data and remove the people from it.

Open the Test Data Masking

What test data masking is

Test data masking replaces real personal values with fake or altered ones, so a file still behaves like the original (same columns, same formats, same relationships) but no longer identifies a real person. It is different from encryption, which can be reversed with a key (Data Masking can do that too: see how to mask and unmask data with a key), and from deleting a column, which breaks the test.

Four ways to hide a value

  • **Redaction or replacement.** Swap the value for a fixed or random one. Fast, but a column of identical values is useless for tests that need variety.
  • **Partial masking.** Keep part of the value, such as a***@example.com or the last four digits of a card. Good for screens and reports that show a hint.
  • **Consistent masking.** The same input always gives the same output. If the email ada@example.com becomes the same masked value in every file, joins between files still work. This matters when you mask two tables that share a key.
  • **Synthetic data.** Generate new rows that look like real ones. No real person is in the file at all. It is the safest option when you do not need the original values.

What to look for before you mask

Masking only protects the columns you remember to mask. Check these:

  • **Obvious columns:** names, emails, phone numbers, addresses, dates of birth, national ids, card numbers, IP addresses.
  • **Hidden personal data:** free-text columns such as notes, comments and descriptions often contain names and phone numbers.
  • **Combinations:** a date of birth, a postcode and a gender together can point to one person even with the name removed.
  • **Keys:** ids that appear in other systems can link the file back to a real person.

What GDPR expects (in plain words)

This is general information, not legal advice. GDPR does not tell you to use one specific masking method. It asks for appropriate safeguards, including data protection by design and appropriate security of processing, and it names pseudonymisation as one such measure. The important catch is that pseudonymised data can still be personal data if someone could re-identify the people using other information. Masking lowers your risk. It does not automatically take a file out of GDPR. If you need certainty, ask your data protection officer or a lawyer.

How to mask a CSV or Excel file

The Data Masking tool works on a file in your browser:

1. Load your CSV or Excel file.

2. Check the columns it detects as personal, such as emails, phone numbers, names and card numbers. Fix any it missed or got wrong.

3. Pick a masking style for each column. Use consistent masking for ids and emails that must still match across files.

4. Download the safe file and keep the original private.

The file is processed in your browser and is not uploaded. If you do not need real values at all, generate GDPR-safe test data instead.

A short checklist

  • List every column and mark which hold personal data, including free text.
  • Choose a method per column: replace, partially mask, mask consistently or generate.
  • Keep joins working where tests need them.
  • Spot-check the output by reading a few rows.
  • Store the original separately and limit who can open it.

Open the Test Data Masking

Related tool pages

  • GDPR Test Data Generator: GDPR test data without real people: generate synthetic rows that follow the patterns of your own file, in your browser. Not legal advice.
  • Data Masking and Anonymization: Find and hide personal data (emails, phones, names, card numbers) in CSV, JSON or Excel files before sharing. Runs in your browser; nothing is uploaded.
  • Mask Emails in a CSV File: Hide email addresses and phone numbers in a CSV file before you share it. Detects personal columns for you. Free, in your browser.
  • Anonymize CSV Data: Anonymize a CSV before sharing it: hide names, emails, phones and card numbers with the method you choose. Free, in your browser.
  • Mask PII in Excel Files: Find and hide personal data in an Excel file before you share it, such as emails, phone numbers and names. Free, in your browser.
  • Mask Phone Numbers in a CSV: Hide phone numbers in a CSV, Excel or JSON file before you share it. Keep the country code or last digits, or replace with fake numbers. Runs in your browser.

Also try

How to use the Test Data Masking: step by step

  1. Load your CSV or Excel file.
  2. Check the columns detected as personal data and choose a masking style for each.
  3. Download the masked file and keep the original private.

When to use the Test Data Masking

  • Share a file with a vendor or contractor
  • Fill a test or staging environment
  • Attach a sample to a bug report
  • Teach with real-looking data

Example

Input: production customers.csv

Output: test-safe customers.csv

Frequently asked questions

What is test data masking?

Replacing real personal values in a file with fake or altered ones, so the file still looks and behaves like the original but no longer identifies real people.

Is masked data still personal data under GDPR?

It can be. Pseudonymised data is still personal data if someone could re-identify people using other information. Masking reduces risk but does not automatically remove a file from GDPR. This is general information, not legal advice.

How is masking different from encryption?

Encryption can be reversed with a key. Masking replaces the value, so the original is not in the file. For test data, masking or synthetic data is usually the better fit.

Will masked data still work for joins between files?

Yes, if you use consistent masking. The same input gives the same masked output in every file, so keys still match.

Is my file uploaded when I mask it?

No. The Data Masking tool processes your file in your browser.

Tip: Read the free-text columns. A notes column is where real names and phone numbers hide most often.