IP Subnet Calculator for IPv4 CIDR and IPv6
192.168.1.10/24 is in the network 192.168.1.0/24: the broadcast address is 192.168.1.255, the usable hosts run from 192.168.1.1 to 192.168.1.254 (254 hosts), the netmask is 255.255.255.0 and the wildcard mask is 0.0.0.255. Type any IPv4 address with a prefix (192.168.1.10/24) or a dotted mask (192.168.1.10 255.255.255.0) to get the same for your network, plus its binary form, address class and type, and a list of equal subnets. Type an IPv6 address to get its shortest RFC 5952 form, its full form, the prefix range and how many /64 networks it holds.
Updated Runs in your browser: nothing you enter is uploadedHow this tool works
Result
192.168.1.0/24: 256 addresses, 254 usable hosts.
Network
- CIDR notation
- 192.168.1.0/24
- Network address
- 192.168.1.0
- Broadcast address
- 192.168.1.255
- First usable host
- 192.168.1.1
- Last usable host
- 192.168.1.254
- Total addresses
- 256
- Usable hosts
- 254
Masks
- Netmask
- 255.255.255.0
- Wildcard mask
- 0.0.0.255
- Prefix length
- /24
Address type
Private network space, not routed on the public internet.
- Address entered
- 192.168.1.10
- Address class
- Class C (historical, pre-CIDR)
- Address type
- Private (RFC 1918)
Binary
The first 24 bits are the network part (bold); the other 8 are the host part.
- Address
- 11000000.10101000.00000001.00001010
- Netmask
- 11111111.11111111.11111111.00000000
- Network
- 11000000.10101000.00000001.00000000
- Broadcast
- 11000000.10101000.00000001.11111111
4 subnets of /26
Each has 62 usable hosts.
| Subnet | Usable hosts | Broadcast |
|---|---|---|
| 192.168.1.0/26 | 192.168.1.1 to 192.168.1.62 | 192.168.1.63 |
| 192.168.1.64/26 | 192.168.1.65 to 192.168.1.126 | 192.168.1.127 |
| 192.168.1.128/26 | 192.168.1.129 to 192.168.1.190 | 192.168.1.191 |
| 192.168.1.192/26 | 192.168.1.193 to 192.168.1.254 | 192.168.1.255 |
IPv4 prefix lengths, masks and host counts
| Prefix | Netmask | Wildcard | Total addresses | Usable hosts |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,216 | 16,777,214 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,536 | 65,534 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,096 | 4,094 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 512 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 256 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 128 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 64 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 32 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 16 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 8 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 4 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 | 1 |
Special IPv4 address ranges
| Range | Type | Defined in |
|---|---|---|
| 255.255.255.255/32 | Limited broadcast | RFC 919 |
| 0.0.0.0/8 | This network | RFC 1122 |
| 10.0.0.0/8 | Private | RFC 1918 |
| 100.64.0.0/10 | Carrier-grade NAT (shared address space) | RFC 6598 |
| 127.0.0.0/8 | Loopback | RFC 1122 |
| 169.254.0.0/16 | Link-local | RFC 3927 |
| 172.16.0.0/12 | Private | RFC 1918 |
| 192.0.0.0/24 | IETF protocol assignments | RFC 6890 |
| 192.0.2.0/24 | Documentation (TEST-NET-1) | RFC 5737 |
| 192.168.0.0/16 | Private | RFC 1918 |
| 198.18.0.0/15 | Benchmarking | RFC 2544 |
| 198.51.100.0/24 | Documentation (TEST-NET-2) | RFC 5737 |
| 203.0.113.0/24 | Documentation (TEST-NET-3) | RFC 5737 |
| 224.0.0.0/4 | Multicast | RFC 5771 |
| 240.0.0.0/4 | Reserved for future use | RFC 1112 |
IPv6 address types
| Prefix | Type | Defined in |
|---|---|---|
| ::/128 | Unspecified address | RFC 4291 |
| ::1/128 | Loopback | RFC 4291 |
| ::ffff:0:0/96 | IPv4-mapped address | RFC 4291 |
| 64:ff9b::/96 | IPv4/IPv6 translation (NAT64) | RFC 6052 |
| 100::/64 | Discard-only | RFC 6666 |
| 2001::/32 | Teredo tunnelling | RFC 4380 |
| 2001:db8::/32 | Documentation | RFC 3849 |
| 2002::/16 | 6to4 tunnelling | RFC 3056 |
| 3fff::/20 | Documentation | RFC 9637 |
| fc00::/7 | Unique local address (ULA) | RFC 4193 |
| fe80::/10 | Link-local unicast | RFC 4291 |
| fec0::/10 | Site-local (deprecated) | RFC 3879 |
| ff00::/8 | Multicast | RFC 4291 |
| 2000::/3 | Global unicast | RFC 4291 |
Common IPv6 prefix sizes
| Prefix | Addresses | /64 networks inside | Typical use |
|---|---|---|---|
| /32 | 79,228,162,514,264,337,593,543,950,336 (2^96) | 4,294,967,296 (2^32) | An internet provider’s allocation |
| /48 | 1,208,925,819,614,629,174,706,176 (2^80) | 65,536 | A site or organization |
| /56 | 4,722,366,482,869,645,213,696 (2^72) | 256 | A home or small office |
| /64 | 18,446,744,073,709,551,616 (2^64) | 1 | One subnet (one LAN) |
| /127 | 2 | less than 1 | A point-to-point link (RFC 6164) |
| /128 | 1 | less than 1 | A single address |
How to calculate a subnet
- Write the address with its prefix. Type the IPv4 address followed by a slash and the prefix length, like 192.168.1.10/24, or follow the address with a dotted netmask like 255.255.255.0. The prefix is how many leading bits name the network.
- Find the network and broadcast addresses. Keep the network bits and set the host bits to 0 for the network address (192.168.1.0), or to 1 for the broadcast address (192.168.1.255).
- Count the usable hosts. A /24 leaves 8 host bits, so 2^8 = 256 addresses. Take away the network and broadcast addresses and 254 are left for hosts, from 192.168.1.1 to 192.168.1.254. A /31 keeps both of its 2 addresses and a /32 is one host.
- Split into smaller subnets. Each extra prefix bit halves the block. Choose how many subnets you need (a power of 2) or the prefix you want: 192.168.1.0/24 into 4 subnets gives 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26, 192.168.1.192/26.
- Check the address type. The calculator names private, carrier-grade NAT, loopback, link-local, multicast and documentation ranges, so you can see at once whether an address is meant to be routed on the internet.
Frequently asked questions
- How do I calculate the network address from an IP address and prefix?
- Write the address in binary and set every host bit (the bits after the prefix) to 0. For 192.168.1.10/24 the first 24 bits are the network, so the network address is 192.168.1.0. In decimal terms, round the address down to a multiple of the block size: a /24 block is 256 addresses long.
- How many usable hosts are in a /24, /26 or /30?
- A /24 has 254 usable hosts, a /26 has 62 and a /30 has 2. The formula is 2^(32 − prefix) − 2: the two taken away are the network address and the broadcast address.
- How are /31 and /32 networks counted?
- A /31 has 2 addresses and both are usable: RFC 3021 lets point-to-point links drop the network and broadcast addresses, so a router link needs 2 addresses instead of 4. A /32 is a single host address with 1 usable host and no broadcast. The calculator shows both exactly this way.
- What is a wildcard mask?
- The wildcard mask is the netmask with every bit flipped: 255.255.255.0 becomes 0.0.0.255. Router access lists (such as Cisco ACLs) use it to say which address bits may differ. Its 1 bits mark host bits, the 0 bits must match.
- Which IPv4 ranges are private?
- RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) and 192.168.0.0/16 for private networks. RFC 6598 adds 100.64.0.0/10 for carrier-grade NAT, which is not private in the same sense: it is shared between a provider and its customers. 169.254.0.0/16 is link-local (RFC 3927), 127.0.0.0/8 is loopback, and 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are for documentation (RFC 5737).
- Can I split a network into subnets of different sizes?
- This tool splits into equal subnets: either a number of them (which must be a power of 2, because each extra prefix bit doubles the count) or a prefix length. For unequal sizes (VLSM), split the block once, then split one of the resulting subnets again. The list is capped at 256 subnets; the heading always shows the true total.
- How does IPv6 shorten an address?
- RFC 5952 sets one canonical form: lowercase hex, no leading zeros in a group, and “::” in place of the longest run of two or more all-zero groups (the first one if there is a tie). 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1. A single zero group is not replaced: 2001:db8:0:1:1:1:1:1 stays 2001:db8:0:1:1:1:1:1. In 2001:db8:0:0:1:0:0:1 the two runs are equally long, so the first is shortened: 2001:db8::1:0:0:1.
- How many /64 networks are in an IPv6 prefix?
- A /64 is the standard size of one subnet, so a prefix of length p up to /64 holds 2^(64 − p) of them: a /48 holds 65,536 and a /56 holds 256. A prefix longer than /64, such as a /127 link, is smaller than one /64.
- What kinds of IPv6 address does it recognise?
- Unique local addresses (fc00::/7, RFC 4193), link-local (fe80::/10), documentation (2001:db8::/32, RFC 3849), multicast (ff00::/8), loopback (::1), the unspecified address (::), IPv4-mapped addresses (::ffff:0:0/96) and global unicast (2000::/3). The table above lists them all.
- Is anything I type sent to a server?
- No. The address is worked out in your browser with plain arithmetic (BigInt for IPv6) and never leaves your device.
How it works
An IPv4 address is read as four decimal parts (0 to 255, no leading zeros, which some systems read as octal) into one number below 2^32. The prefix, or a dotted mask whose 1 bits are all on the left, gives a block of 2^(32 − prefix) addresses. The network address is the typed address rounded down to a multiple of the block size and the broadcast address is the last address of the block; the usable range excludes both, except for /31 (both addresses are hosts, RFC 3021) and /32 (one host). The wildcard mask is 2^32 − 1 minus the netmask. Address class (A to E) is the historical rule from the first bits and is shown for reference only, since CIDR (RFC 4632) replaced classes; address type is the first match in the special-purpose ranges listed above. A bare address with no prefix is treated as /32 (IPv4) or /128 (IPv6). Splitting adds bits to the prefix: N equal subnets need N to be a power of 2 and add log2(N) bits, and a target prefix /P gives 2^(P − prefix) subnets. Only the first 256 are listed, but the count is exact. An IPv6 address is read as eight 16-bit groups (with “::” standing for one or more zero groups and an optional IPv4 tail) into a BigInt below 2^128, so every value is exact. The compressed form follows RFC 5952, the expanded form pads every group to four digits, and the prefix range is the network address (host bits cleared) to the last address (host bits set). Zone identifiers such as %eth0 are not accepted. Everything runs in your browser; nothing you type is sent anywhere.
Sources
- RFC 4632: Classless Inter-domain Routing (CIDR)
- RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links
- RFC 1918: Address Allocation for Private Internets
- RFC 6598: IANA-Reserved IPv4 Prefix for Shared Address Space
- RFC 5737: IPv4 Address Blocks Reserved for Documentation
- RFC 6890: Special-Purpose IP Address Registries
- RFC 3927: Dynamic Configuration of IPv4 Link-Local Addresses
- RFC 4291: IP Version 6 Addressing Architecture
- RFC 5952: A Recommendation for IPv6 Address Text Representation
- RFC 4193: Unique Local IPv6 Unicast Addresses
- RFC 3849: IPv6 Address Prefix Reserved for Documentation
- RFC 5771: IANA Guidelines for IPv4 Multicast Address Assignments
- RFC 9637: Expanding the IPv6 Documentation Space
- RFC 6164: Using 127-Bit IPv6 Prefixes on Inter-Router Links
More free tools
- Number Base ConverterConvert whole numbers between binary, octal, decimal, hex and any base from 2 to 36, up to 5,000 digits, with grouped digits and a two’s-complement view.
- Text to Binary ConverterConvert text to binary, hex, octal or decimal bytes and back. UTF-8 by default (é is 2 bytes, an emoji 4) or UTF-16, with a per-character breakdown.
- Cron Expression ExplainerPaste a 5-field cron expression and read it in plain English, with the next 10 run times in your time zone or UTC. Handles names, steps and @daily.
- Chmod CalculatorConvert Unix file permissions between a checkbox grid, octal (755, 4755), ls -l text (rwxr-xr-x) and chmod commands; apply changes like u+x,go-w.
- Percentage CalculatorWork out X% of Y, what percent X is of Y, percentage change, a % increase or decrease, and the original before a discount, with the formula shown.
- Fraction CalculatorAdd, subtract, multiply and divide fractions and mixed numbers like 2 3/8 + 1 5/16, simplify, and convert to decimals, with every step shown.