Tech & Digital
IP Subnet Calculator
Enter an IPv4 address and prefix length (CIDR) to get everything you need to configure a network: network and broadcast addresses, the first and last usable hosts, the subnet and wildcard masks and whether the address is private or public.
How to use this calculator
- Type an IPv4 address, optionally with a prefix (e.g. 10.0.0.5/22).
- Or choose the prefix length from the list.
Subnetting in a nutshell
An IPv4 address has 32 bits. The prefix length — the number after the slash in CIDR notation — says how many of those bits identify the network; the rest identify hosts. A /24 network such as 192.168.1.0/24 leaves 8 bits for hosts, giving 256 addresses, of which 254 can be assigned because the first is the network address and the last is the broadcast address.
Every extra bit of prefix halves the number of addresses: /25 gives 126 usable hosts, /26 gives 62, /30 gives 2. The calculator works out the network and broadcast addresses, the usable range, the subnet mask, the wildcard mask used in firewall and router access lists, and whether the address is private, public, loopback or another special range.
Private ranges and planning
RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private networks, which are translated to public addresses by a router (NAT). When planning a network, size each subnet for the number of devices it will hold with room to grow, and keep subnets aligned on their natural boundaries so routes can be summarised.
Formula & method
Mask = 32-bit value with the first p bits set to 1Network = IP AND mask; Broadcast = Network OR NOT maskUsable hosts = 2^(32 − p) − 2 (for p ≤ 30)/31 networks (RFC 3021) have two usable addresses for point-to-point links and /32 identifies a single host; neither has a broadcast address.
Worked example
192.168.1.10/24
- Mask = 255.255.255.0
- Network = 192.168.1.0, broadcast = 192.168.1.255
- Hosts = 2⁸ − 2 = 254
Answer: Usable range 192.168.1.1 – 192.168.1.254.
Official sources
Frequently asked questions
Does it support IPv6?
Not yet — IPv6 subnetting is planned for a future version.
Why are two addresses unusable in most subnets?
The first address identifies the network and the last is the broadcast address; /31 and /32 are special cases.
What is a wildcard mask?
The inverse of the subnet mask, used by some routers and firewalls to match address ranges.
How many hosts are in a /22?
1,024 addresses, of which 1,022 are usable.
What is 100.64.0.0/10?
Shared address space for carrier-grade NAT (RFC 6598), used by internet providers, not on home networks.