About the IP Subnet Calculator
Planning an office network, configuring a router or setting up cloud servers all require the same subnet figures. This subnet calculator takes an IPv4 address and prefix length and returns the network and broadcast addresses, the usable host range and count, the netmask and the wildcard mask: 192.168.1.0/26 holds 64 addresses, 62 usable hosts from .1 to .62, with netmask 255.255.255.192. It can also split a network into smaller subnets.
A /n prefix means the first n bits of the 32-bit address identify the network. The subnet mask has those n bits set to 1; the network address is the IP AND the mask, and the broadcast address sets all host bits to 1. A block holds 2^(32 − n) addresses, of which two (the network and broadcast addresses) cannot be assigned to hosts, except for /31 point-to-point links (RFC 3021), where both are usable, and /32, a single host. The wildcard mask, used in Cisco ACLs and OSPF, is the mask with its bits inverted.
Example: 192.168.1.130/26 has the mask 255.255.255.192 and wildcard 0.0.0.63. Its network is 192.168.1.128, its broadcast 192.168.1.191, and hosts run from .129 to .190: 62 usable addresses out of 64. It is a private address from the RFC 1918 192.168.0.0/16 range. Splitting it into /28 subnets gives four blocks: .128, .144, .160 and .176, each with 14 hosts.
Everything is calculated in your browser; no address is sent anywhere. For converting the binary and hexadecimal forms use the number base converter, and for decimal-binary practice the decimal to binary converter.
How to use the IP Subnet Calculator
- Enter an IPv4 addressSuch as 192.168.1.130, or with a prefix, such as 10.0.0.1/8.
- Choose the prefix lengthFrom /0 to /32; the subnet mask is shown next to each.
- Read the subnetNetwork, broadcast, host range, hosts, masks and address type.
- Split itPick a longer prefix to list the smaller subnets.
IP Subnet Calculator features
- Network and broadcast addresses
- First and last usable host
- Usable and total addresses
- Subnet mask and wildcard mask
- Binary view of network and host bits
- Private, public and special ranges detected
- Split into smaller subnets
Common uses
- Planning office and home networks
- Cloud VPC and VNet subnets
- Firewall rules and Cisco ACLs
- CCNA and Network+ study
- Troubleshooting IP conflicts
Subnetting in practice: planning an office network, largest blocks first, VPN clashes, cloud reserved addresses and carrier-grade NAT
Subnet calculations become real when you plan a network: an office with staff computers, cameras and guest Wi-Fi, a cloud network with public and private tiers, or a VPN linking branches. This guide plans an office network step by step, explains why the largest blocks should be allocated first, and covers summarising routes, avoiding clashes with home networks, cloud providers' reserved addresses and the carrier-grade NAT that stops remote camera access in many homes and offices.
A worked example: planning an office network
An office in Lahore needs addresses for about 60 staff devices, 30 guest phones and laptops, and 20 security cameras, all within 192.168.10.0/24. A /26 holds only 62 usable addresses, too tight for 60 staff with any growth, so staff get a /25 with 126 usable addresses. Guests get a /26 with 62, and cameras a /27 with 30. The plan becomes:
- Staff: 192.168.10.0/25, hosts .1 to .126.
- Guests: 192.168.10.128/26, hosts .129 to .190.
- Cameras: 192.168.10.192/27, hosts .193 to .222.
- Spare: 192.168.10.224/27, kept for printers, servers or a future network.
Each block is separated by its own network segment or VLAN, so guests cannot reach staff computers or the camera recorder.
Largest blocks first
Blocks must start on boundaries that are multiples of their size, so a /25 must start at .0 or .128. Allocating the largest block first, then the next largest, packs everything neatly without gaps. Allocating small blocks first scatters them and can leave no aligned space for a large block later, even when enough addresses remain in total.
Gateways, DHCP and static addresses
A common convention gives the router the first usable address of each block, such as 192.168.10.1 for staff. Devices that need fixed addresses, such as printers and camera recorders, should sit outside the range handed out automatically by DHCP, or receive reservations in the DHCP server, so two devices never claim the same address.
Summarising routes
Neighbouring blocks can be described by a single shorter prefix. The four networks 10.20.0.0/24, 10.20.1.0/24, 10.20.2.0/24 and 10.20.3.0/24 together form 10.20.0.0/22. Routers and firewalls then need one rule instead of four. Planning branch networks as aligned groups, such as one /22 per branch, makes summarising possible and keeps routing tables tidy as an organisation grows.
Avoiding VPN clashes
Many home routers use 192.168.0.0/24 or 192.168.1.0/24. If an office uses the same range, staff connecting from home over a VPN cannot reach office devices, because their computer believes those addresses are on the home network. Choosing a less common range for offices, such as a block within 10.0.0.0/8 or 172.16.0.0/12, avoids the clash before it happens.
Cloud subnets
Cloud providers reserve some addresses in every subnet for their own services. AWS and Azure each reserve five addresses per subnet, so a /28 with 16 addresses leaves only 11 for your resources. When planning cloud networks, allow for these reservations and leave room for growth, because resizing a subnet later often means rebuilding resources inside it.
Carrier-grade NAT
Some internet providers place customers behind shared addresses from the range 100.64.0.0/10, known as carrier-grade NAT. If a router's internet-facing address falls in that range, or does not match the public address shown by an IP lookup website, incoming connections cannot be forwarded to a camera recorder or server. A public IP from the provider, a VPN service or a cloud relay is then needed for remote access.
Firewall rules
Firewalls and server allow lists accept networks in CIDR form, so a rule can allow a whole office range, such as 203.0.113.0/24, in one line. Double-check the prefix length before saving: a /16 typed instead of a /24 allows 256 times as many addresses as intended.
Common mistakes
- Choosing a block exactly the size of today's needs, with no room to grow.
- Allocating small blocks before large ones.
- Using the same private range as typical home routers.
- Forgetting cloud providers' reserved addresses.
Related tools
To see addresses in binary, use Decimal to Binary Converter. For hexadecimal forms, try Binary to Hex Converter, and to convert hex values back, Hex to Decimal Converter.
Documenting the plan
Keep a simple table listing each block, its purpose, its VLAN number, gateway address and the DHCP range, and update it with every change. Without it, the next technician has to rediscover the design from router settings, and an accidentally reused block can take down part of the network. A shared spreadsheet is enough for most small offices.
Troubleshooting with block ranges
When a device misbehaves, its address shows which network it joined. A staff laptop with the address 192.168.10.140 falls within the guest block, .128 to .191, so it has connected to the guest Wi-Fi or the wrong network port. Checking an address against the plan is often the fastest first step in diagnosing access problems.
IPv6 alongside IPv4
IPv6 networks normally give every local segment a /64, which holds so many addresses that counting hosts stops mattering. Planning instead focuses on how many /64 segments each site receives from its allocation, often a /48 or /56 from the provider. As IPv6 becomes more widely available, planning both alongside each other avoids redesigning later.
Privacy
Calculations run in your browser. The addresses you enter are not sent anywhere or stored.
Frequently asked questions
How do I calculate the network address?
Write the IP and the subnet mask in binary and AND them together bit by bit. For 192.168.1.130/26, the last octet 130 (10000010) AND 192 (11000000) gives 128, so the network is 192.168.1.128.
How many hosts are in a /24?
256 addresses, of which 254 are usable hosts, because the network address (.0) and broadcast address (.255) are reserved. A /25 has 126 hosts and a /26 has 62.
What is CIDR notation?
Classless Inter-Domain Routing writes a network as an address and a prefix length, such as 10.0.0.0/8. The number after the slash is how many leading bits are the network part.
What is a wildcard mask?
The inverse of the subnet mask: 0 bits must match, 1 bits can be anything. 255.255.255.192 becomes 0.0.0.63. Cisco access lists and OSPF network statements use wildcard masks.
What are the private IP address ranges?
RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 for private networks. 100.64.0.0/10 is carrier-grade NAT space, and 169.254.0.0/16 is link-local.
Why does a /31 have 2 usable addresses?
RFC 3021 allows /31 networks on point-to-point links, where no broadcast address is needed, so both addresses can be used. A /32 identifies a single host.
How do I split a network into subnets?
Lengthen the prefix: each extra bit doubles the number of subnets and halves their size. A /24 split into /26 gives four subnets of 64 addresses, 62 usable hosts each.
Does this calculator support IPv6?
Not yet; it covers IPv4, where subnetting by hand is most common. IPv6 subnets are usually /64 for a single network, with prefixes such as /48 or /56 assigned to sites.