GDPR and IP addresses: what the law actually says
By Parneet9 min read
This is a technical explainer, not legal advice. If you are making decisions that carry regulatory risk, take proper advice from someone qualified in your jurisdiction.
Developers routinely assume IP addresses sit outside data protection rules because they identify a connection rather than a person. Under the GDPR that assumption is wrong more often than it is right, and the reasoning behind why is worth understanding.
The starting point: often personal data
The GDPR defines personal data as information relating to an identified or identifiable natural person. The second word is what catches IP addresses.
The Court of Justice of the European Union addressed this directly in Breyer v Bundesrepublik Deutschland (C-582/14, 2016). The question was whether a dynamic IP address logged by a website operator counted as personal data, given the operator alone could not identify the visitor — only the ISP holds that mapping.
The Court held that it can. The test is not whether you can identify the person, but whether identification is possible using means reasonably likely to be used, including by combining your data with a third party's. Since legal channels exist to compel an ISP to link an address to a subscriber, the address is identifiable in the operator's hands.
The practical upshot: treat IP addresses as personal data by default. There are situations where an address genuinely cannot be linked to anyone, but that is the exception you should have a reason for, not the assumption you start from.
Truncation does not automatically fix it
The common mitigation is to drop part of the address — zeroing the last octet of an IPv4 address, or truncating an IPv6 address to its prefix.
This helps, and it is a genuine data minimisation measure. But it is pseudonymisation, not anonymisation, unless the result really cannot be linked back to an individual by any reasonably likely means. Pseudonymised data is still personal data under the GDPR. Anonymous data is outside it entirely, and the bar for anonymous is high.
Whether truncation crosses that line depends on what else you hold. An address with the last octet removed, sitting beside a session ID and a user agent, is not anonymous in any meaningful sense.
Cookie rules are a separate question
The ePrivacy Directive governs storing or accessing information on a user's device — cookies, local storage, and similar. Reading the source address of an incoming connection is not that; the address arrives as part of the connection, you do not retrieve it from the device.
So server-side IP geolocation generally does not require cookie consent under ePrivacy. That does not exempt it from the GDPR. You still need a lawful basis for the processing, and the usual transparency and retention obligations still apply.
The two regimes are frequently conflated. They are different instruments asking different questions.
Lawful basis
You need one. In practice the realistic candidates are:
Legitimate interests — the common basis for security, fraud prevention, and abuse mitigation. Recital 49 explicitly recognises network and information security as a legitimate interest. It requires a balancing assessment, and it gives the individual a right to object.
Consent — needed where the processing is not something the person would reasonably expect, particularly for advertising or profiling uses.
Legal obligation — where retention is actually mandated.
The basis follows the purpose, and the purposes are not interchangeable. Collecting addresses for security and then using them for ad targeting is a new purpose needing its own basis, not a bonus use of data you already hold.
What tends to be defensible
- Security and abuse prevention. Rate limiting, blocking, fraud signals. Widely accepted under legitimate interests, with proportionate retention.
- Coarse localisation. Country-level defaults for language, currency or tax. Low intrusiveness, obvious benefit, easy to explain.
- Aggregate analytics where addresses are not retained.
What needs more care
- Long retention with no defined purpose. "We keep logs forever" is not a purpose. Storage limitation requires you to say how long and why.
- Building profiles across sessions or sites keyed on the address.
- Combining with other identifiers to re-identify someone you had pseudonymised — this can undo the mitigation you were relying on.
- Precision beyond what the purpose needs. Collecting city-level detail for a country-level decision is a data minimisation problem, and it is also usually inaccurate (see how accurate IP geolocation really is).
Practical steps
- Write down the purpose for every place you log an address. The ones with no answer are the ones to remove.
- Set a retention period per purpose and enforce it automatically.
- Minimise precision. If country is enough, do not store coordinates.
- Say so in the privacy notice — that you process addresses, why, and for how long.
- Be able to honour access and erasure requests for address-linked data, which means knowing where it is.
- Check your processors. If you send addresses to a third-party service, that is a transfer, and it needs the same rigour as any other.
The through-line is that none of this is exotic. Addresses are ordinary personal data and the ordinary obligations apply — purpose, basis, minimisation, retention, transparency.
Lookups here are stateless: an address is processed to answer the request and is not retained as part of a profile. What we do store, and for how long, is set out in the privacy policy. The what your IP reveals piece covers the technical side of what can actually be inferred.