IP Subnet Calculator (CIDR)

This calculator works out the key details of an IPv4 subnet from an IP address and a CIDR prefix length, the shorthand network engineers use for how many bits of an address are reserved for the network rather than individual hosts. Enter an IPv4 address such as 192.168.1.0, choose a prefix from /0 to /32, or type the full CIDR notation such as 192.168.1.0/24 and it fills in the rest automatically. The calculator returns the subnet mask, network address, broadcast address, wildcard mask, first and last usable host, and the total number of usable hosts in that range. Quick presets cover common private ranges under RFC 1918, and you can split a subnet into 2, 4, 8 or 16 equal sub-subnets to see how the prefix length and host ranges change. A colour-coded binary breakdown shows which bits are fixed for the network and which are free for hosts, handy when learning subnetting or checking a design. Use it to plan IP address allocation for a home network, office LAN or cloud VPC, to confirm a subnet is large enough for the devices you need, or to work out the wildcard mask for a Cisco access control list or OSPF network statement. All results are calculated instantly in your browser using standard binary arithmetic, based on RFC 950 and RFC 4632, and no data is sent to any server.

Calculate.co.nz is proud to be partnered with Premium Homes, a recognised leader in eco-friendly, sustainable, and energy-efficient homebuilding. With a dedicated team and award-winning experience, they create homes that prioritise health, comfort, and long-term performance. Their founders, Andrew and Kelly, set out to raise the standard of residential construction in New Zealand by combining practical building expertise with a clear commitment to doing things better for homeowners.
Calculate.co.nz partner: Premium Homes
Standard reference tool  IPv4 subnetting per RFC 950 and CIDR per RFC 4632.

1. IP Address

2. Quick Presets

Subnet Details

Network Address
192.168.1.0
First address in subnet
Subnet Mask
255.255.255.0
Dotted decimal
Broadcast Address
192.168.1.255
Last address in subnet
First Usable Host
192.168.1.1
Lowest assignable IP
Last Usable Host
192.168.1.254
Highest assignable IP
Usable Hosts
254
Excludes network + broadcast

Full Subnet Summary

CIDR notation192.168.1.0/24
Network address192.168.1.0
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
Broadcast address192.168.1.255
First usable host192.168.1.1
Last usable host192.168.1.254
Total addresses256
Usable hosts254

Subnet Division

Select a division above to split this subnet.

IP address: 11000000.10101000.00000001.00000000

Subnet mask: 11111111.11111111.11111111.00000000

Network address: -

Green = network bits (fixed)   Amber = host bits (variable)

How IP Subnetting Works

Every IPv4 address is a 32-bit number, written as four octets (groups of 8 bits) separated by dots. The address is split into two parts: the network portion (which identifies the subnet) and the host portion (which identifies individual devices within the subnet). The subnet mask defines where this boundary falls. In CIDR (Classless Inter-Domain Routing) notation, the prefix length after the slash tells you how many bits belong to the network.

Core Formulas

Given an IPv4 address and a prefix length n:

Worked Example: 192.168.1.0/24

The default values in this calculator use 192.168.1.0/24, the most common home and small office network range. Here is how the results are derived:

FieldValueWorking
Prefix length/2424 network bits, 8 host bits
Subnet mask255.255.255.024 ones followed by 8 zeros in binary
Wildcard mask0.0.0.255Inverse of subnet mask
Network address192.168.1.0192.168.1.0 AND 255.255.255.0
Broadcast address192.168.1.255192.168.1.0 OR 0.0.0.255
First usable host192.168.1.1Network address + 1
Last usable host192.168.1.254Broadcast address - 1
Total addresses2562^8 = 256
Usable hosts254256 - 2 = 254

Common Prefix Lengths at a Glance

CIDRSubnet MaskTotal AddressesUsable Hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422 (RFC 3021)
/32255.255.255.25511 (host route)

Private IP Ranges (RFC 1918)

Three IPv4 ranges are reserved for private use and are not routed on the public internet. These are used for internal networks behind NAT (Network Address Translation):

Related Calculators

Sources and method: IPv4 subnetting per RFC 950 (Internet Standard Subnetting Procedure). CIDR notation per RFC 4632 (Classless Inter-domain Routing). /31 point-to-point host addressing per RFC 3021. All calculations are performed in 32-bit unsigned integer arithmetic in the browser.

This tool handles IPv4 addresses only. IPv6 subnetting uses 128-bit addresses and different notation. All results are computed client-side and no data is transmitted to any server.