IP to Country database Free download
Our free IP to Country database provides accurate country-level geolocation for any IP address. It's updated daily and uses the same high-quality data that powers our production API, ensuring you get reliable results.
Unlike many competing free databases that offer reduced accuracy, our free data comes from the same source as our premium products. This makes it a perfect drop-in replacement for GeoLite or other free alternatives, giving you better data without the cost.
Data fields
The IP to Country database includes the following data fields for each IP network range.
Example
Look up an IP address using the MMDB database
Here's how to perform a local lookup using our MMDB database file with Node.js.
get_country_from_ip_address.js
import fs from 'fs';
import * as mmdb from 'mmdb-lib'; // npm install mmdb-lib
const db = fs.readFileSync('/path/to/ip-to-country.mmdb');
const reader = new mmdb.Reader(db);
console.log(reader.get('8.8.8.8'));
// {
// continent_code: 'NA',
// country_code: 'US',
// country_name: 'United States',
// network: '8.8.0.0/17'
// }
console.log(reader.getWithPrefixLength('8.8.8.8'));
// [
// {
// continent_code: 'NA',
// country_code: 'US',
// country_name: 'United States',
// network: '8.8.0.0/17'
// },
// 17
// ]
Free database comparison
Our free databases offer a powerful, no-cost alternative to other providers. Here's how we stack up: