IP geolocation delivers reliable country-level accuracy (~99%) but degrades rapidly at city
🌍 Geo Checker — Verify geographic location data for IP addresses in bulk.
🔍 IP Address Lookup — Resolve any IP to its geolocation, ISP, and ASN.
Tools
🚀 Free ToolZilla tools used in this article
All client-side, no signup, no upload — open them in a new tab while you read:
- 🔧 Geo Checker — try it free in your browser.
- 🔧 IP Address Lookup — try it free in your browser.
- 🧰 Browse all 60+ free tools →
Common Mistakes
Cache geolocation results aggressively — IP-to-location mappings change infrequently
Best Practices
- Key compliance points: Under GDPR, an IP address is considered personal data when it can be linked to an individual.
Privacy & GDPR Considerations
💡 Always keep API tokens in environment variables or a secrets manager — never hardcode them
// Fetch geolocation for a given IPA minimal example querying IPinfo's API:
API Example: JavaScript Fetch
4. WebRTC & Timezone Fingerprinting
Browser APIs can reveal the
3. DNS Leak Checks
If a user's DNS queries originate from a different
2. Behavioral Heuristics
Datacenter ASNs rather than residential ISPs,
1. Known IP Lists
Maintain databases of VPN provider IP ranges, public
VPN, Proxy & Tor Detection
| Level | Typical Accuracy | Reliable? | Notes |
|---|---|---|---|
| Country | 95–99% | High | RIR data alone is usually sufficient |
| Region / State | 75–90% | Medium | Depends on ISP allocation granularity |
| City | 50–80% | Medium | Mobile IPs and CGNAT reduce accuracy |
| Postal Code | 20–50% | Low | Often a best-guess centroid |
| Street / Exact | <5% | Very Low | Not feasible from IP alone |
⚠️ Mobile carrier IPs are frequently registered to a central hub city, not the subscriber's actual location. A user in a rural town may geolocate to the nearest metro area.
Provider Comparison
| Provider | Free Tier | Update Frequency | Strengths |
|---|---|---|---|
| MaxMind GeoLite2 | Yes (account required) | Bi-weekly | Industry standard, wide language support |
| IP2Location LITE | Yes | Monthly | Compact binary DB, fast lookups |
| IPinfo | 50k req/month | Daily | Clean API, ASN & privacy detection included |
| DB-IP | Yes (lite) | Monthly | Good city-level accuracy in Europe |
| ipstack | 100 req/month | Real-time | Simple REST API, currency/timezone extras |
VPN, Proxy & Tor Detection
Geolocation becomes unreliable when users route traffic through anonymisation layers. Modern providers flag these with dedicated detection datasets.
1. VPN Detection
Providers maintain lists of IP ranges belonging to known VPN services. Detection rates vary from 70–95%.
2. Open Proxy Detection
Port scanning and honeypot traffic identify open proxies. These IPs are flagged and updated frequently.
3. Tor Exit Nodes
The Tor project publishes its exit relay list. Matching is straightforward but exit IPs rotate often.
4. Residential Proxies
The hardest to detect — real ISP IPs rented through SDK-based networks. Heuristics and traffic pattern analysis are required.
API Example: IP Lookup in JavaScript
// Fetch geolocation data from IPinfo (free tier)
async function lookupIP(ip) {
const token = 'YOUR_TOKEN'; // replace with your IPinfo token
const res = await fetch(`https://ipinfo.io/${ip}?token=${token}`);
if (!res.ok) throw new Error(`Lookup failed: ${res.status}`);
const data = await res.json();
return {
ip: data.ip,
city: data.city,
region: data.region,
country: data.country,
org: data.org,
loc: data.loc, // "lat,lng"
};
}
// Usage
lookupIP('8.8.8.8').then(console.log);
🚀 Pro Tip — Cache geolocation results for at least 24 hours. IP-to-location mappings rarely change more than once a week, and caching reduces API costs dramatically.
Privacy & GDPR Considerations
🔴 Under GDPR, an IP address is classified as personal data. Storing or processing IP geolocation data for EU residents requires a lawful basis (e.g., legitimate interest) and must be disclosed in your privacy policy.
- Minimise data — store country/region only if city-level precision isn't needed
- Anonymise IPs after geolocation (truncate the last octet)
- Honour Do Not Track signals when using geolocation for analytics
- Provide opt-out mechanisms for location-based personalisation
- Document your data processing in Records of Processing Activities (ROPA)
Best Practices
Use multiple providers
Cross-reference two databases for critical decisions like fraud detection or content licensing.
Keep databases updated
IP allocations change constantly. Stale data degrades accuracy within weeks.
Never trust city-level for access control
Use country-level for geo-restrictions; city-level is informational only.
Implement graceful fallbacks
If geolocation fails or returns low confidence, default to a sensible experience rather than blocking the user.
Common Mistakes
- ❌ Assuming city-level geolocation is precise enough for delivery addresses
- ❌ Using geolocation as sole evidence for fraud — false positives are common with mobile and corporate IPs
- ❌ Ignoring CGNAT — millions of users may share one public IP, all geolocating to the ISP's hub
- ❌ Hardcoding geolocation provider responses — APIs change format without warning
- ❌ Not handling IPv6 — many databases have poorer IPv6 coverage
Tools
🌍 IP Address Lookup
Geolocate any IPv4 or IPv6 address instantly — country, city, ISP, and coordinates.
📍 Geo Checker
Verify how your website appears from different geographic locations.
References
- 📄 MaxMind — GeoIP Databases Documentation
- 📄 RIPE NCC — RIPE Database
- 📄 ARIN — Whois-RWS Documentation
- 📄 IPinfo — API Documentation
- 📄 IP2Location — Data Methodology
- 📄 GDPR Article 4 — Definitions (Personal Data)
🎯 Key Takeaway — IP geolocation is powerful for country-level decisions and user personalisation, but its accuracy drops sharply below regional level. Always treat it as an estimate, combine it with other signals for high-stakes decisions, and respect user privacy by minimising data collection and complying with GDPR.
Continue Reading
Related Articles
Free & Private
Explore Our Free Tools
40+ browser-based utilities — fast, private, and always free. No sign-up required.
Browse All Tools
