Skip to content
FigureSure
Sign in

IP Subnet Calculator

Enter an IPv4 address and prefix or subnet mask to get the network and broadcast addresses, the usable host range and count, the wildcard mask and a binary view. You can also split a network into equal subnets, and expand, compress and size IPv6 prefixes.
  • Updated
  • Formula shown

What do you want to work out?
Address

You can also type CIDR, like 10.0.0.0/8

For example 24, /26 or 255.255.255.192

Results

Network
192.168.1.0/24
192.168.1.10 is in this subnet
Usable host range
192.168.1.1 – 192.168.1.254
Usable hosts
256 addresses minus network and broadcast
254
Broadcast address
192.168.1.255
Subnet mask
/24
255.255.255.0
Wildcard mask
Used in ACLs and OSPF
0.0.0.255
Total addresses
256
Address type
RFC 1918
Private
Class (historic)
Classful addressing was replaced by CIDR in 1993
C

192.168.1.10/24: network 192.168.1.0/24, 254 usable hosts

Binary (network bits | host bits)
DecimalBinary
Address192.168.1.1011000000.10101000.00000001 | 00001010
Subnet mask255.255.255.011111111.11111111.11111111 | 00000000
Network192.168.1.011000000.10101000.00000001 | 00000000
Broadcast192.168.1.25511000000.10101000.00000001 | 11111111

How to use the IP subnet calculator

  1. Choose IPv4 subnet details, splitting a network, or IPv6.
  2. Type the address. For IPv4, give the prefix length (such as 24) or the mask (such as 255.255.255.0), or type both together as CIDR, like 10.0.0.0/8.
  3. To split a network, enter how many subnets you need. The calculator rounds up to the next power of 2 and lists every subnet.
  4. For IPv6, enter the address in any valid form and the prefix length, usually 64 for a LAN or 48 or 56 for a site.

Subnet formulas

mask = prefix ones followed by (32 − prefix) zeros
network = address AND mask    broadcast = network OR (NOT mask)
usable hosts = 2^(32 − prefix) − 2  (2 for /31, 1 for /32)

An IPv4 address is a 32-bit number. The prefix length says how many of the leading bits name the network; the remaining bits number the hosts inside it. A bitwise AND with the mask clears the host bits and gives the network address, and setting all the host bits to 1 gives the broadcast address. Those two are normally reserved, so a subnet with h host bits has 2h − 2 usable addresses. There are two exceptions: RFC 3021 lets both addresses of a /31 be used on point-to-point links, and a /32 names a single host. The wildcard mask, used by Cisco ACLs and OSPF, is the mask with every bit flipped.

Worked example: 192.168.10.77/26

A /26 mask is 255.255.255.192: 26 ones, then 6 zeros. In binary the address is 11000000.10101000.00001010.01 | 001101, where the bar marks the end of the network bits. Clearing the 6 host bits gives the network 192.168.10.64, and setting them gives the broadcast 192.168.10.127. Hosts run from 192.168.10.65 to 192.168.10.126: 2⁶ − 2 = 62 usable addresses. The wildcard mask is 0.0.0.63.

Splitting 10.0.0.0/24 into 4 equal subnets borrows 2 bits, giving four /26 networks: 10.0.0.0, 10.0.0.64, 10.0.0.128, 10.0.0.192, each with 62 usable hosts.

CIDR and subnet mask table

PrefixSubnet maskWildcardAddressesUsable hosts
/8255.0.0.00.255.255.25516,777,21616,777,214
/12255.240.0.00.15.255.2551,048,5761,048,574
/16255.255.0.00.0.255.25565,53665,534
/20255.255.240.00.0.15.2554,0964,094
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122 (RFC 3021)
/32255.255.255.2550.0.0.011

Special IPv4 address ranges

The calculator labels each address using the IANA special-purpose registry. Everything else is public, globally routable address space.

RangeUseDefined in
255.255.255.255/32Limited broadcastRFC 919
0.0.0.0/8"This network" (not a usable destination)RFC 791
10.0.0.0/8PrivateRFC 1918
100.64.0.0/10Shared address space (carrier-grade NAT)RFC 6598
127.0.0.0/8LoopbackRFC 1122
169.254.0.0/16Link-localRFC 3927
172.16.0.0/12PrivateRFC 1918
192.0.0.0/24IETF protocol assignmentsRFC 6890
192.0.2.0/24Documentation (TEST-NET-1)RFC 5737
192.88.99.0/24Former 6to4 relay anycast (deprecated)RFC 7526
192.168.0.0/16PrivateRFC 1918
198.18.0.0/15BenchmarkingRFC 2544
198.51.100.0/24Documentation (TEST-NET-2)RFC 5737
203.0.113.0/24Documentation (TEST-NET-3)RFC 5737
224.0.0.0/4MulticastRFC 5771
240.0.0.0/4Reserved for future useRFC 1112

IPv6 prefixes

IPv6 addresses are 128 bits, written as eight groups of four hex digits. RFC 5952 sets one canonical short form: lowercase, no leading zeros, and the longest run of zero groups replaced by ::. For example 2001:0db8:abcd:0012:0000:0000:0000:0001 is written 2001:db8:abcd:12::1. Its /64 network is 2001:db8:abcd:12::/64, running to 2001:db8:abcd:12:ffff:ffff:ffff:ffff: 18,446,744,073,709,551,616 addresses. Because the numbers are this large, the calculator works with exact 128-bit integers rather than floating point.

Tips

  • Plan for growth. A /24 gives 254 hosts; if a segment might pass 100 devices, don't size it at /25.
  • Private ranges for internal networks. Use 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 (RFC 1918). 100.64.0.0/10 is reserved for carrier-grade NAT, not for home or office LANs.
  • Documentation examples. Use 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 and 2001:db8::/32 in guides, so examples never point at a real network.

Planning how fast data moves across the network? The bandwidth calculator works out download times, and the binary calculator and hex calculator help with the bit arithmetic.

Sources

  • RFC 4632 (CIDR), RFC 3021 (31-bit prefixes on point-to-point links), RFC 1918 (private addresses), RFC 6598 (shared address space), RFC 6890 and the IANA IPv4 and IPv6 Special-Purpose Address Registries.
  • RFC 4291 (IPv6 addressing architecture), RFC 5952 (IPv6 text representation), RFC 4193 (unique local addresses), RFC 3849 (IPv6 documentation prefix).

Frequently asked questions

How many usable hosts are in a /24?

254. A /24 has 2⁸ = 256 addresses; the first (the network address) and the last (the broadcast address) are reserved, leaving 254. For example, 192.168.1.0/24 has hosts 192.168.1.1 to 192.168.1.254 and broadcast 192.168.1.255.

How do I find the network address?

Do a bitwise AND of the address and the subnet mask, which clears the host bits. 192.168.10.77 with mask 255.255.255.192 (/26) gives 192.168.10.64; setting the 6 host bits instead gives the broadcast address 192.168.10.127.

Why does a /31 have two usable addresses?

RFC 3021 allows 31-bit prefixes on point-to-point links, where a broadcast address is not needed, so both addresses can be assigned to the two ends of the link. A /32 is a single address, used for host routes and loopback interfaces.

What is a wildcard mask?

The subnet mask with every bit inverted: 255.255.255.0 becomes 0.0.0.255. Cisco access lists and OSPF use it to say which bits of an address must match (0) and which may vary (1).

How many addresses are in an IPv6 /64?

2⁶⁴ = 18,446,744,073,709,551,616. A /64 is the standard size for one IPv6 LAN, and a /48, often assigned to a site, holds 65,536 of them. The calculator works with exact 128-bit integers for these counts.

Was this calculator helpful?