Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
I

ip2location

> 数据库
Open source

IP2Location™ for Java Client and database bin file.

100 stars0 likes1 views
WebsiteGitHub

About

IP2Location™ for Java Client and database bin file.

简体中文 | English

This site or product includes IP2Location LITE data available from http://www.ip2location.com

IP2Location for Java

The repository code is based on ip2location repository.

Example: https://www.renfei.net/kitbox/ip

Download

The update cycle of database bin file is once a month.

Database bin file:

  • Releases

Installing in maven

xml

    net.renfei
    ip2location
    1.2.6

Compared with the official client, I removed the ip2locationweb service and the dependency on other libraries.

Usage

…

Database Fields

Name Type Description
ip_from INT (10) / DECIMAL (39,0) First IP address show netblock.
ip_to INT (10) / DECIMAL (39,0) Last IP address show netblock.
country_code CHAR(2) Two-character country code based on ISO 3166.
country_name VARCHAR(64) Country name based on ISO 3166.
region_name VARCHAR(128) Region or state name.
city_name VARCHAR(128) City name.
latitude DOUBLE City latitude. Default to capital city latitude if city is unknown.
longitude DOUBLE City longitude. Default to capital city longitude if city is unknown.
zip_code VARCHAR(30) ZIP/Postal code.
time_zone VARCHAR(8) UTC time zone (with DST supported).

IPTOOLS CLASS

Methods

Below are the methods supported in this class.

Method Name Description
public boolean IsIPv4(String IPAddress) Returns true if string contains an IPv4 address. Otherwise false.
public boolean IsIPv6(String IPAddress) Returns true if string contains an IPv6 address. Otherwise false.
public BigInteger IPv4ToDecimal(String IPAddress) Returns the IP number for an IPv4 address.
public BigInteger IPv6ToDecimal(String IPAddress) Returns the IP number for an IPv6 address.
public String DecimalToIPv4(BigInteger IPNum) Returns the IPv4 address for the supplied IP number.
public String DecimalToIPv6(BigInteger IPNum) Returns the IPv6 address for the supplied IP number.
public String CompressIPv6(String IPAddress) Returns the IPv6 address in compressed form.
public String ExpandIPv6(String IPAddress) Returns the IPv6 address in expanded form.
public List IPv4ToCIDR(String IPFrom, String IPTo) Returns a list of CIDR from the supplied IPv4 range.
public List IPv6ToCIDR(String IPFrom, String IPTo) Returns a list of CIDR from the supplied IPv6 range.
public String[] CIDRToIPv4(String CIDR) Returns the IPv4 range from the supplied CIDR.
public String[] CIDRToIPv6(String CIDR) Returns the IPv6 range from the supplied CIDR.

Usage

…

Mirror

  • https://github.com/renfei/ip2location
  • https://gitlab.com/renfei/ip2location
  • https://jihulab.com/renfei/ip2location
  • https://gitee.com/rnf/ip2location

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Javaip2locationip2location-bin-databaseip2location-bin-databasesip2location-database

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库