IP Address Calculator
Convert an IPv4 address between dotted, decimal, hex, octal and binary notation, and turn an IP range into the smallest list of CIDR blocks.
Examples: 192.168.1.1 · 3232235777 · 0xC0A80101 · 10.0.0.0 - 10.0.3.255 · 172.16.0.0/20
- Dotted decimal
- Decimal
- Hexadecimal
- Binary
- Octal
- Class
- Type
- First address
- Last address
- Number of addresses
Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.
How to use the IP Address Calculator
- 1 Enter an IPv4 address in any notation, a range such as 10.0.0.0 - 10.0.0.255, or a CIDR block such as 10.0.0.0/22.
- 2 Read the result as you type: all notations of the address, or the start, end and size of the range.
- 3 For a range, copy the CIDR blocks into your firewall rule or access list.
About the IP Address Calculator
An IPv4 address is a 32-bit number, usually written as four bytes in decimal: 192.168.1.1. The same address is 3232235777 as a single decimal number, 0xC0A80101 in hexadecimal and 11000000.10101000.00000001.00000001 in binary. The calculator recognises all of these as input and shows every other notation, plus the octal form per byte.
It also shows the historic address class (A for 0–127, B for 128–191, C for 192–223, D for multicast and E for reserved) and the type of address: private (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), shared carrier-grade NAT (100.64.0.0/10), loopback (127.0.0.0/8), link-local (169.254.0.0/16), documentation, multicast, reserved or public.
A range like 10.0.0.5 - 10.0.0.20 is split into the smallest set of CIDR blocks that covers it exactly, which is what firewall rules and access lists usually need: here 10.0.0.5/32, 10.0.0.6/31, 10.0.0.8/29, 10.0.0.16/30 and 10.0.0.20/32. A CIDR block is turned into its first and last address and its number of addresses. Everything is calculated in your browser.
Frequently asked questions
How do I convert an IP address to a decimal number?
Multiply the bytes by 16777216, 65536, 256 and 1 and add them up. 192.168.1.1 = 192 × 16777216 + 168 × 65536 + 1 × 256 + 1 = 3232235777.
Does it support IPv6?
This calculator is for IPv4. For IPv6 networks and prefixes, use the IP subnet calculator.
Are IP address classes still used?
Not for routing: since 1993 networks use CIDR prefixes of any length. The class is shown because older documentation and exams still refer to it.
Why is my range split into several CIDR blocks?
A CIDR block always has a size that is a power of two and starts on a matching boundary. A range that does not fit one block needs several.