IPv4 Address Converter

Convert IPv4 addresses between dotted-quad, integer, hexadecimal, binary, and other formats.

Input format auto-detection — recognizes dotted quad, decimal integer, hexadecimal, binary, and octal.

Dotted Quad
Decimal Integer (32-bit)
Hexadecimal
Octal (by octet)
Binary (by octet)
Binary (32-bit continuous)
IPv4-mapped IPv6
Reverse DNS (PTR)

Special Use IPv4 Ranges

Click an item to load an example address from that range.

What is the IPv4 Address Converter?

Need to convert an IPv4 address for database storage, network analysis, or low-level programming? This tool instantly translates any IPv4 address between its dotted quad, decimal integer, hexadecimal, binary, and other representations. It automatically detects the format you paste—whether it's `192.168.0.1` or `3232235521`—and provides a full breakdown, including IP class, address scope (public, private, etc.), and octet analysis. Since all conversions happen in your browser, no data is sent to a server, ensuring privacy for any IP address you enter.

How to use

  1. Paste a value into the `IPv4 Address · Integer · Hex · Binary` field. The tool automatically recognizes dotted quad, integer, hexadecimal, and binary formats.
  2. As you type, all conversions appear instantly in the `Dotted Quad`, `Decimal Integer (32-bit)`, `Hexadecimal`, and other output fields.
  3. View the `Octet Breakdown` table to see each part of the address in decimal, hexadecimal, octal, and binary.
  4. Check the analysis section for the address's `IP Class`, `Address Scope` (like Private or Public), and `Class Default Mask`.
  5. Click the `Copy` button next to any result to save it to your clipboard for use elsewhere.
  6. In the `Special Use IPv4 Ranges` section, click any entry to load and analyze an example address from that block.

IPv4 Address Converter guide

How this tool is used in real work, and what to watch out for.

Private IP Ranges — The Often-Misunderstood 172 Block

When you enter an address, the tool displays chips like 'Private,' 'Public,' or 'Loopback.' Private ranges are not routed on the public internet, meaning anyone can use them freely within their own internal network.

RangeActual ScopeWhere You'll See It
10.0.0.0/810.0.0.0 to 10.255.255.255Corporate networks, cloud VPCs
172.16.0.0/12172.16.0.0 to 172.31.255.255Docker default bridge (172.17.x.x)
192.168.0.0/16192.168.0.0 to 192.168.255.255Home & small office routers
The 172 private range is from 172.16.0.0 to 172.31.255.255. Addresses like 172.32.0.1 or 172.15.0.1 are not private; they are someone else's public IPs. The /12 prefix is confusing, leading to common firewall rule errors like allowing only `172.16.0.0/16` or blocking the entire `172.0.0.0/8` range. If you're ever unsure, enter the address into this tool and check if the 'Private' chip appears.

CGNAT (100.64.0.0/10) — Why You Can't Trust a User's IP Address

The 100.64.0.0/10 range is a shared space for carriers, neither private nor public. It was created because of IPv4 address exhaustion, allowing carriers to share a single public IP among many subscribers. You'll often get an address from this range on mobile data networks and from some ISPs.

The practical problem is that a single IP address no longer represents a single user. If you block an IP to prevent abuse, you could end up blocking hundreds of innocent users who share the same carrier-grade NAT (CGNAT). Conversely, the assumption that 'same IP means same person' is also false. It's also normal for a user's IP to change frequently in login histories—on mobile networks, a new NAT session can mean a new IP.

  • Use IP-based blocking only for short-term rate limiting, not as the basis for permanent bans.
  • Detect duplicate sign-ups or abuse using accounts, device IDs, or phone verification, not just IP addresses.
  • Port forwarding is impossible behind CGNAT. If you can't access your home server from the outside, check if your IP is in this range first.
  • If you see an address starting with 169.254, it's a self-assigned address from a failed DHCP lookup (APIPA). It's a sign of a network connectivity problem.

Why You Should Store IPs as Integers (Database Best Practices)

`192.168.0.1` is a human-readable notation; its true form is the 32-bit integer `3232235521`. This tool converts between these formats because using integers in a database is overwhelmingly advantageous. Instead of 15 bytes for a `VARCHAR(15)`, you only need 4 bytes. More importantly, range queries can use an index. If you store it as a string, checking if 'this IP belongs to this range' requires a `LIKE` query, which is neither accurate nor fast.

sql
-- Must be UNSIGNED. A regular INT will treat IPs from 128.0.0.0 and up as negative numbers, silently breaking queries.
CREATE TABLE access_log (
  id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  ip INT UNSIGNED NOT NULL,
  ts DATETIME NOT NULL,
  INDEX idx_ip_ts (ip, ts)
);

-- Store / Retrieve
INSERT INTO access_log (ip, ts) VALUES (INET_ATON('192.168.0.1'), NOW());
SELECT INET_NTOA(ip) FROM access_log WHERE id = 1;

-- Range queries can now use the index (e.g., connections within 192.168.0.0/24)
SELECT COUNT(*) FROM access_log
 WHERE ip BETWEEN INET_ATON('192.168.0.0') AND INET_ATON('192.168.0.255');
The maximum value for an `INT UNSIGNED`, 4,294,967,295, is the same as the maximum integer value for an IPv4 address. This isn't a coincidence; it's because both are 32-bit values. It's also why this tool rejects inputs that exceed this value.

The Danger of IP Addresses with Leading Zeros

This tool automatically detects dotted-quad, integer, hexadecimal, binary, and octal formats. This feature is designed to help you convert values like `3232235521` or `0xC0A80001` you might find in logs or code, but it highlights a noteworthy pitfall.

Many systems interpret numbers with a leading zero as octal. Some libraries will read `010.1.1.1` as `10.1.1.1`, while others will read it as `8.1.1.1`. This discrepancy can lead to real security incidents—for example, a validation check might approve an address, thinking 'it's not in the 10.x private range,' while the actual request goes to a completely different destination. This ambiguity has been exploited to bypass Server-Side Request Forgery (SSRF) defenses, and vulnerabilities have been reported in widely-used IP parsing libraries because of it.

When validating an IP string from a user, always normalize it to a single, canonical format before making decisions. Judging the string as-is based on its first few characters can leave you vulnerable to base interpretation differences.

On PTR Records and IP Classes

The `in-addr.arpa` address shown in the results is the name used for Reverse DNS (PTR) lookups. The rule is to reverse the octets, which can be confusing. This tool does the reversal for you. A common place where this becomes critical is when running your own mail server. If the sending IP has no PTR record, or if it doesn't match the domain, receiving servers may flag your mail as spam or reject it outright. If your mail isn't getting through even with correct SPF and DKIM, check your PTR record. PTR records must be set by the entity that allocated the IP address (your hosting provider or ISP).

The Class A/B/C display is a historical concept. Since the introduction of Classless Inter-Domain Routing (CIDR) in 1993, routing decisions have been based on prefix length, not class. We show it for reference as it still appears in old documentation and certification exams, but the assumption that 'this is a Class C address, therefore it's a /24' is no longer valid on modern networks.

bash
# PTR lookup — verify the name generated by this tool
dig -x 8.8.8.8 +short
nslookup 8.8.8.8

Frequently asked questions

What's the benefit of storing an IP address as an integer?

Storing an IP as a 32-bit integer is more efficient than a string. It uses a fixed 4 bytes and makes sorting or range checks (e.g., for firewalls) much faster.

Is it safe to enter my IP addresses here?

Yes. This tool is 100% private. All calculations run in your browser; no IP addresses or other data are ever sent to our servers. It's safe for internal IPs.

What's the difference between a public and private IP?

Public IPs are unique on the internet. Private IPs (like `192.168.x.x`) are for internal networks. This tool automatically identifies if an address is public, private, or loopback.

Which formats can the tool automatically detect?

It recognizes most common IPv4 formats, including dotted quad, 32-bit integer, hexadecimal (with or without `0x`), octal, and binary. It also parses IPv4-mapped IPv6 addresses.