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

Is an IP address personal data? IP anonymization explained

An IP address is personal data when someone can reasonably link it to a person. What IP anonymization (truncation) leaves behind, why a truncated or hashed address is not automatically anonymous, and how TapCub handles the address.

Lucas Hayes Reviewed by Chen Yu Also called IP truncation Last updated Nov 17, 2026 Glossary

Quick answer

IP anonymization (IP truncation or masking) zeroes the last part of an IP address, such as the final byte of IPv4 or the last 80 bits of IPv6, before it is stored or looked up. It lowers precision. Whether the result is still personal data depends on what else can identify the person.

Is an IP address personal data?

Often yes, in EU and UK law, but the answer is a test rather than a label. The GDPR defines personal data as information relating to an identified or identifiable person and lists an "online identifier" among the ways to identify one (Article 4(1)). Recital 30 names internet protocol addresses as an example of such identifiers. Recital 26 then sets the test: look at all the means reasonably likely to be used to identify the person, taking into account the cost and time involved.

The Court of Justice applied that test in Breyer (C-582/14, 19 October 2016). A website operator stored the dynamic IP addresses of its visitors. The Court held that a dynamic address is personal data for that operator when the operator has legal means to identify the visitor with additional data that the internet provider holds about that person. In short, an address is personal data when someone can reasonably link it to a human, and the internet provider's subscriber records are one such link.

This page explains the technique and cites the texts. It is not legal advice; whether your own data counts as personal data is a question for your data protection officer or counsel.

What IP anonymization means

IP anonymization, also called IP truncation or IP masking, sets the last part of an IP address to zero before the address is stored or used further. An IPv4 address has four bytes, so the usual setting zeroes the last one or two. An IPv6 address is cut to a prefix, such as the first 64, 56 or 48 bits.

Google's legacy Universal Analytics documentation is a clear public example: with its IP masking option on, the last octet of an IPv4 address is set to zero (12.214.31.144 becomes 12.214.31.0) and the last 80 of the 128 bits of an IPv6 address are zeroed, in memory, before anything is written to disk.

The name is generous. What the technique does is reduce precision, and the result is a coarser address. Whether that coarser address still points at a person is a separate question, covered below. For the general idea of making data non-identifiable, see anonymization; for the weaker, reversible-with-extra-information version, see pseudonymization.

Worked example: what truncation leaves behind

Sample data: one visitor with the documentation-range addresses 203.0.113.42 (IPv4) and 2001:db8:4a2b:7c10:a1b2:c3d4:e5f6:1 (IPv6). The second column is the address that remains; the third counts how many addresses share that truncated value.

SettingAddress keptAddresses that look the same
IPv4, no truncation203.0.113.421
IPv4, last 1 byte zeroed203.0.113.02^8 = 256
IPv4, last 2 bytes zeroed203.0.0.02^16 = 65,536
IPv6, no truncation2001:db8:4a2b:7c10:a1b2:c3d4:e5f6:11
IPv6, keep /642001:db8:4a2b:7c10::2^64 (about 1.8 × 10^19), one subnet
IPv6, keep /562001:db8:4a2b:7c00::256 subnets of /64
IPv6, keep /482001:db8:4a2b::65,536 subnets of /64

Each step multiplies the crowd by 256 for IPv4, but a bigger crowd only helps if real people fill it. A block of 256 addresses on a university network may hold hundreds of active users. A block on a small regional provider may hold three subscribers.

When a truncated address still singles someone out

Sample data: a small site logs 30 visitors in one week, and truncating the last byte puts them into 12 blocks of the same size. Six blocks contain exactly one visitor, two contain two, and the other four contain 3, 4, 5 and 8.

  • Visitors who are alone in their block: 6 of 30 = 20%.
  • Visitors in a block of two or fewer: 10 of 30 = 33%.
  • Visitors in a block of five or more: 13 of 30 = 43%.

Within this log, one visitor in five is still the only person from their block. Add the browser, language and time of each row and more rows can be told apart. The Article 29 Working Party's Opinion 05/2014 on anonymisation techniques (WP216) names three questions for any technique: can you still single a person out, link two records about the same person, or infer information about them? Zeroing one byte answers "yes" to at least the first for part of this log, so the result is a lower-risk address, not an anonymous one.

Truncation, hashing and anonymisation compared

TechniqueWhat it doesWhy it is not automatically anonymous
TruncationCoarsens the address (table above)Small blocks, plus other fields in the same row, can still single a person out
Plain hash of the addressReplaces the address with a fixed-length stringIPv4 has only 2^32 = 4,294,967,296 possible values, so anyone can hash all of them and look yours up; WP216 warns about replaying a hash over a known input range
Keyed hash, key kept apartOutput cannot be recomputed without the secret keyStill pseudonymisation (Article 4(5)): the same input always gives the same ID while the key lives, so the ID links a visitor's records
Keyed hash with the key or salt deleted on a scheduleYesterday's IDs cannot be linked to today'sLinkability across days is gone; within a day the ID still singles out a visitor
Aggregation (counts only)Keeps totals, drops rowsSmall counts can still reveal individuals; the row-level data is the part that is gone

WP216 states plainly that pseudonymisation is not a method of anonymisation. It is a useful security measure that reduces how easily a dataset links to an identity.

Common misunderstandings

  • "Zeroing the last byte makes it anonymous." It makes it coarser. The sections above show why a coarser address can still point to one person in a small log.
  • "A hashed IP is anonymous." A plain hash of an IPv4 address can be reversed by trying every address. A keyed hash is stronger but still a stable pseudonym while the key is kept.
  • "A changing address is not personal data." Breyer concerned dynamic addresses specifically, and found them personal data for an operator with a legal route to the provider's records.
  • "If we do not store the IP, nothing is personal." The address is only one input. A visitor ID derived from it, a user ID or a device ID can each be personal data.
  • "Truncation ruins location data." It blurs the city and region. Whether the country stays accurate depends on the tool; TapCub reads the country from the full address before truncating.
  • "A regulator's condition is a legal definition." France's CNIL lists truncating the last byte of the IP address among the conditions for its consent exemption for audience measurement. That is one condition in a list, not a ruling that truncated addresses are anonymous.

IP addresses in TapCub

Suppose you run a site with visitors in the EU and the UK and want the address handled as lightly as possible. In TapCub it goes like this:

  1. The address is never written on the event. The collector reads it to look up the country and city, and to build the visitor ID, then discards it. Rate-limit keys use a truncated or keyed form of the address, not the address itself.
  2. Truncation is off by default. In Configuration › Privacy center you can zero 1 or 2 bytes of IPv4 and keep a /64, /56 or /48 prefix of IPv6, for the whole project or per region. Truncation changes only the address used for the city lookup. Country is always taken from the full address.
  3. Let the center suggest it. When the last 30 days include EU or UK visitors, the privacy center suggests turning truncation on for those regions only, and leaves other regions unchanged.
  4. Know what it does not change. The visitor ID is a keyed hash of the address, the browser and a site salt. Truncation does not alter it, and the ID stays a pseudonym. In the default balanced mode the salt is kept per site, so returning visitors can be recognised across days. In strict mode the salt is replaced daily, so yesterday's ID cannot be linked to today's.
  5. Use the preset if you follow the CNIL exemption. The CNIL preset forces at least 2 bytes for IPv4 and a /64 prefix for IPv6, and region rules cannot loosen it.

You can watch each step with the IP anonymization demo, which runs the same steps in your browser. For retention and the other privacy settings, see how IP truncation and retention work. TapCub does not tell you whether truncated data counts as personal data for your situation; it only changes what is collected, and that judgement stays with you.

Sources

Was this explanation clear?

We use your answers to fix and expand this page.

Lucas Hayes

Data Engineer

Writes about event design, data quality, and collection workflows, with verifiable implementation methods for reliable analytics.

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.

Is an IP address personal data?

Under the GDPR it is an online identifier and counts as personal data when the person is identifiable by means reasonably likely to be used. In Breyer (2016) the EU Court of Justice held that a dynamic address was personal data for a site operator with legal means to obtain the provider's data. This is not legal advice.

Does truncating an IP address make it anonymous?

Not by itself. Truncation makes the address coarser, but a small block, or the browser and time in the same row, can still single a person out. Anonymous data must resist singling out, linking and inference, so check the whole record, not just the address.

Is a hashed IP address anonymous?

No. IPv4 has only 4,294,967,296 possible addresses, so a plain hash can be reversed by hashing all of them. A keyed hash is stronger but still a stable pseudonym while the key exists, and pseudonymised data is still personal data.

What is the difference between IP anonymization and IP masking?

They usually describe the same technique: zeroing part of the address. Google calls its option IP masking. Anonymization names the intent; what you have after the step is a coarser address, not automatically anonymous data.

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