PrivacyQuick

Cookies & tracking

Is an IP address personal data?

In most website situations, yes. Under the GDPR an IP address is personal data whenever the visitor can be identified by means reasonably likely to be used, which the CJEU confirmed for dynamic IPs in Breyer, and the CCPA lists IP addresses as an example of personal information.

  • Plain English
  • Written for website owners
  • Free to read

Yes, in most cases an IP address is personal data. Under the GDPR, information is personal data if it relates to a person who can be identified directly or indirectly, using all the means reasonably likely to be used. An IP address can usually be tied to a subscriber by the internet provider, and the EU's top court confirmed in 2016 that this makes even a dynamic IP address personal data for an ordinary website operator. In California, the CCPA names IP addresses as an example of personal information when they can reasonably be linked to a consumer or household.

That has practical consequences. Your web server, CDN, analytics tool, embedded fonts and every third-party script receive visitors' IP addresses. This guide explains the legal position and then shows how to handle IPs sensibly in logs, analytics and your own records.

What the GDPR says about IP addresses

The GDPR defines personal data in Art. 4(1) as any information relating to an identified or identifiable natural person. The definition specifically mentions "an online identifier" as something that can make a person identifiable.

Two recitals fill in the detail:

  • Recital 30 says people may be associated with online identifiers provided by their devices, applications, tools and protocols, and gives internet protocol addresses and cookie identifiers as examples. Combined with other information the server receives, such identifiers can be used to create profiles and identify people.
  • Recital 26 sets the test: to decide whether a person is identifiable, account for all the means reasonably likely to be used, by the controller or by another person, considering cost, time and available technology.

So an IP address isn't personal data because of what it is, but because of what can be done with it. In a normal website context, someone can almost always connect it to a household or a person.

The Breyer judgment (C-582/14)

The leading case is Patrick Breyer v Bundesrepublik Deutschland, decided by the Court of Justice of the EU on 19 October 2016. Mr Breyer challenged the German federal government's practice of logging the IP addresses of visitors to its websites, along with the time and the pages accessed. The government said it kept the logs to defend against attacks and to make criminal prosecution possible.

The question was whether a dynamic IP address, which changes over time and can only be linked to a subscriber using records held by the internet provider, is personal data for the website operator, which doesn't hold those records. The Court said it is, where the operator has legal means to identify the visitor using additional data held by the provider. In Germany, an operator facing a cyberattack could go to the competent authorities, which could obtain the subscriber's identity from the provider. That route was enough.

The Court also decided a second point that matters for site owners. Germany's law only let operators keep usage data for narrow purposes, and the Court said member states can't restrict the legitimate-interests basis in that way. It accepted that an operator may have a legitimate interest in keeping its website working, which can justify some logging after the visit ends.

Breyer was decided under the old Data Protection Directive (95/46/EC), but the GDPR kept the same identifiability test in Recital 26, and regulators continue to rely on it.

Treat IP addresses as personal data by default. The Breyer test is about whether identification is reasonably possible, not whether you actually do it.

Doesn't the 2025 SRB judgment change this?

In September 2025, in EDPS v SRB (C-413/23 P), the CJEU held that pseudonymized data is not necessarily personal data for a recipient who has no reasonable means of re-identifying people. Some commentators read this as a more relative approach to personal data. It doesn't help most websites much. You receive the raw IP address yourself, usually alongside cookies, user agents, account details and timestamps, and the internet provider route described in Breyer is still there. Don't rely on the judgment to treat visitor IPs as anonymous without specific legal advice.

Static, dynamic, IPv6 and shared addresses

Different kinds of IP address carry different levels of risk, but none of them is safe to treat as anonymous by default.

TypeWhat it isIdentifiability
Static IPv4Fixed address assigned to a business or home connectionHigh: stays linked to the same subscriber
Dynamic IPv4Address that changes periodicallyPersonal data under Breyer where legal means exist
Shared IPv4 (CGNAT, offices, mobile)Many users behind one public addressLower on its own, higher combined with timestamp and port or other data
IPv6Long addresses, often one prefix per householdHigh: the prefix often maps to a single connection for a long time
VPN or proxy exitAddress of the VPN providerLower for you, but you rarely know which visitors use one

Because you can't tell from your logs which visitors sit behind a shared address, the practical approach is to handle all IPs the same way.

IP addresses under the CCPA and other laws

The California Consumer Privacy Act defines personal information in Cal. Civ. Code §1798.140(v) as information that identifies, relates to, describes, is reasonably capable of being associated with, or could reasonably be linked with a particular consumer or household. The first listed category, §1798.140(v)(1)(A), includes "Internet Protocol address" among identifiers. The household element matters here, since an IP address often identifies a household rather than one person.

In practice, if you collect IPs and use them, share them with ad partners, or combine them with other data, assume they are personal information. That brings them into your privacy policy disclosures and, where they're sold or shared for cross-context behavioral advertising, into opt-out rights. Other US state privacy laws use similar "linked or reasonably linkable" definitions.

The UK GDPR uses the same definition as the EU GDPR. Many other laws, such as Brazil's LGPD, also define personal data broadly enough to cover online identifiers. Check the specific law where your audience is, but treating IPs as personal data is the safe baseline.

A common mix-up: "IP addresses are personal data, so I need consent to collect them." That isn't how it works.

  • The GDPR requires a lawful basis for processing personal data, and consent is only one of six in Art. 6(1). Keeping IPs in server logs for security and troubleshooting is normally based on legitimate interests under Art. 6(1)(f). Recital 49 names network and information security as a legitimate interest.
  • The ePrivacy rule (Art. 5(3) of the ePrivacy Directive, or PECR regulation 6 in the UK) is what requires consent for cookies. It applies to storing or reading information on the visitor's device. A server receiving the IP address that a request arrives from is part of transmitting the communication, so ordinary logging isn't covered.

There is one nuance. The EDPB's Guidelines 2/2023 on the technical scope of Art. 5(3), adopted in final form in October 2024, say that tracking visitors based on IP address alone can fall within Art. 5(3) where the address originates from the user's device, which they say is the case for IPv6 and many router addresses. So using IPs to track people across pages or sites is a different matter from logging them for security. The guide to browser fingerprinting and consent covers this in more detail.

Where your site handles IP addresses

Every request a browser makes reveals the visitor's IP to the server that receives it. On a typical site that includes:

  • Your web server and hosting logs, often kept by default with the IP, time, URL and user agent.
  • Your CDN, firewall or bot protection, which inspect IPs to block attacks.
  • Analytics tools, which use the IP to estimate location and sometimes to filter bots.
  • Third-party resources: fonts, embedded videos, maps, chat widgets and ad tags all receive the visitor's IP when they load. A German court found in January 2022 that sending visitors' IPs to Google by embedding Google Fonts was unlawful without a valid basis. The Google Fonts guide explains that case and how to self-host.
  • Forms, comments and logins, where software such as WordPress or anti-spam tools may store the IP with the submission.
  • Consent records, if your consent tool logs the IP with each choice.

For analytics specifically, Google says Google Analytics 4 does not log or store IP addresses, although the address is still received with each hit and used for approximate location. That reduces risk, but it doesn't remove the need for consent for GA4's cookies. See GA4 and GDPR for the full setup.

Minimizing IP addresses in practice

The GDPR's data minimization and storage limitation principles (Art. 5(1)(c) and (e)) apply to IPs like any other personal data. Some practical steps:

  1. Set log retention. Decide how long you need full IPs for security, often days or weeks rather than years, and configure rotation to delete older logs. The data retention guide has an example schedule.
  2. Truncate where you can. If you only need rough statistics, mask part of the address before it's written. Here's an nginx example that keeps the first three IPv4 octets or the first two IPv6 groups:
    map $remote_addr $ip_masked {
        ~(?P<ip>\d+\.\d+\.\d+)\.\d+   $ip.0;
        ~(?P<ip>[^:]+:[^:]+):         $ip::;
        default                         0.0.0.0;
    }
    
    log_format masked '$ip_masked - [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_user_agent"';
    
    access_log /var/log/nginx/access.log masked;
    Keep a separate, short-lived security log with full IPs if your firewall or fail2ban setup needs them.
  3. Don't store IPs you don't use. Contact forms, newsletter sign-ups and consent records rarely need them. Check your form plugins and tools for an option to turn IP storage off.
  4. Reduce third-party requests. Self-host fonts and scripts where possible, and load embeds only after consent or on click.
  5. Cover processors with contracts. Hosting, CDN and analytics providers that receive IPs on your behalf need a data processing agreement under Art. 28.

Truncation is useful, but don't call the result anonymous unless you've checked it. A masked IP plus a precise timestamp and user agent can still single someone out.

Some consent tools store the visitor's IP with every banner choice, on the theory that it proves who consented. It usually doesn't prove much, because an IP identifies a connection rather than a person, and it adds personal data you then have to protect and justify. A random consent ID stored in the visitor's browser and in your log, plus the time, the choice and the banner version, is generally enough to show that consent was collected properly. The guide to keeping proof of consent covers what to log.

PrivacyQuick's consent log takes this approach: it records an anonymous consent ID, the action, categories, banner version, language, country and time, and stores no IP addresses or user agents.

Next steps

  • List every place your site receives or stores IP addresses: server, CDN, analytics, forms, plugins, embeds and consent records.
  • Write down the lawful basis and retention period for each, and set log rotation to match.
  • Mask or drop IPs where you don't need them in full.
  • Mention IP addresses, what you use them for and how long you keep them in your privacy policy.
  • Run a free cookie scan to see which third-party hosts receive your visitors' IPs before consent.

Frequently asked questions

Is a dynamic IP address personal data under the GDPR?

It can be, and for a website operator it usually is. In Breyer (C-582/14, 2016) the CJEU held that a dynamic IP address is personal data for a website operator that has legal means to identify the visitor with help from the internet provider, for example through the authorities after a cyberattack.

Is a truncated or masked IP address anonymous?

Not automatically. Removing the last part of an IPv4 address makes identification harder, but combined with a timestamp, user agent or account data it may still single out a person. Treat truncation as minimization and pseudonymization rather than anonymization unless you have assessed it properly.

Do I need consent to log IP addresses in server logs?

Usually not. Logging IPs for security and troubleshooting is normally based on legitimate interests under GDPR Art. 6(1)(f), and receiving an IP as part of a normal request is not storing or reading information on the device. You still need to disclose it in your privacy policy and keep the logs only as long as necessary.

Does Google Analytics 4 store IP addresses?

Google states that GA4 does not log or store IP addresses, though they are still received when the browser sends a hit and are used to derive approximate location. Consent rules for GA4 come from its cookies and identifiers, so you still need consent in the EU and UK.

Check your own website in 30 seconds

Our free scanner lists every cookie and tracker your site sets, sorted into categories, before you add a banner.

Run a free cookie scan Start free

This guide is general information, not legal advice. Laws and regulator guidance change; check the current rules for your situation or ask a lawyer.