Short answer
IPv4 (Internet Protocol version 4) is the original addressing system of the internet, defined in RFC 791 in 1981. Its addresses are 32 bits long and written as four numbers from 0 to 255 separated by dots, such as 192.0.2.1. That gives about 4.3 billion addresses, which ran out years ago, so most networks now share them through NAT.
How IPv4 addresses are written
An IPv4 address is 32 bits, split into four 8-bit bytes (octets). Each byte is written in decimal, giving the familiar dotted decimal form:
11000000 00000000 00000010 00000001 (binary, 32 bits)
192 0 2 1 (decimal)
192.0.2.1 (dotted decimal)
Because each part is one byte, no number can be larger than 255: 192.168.1.300 is not a valid address. The total space is 232 = 4,294,967,296 addresses, and a sizeable part of that is reserved and never used on the public internet.
From classes to CIDR
Originally the first bits of an address decided its class, and with it the size of the network:
| Class | First byte | Network size |
|---|---|---|
| A | 0–127 | /8, 16.7 million addresses |
| B | 128–191 | /16, 65,536 addresses |
| C | 192–223 | /24, 256 addresses |
| D | 224–239 | Multicast |
| E | 240–255 | Reserved |
Fixed sizes wasted huge numbers of addresses, so in 1993 classes were replaced by CIDR, which allows blocks of any size written as address/prefix, such as 203.0.113.0/24. The words "class C" still turn up meaning "a /24", but the classes themselves no longer matter. See CIDR notation explained and subnet masks.
Private and special ranges
| Range | Purpose |
|---|---|
| 10.0.0.0/8 | Private networks (RFC 1918) |
| 172.16.0.0/12 | Private networks: 172.16.0.0 to 172.31.255.255 (RFC 1918) |
| 192.168.0.0/16 | Private networks, used by most home routers (RFC 1918) |
| 100.64.0.0/10 | Shared address space for carrier-grade NAT (RFC 6598) |
| 127.0.0.0/8 | Loopback: 127.0.0.1 is "this computer" |
| 169.254.0.0/16 | Link-local, self-assigned when DHCP fails (RFC 3927) |
| 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 | Documentation and examples (RFC 5737) |
| 224.0.0.0/4 | Multicast |
Addresses in these ranges should never appear as a source on the public internet; lookup tools call them bogons, and the API marks them with security.is_bogon.
IPv4 exhaustion
IANA gave out its last free IPv4 blocks to the regional registries in February 2011, and the registries ran through their normal pools between 2011 and 2019. Today new networks receive at most a small block from a waiting list, or buy addresses on a transfer market, where a single address costs tens of US dollars. Large old allocations have been sold and moved between companies and countries, which is one reason geolocation data sometimes lags behind.
NAT and CGNAT
Two techniques keep IPv4 working. Home routers use NAT to put many devices with private addresses behind one public address. Many ISPs, especially mobile operators, add carrier-grade NAT (CGNAT): customers get an address from 100.64.0.0/10, and the ISP shares a pool of public addresses among hundreds or thousands of them. It works, but it makes hosting anything at home difficult and means many people share one address and its reputation. See what is NAT and CGNAT. The long-term fix is IPv6.
See your IPv4 address
What is my IP? shows the address you use to reach this site; if it has dots rather than colons, it is IPv4. From a terminal, curl -4 https://ipinfo.dkly.net/json forces an IPv4 answer. Any address can be checked with the IP lookup, such as 8.8.8.8.
[ FAQ ]
Frequently asked questions
How many IPv4 addresses are there?
There are 2 to the power of 32, which is 4,294,967,296 addresses. Several hundred million of them are reserved for private networks, multicast, loopback and other special uses, so fewer can be used on the public internet.
What are the private IPv4 ranges?
RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private networks. They can be used freely inside any network but are not routed on the public internet.
Has IPv4 really run out?
The free pools have. IANA allocated its last blocks in 2011 and the regional registries have exhausted their normal pools. Addresses are still available by transfer, at a price, and through sharing with NAT.
Is 100.64.x.x a private address?
It is shared address space for carrier-grade NAT (RFC 6598), not one of the RFC 1918 private ranges. If your router shows a WAN address in 100.64.0.0/10, your ISP is putting you behind CGNAT.
Last updated · All articles · API docs