What is a subnet calculator?
A subnet calculator takes an IPv4 address and a CIDR prefix length and returns the subnet it belongs to: the network address, the broadcast address, the netmask, and the number of usable hosts. The default here is 192.168.1.10/24, which gives the network 192.168.1.0, the broadcast 192.168.1.255, and 254 usable hosts.
Networks are divided into subnets so that addresses can be managed in blocks. A company with a /24 has 256 addresses to hand out; a home router with a /24 has the same. Knowing the network and broadcast addresses tells you which addresses are in the block and which are the two reserved ones at the ends.
This tool is pure JavaScript and runs entirely in your browser. Type the address and the prefix, and the four values appear at once — no lookup, no server, and no data leaving your device.
How subnet math works
An IPv4 address is 32 bits, written as four numbers from 0 to 255. The CIDR prefix says how many of those bits are the network part: /24 means the first 24 bits are the network, and the last 8 bits are the host part. The netmask is 24 ones followed by 8 zeros, which is 255.255.255.0.
The network address is the IP with the host bits cleared: 192.168.1.10 AND 255.255.255.0 gives 192.168.1.0. The broadcast address is the network with the host bits set: 192.168.1.0 OR 0.0.0.255 gives 192.168.1.255. Those two addresses are reserved — the network identifies the subnet, and the broadcast reaches every host in it.
The usable hosts are the addresses between them: 2 to the power of the host bits, minus 2 for the network and the broadcast. A /24 has 8 host bits, so 2^8 - 2 = 254 usable hosts, from 192.168.1.1 to 192.168.1.254.
The math is all bitwise, and it is simpler than it looks once the address is written in binary. The network address is the IP address with the host bits cleared — every bit after the prefix is set to zero — and the broadcast address is the same address with the host bits set to one. The mask is the prefix written as an address: a /24 mask is 255.255.255.0, which is 24 ones followed by 8 zeros, and the network address is the IP address ANDed with the mask. The host count is two to the power of the number of host bits, minus two, because the network and broadcast addresses cannot be assigned to a host.
CIDR prefix lengths, explained
The prefix length decides the size of the subnet. A /24 is the common home and office size: 256 addresses, 254 usable. A /25 is half that: 128 addresses, 126 usable. A /16 is a large block: 65,536 addresses, 65,534 usable. Each step down the prefix doubles the size.
Small prefixes are for point-to-point links. A /31 has 2 addresses and 2 usable hosts, which is the special case for a link between two routers — there is no network or broadcast address to reserve, because both addresses are used. A /32 is a single host, with 1 usable host and no range at all.
The prefix is written after a slash: 192.168.1.10/24. The old notation wrote the netmask instead — 255.255.255.0 — and the two mean the same thing. CIDR is the modern form, and it is the one this tool takes.
Prefix lengths are the compact way to write a mask, and each one halves or doubles the network. A /24 holds 256 addresses, a /25 holds 128, and a /23 holds 512 — each step of one in the prefix halves or doubles the size, because each bit is a factor of two. The common prefixes are the ones that match a familiar size: /24 is a small office, /16 is a large network, and /8 is a whole class A block. The calculator shows the mask alongside the prefix, so the two notations are visible together and the relationship between them is easy to learn.
A worked example: a home network
Take the default: 192.168.1.10 with a /24 prefix. The netmask is 255.255.255.0, the network is 192.168.1.0, and the broadcast is 192.168.1.255. The usable hosts are 254, from 192.168.1.1 to 192.168.1.254. The router is usually 192.168.1.1, and the devices take the rest.
Try a smaller subnet: 192.168.1.10/28. The netmask becomes 255.255.255.240, the network stays 192.168.1.0, and the broadcast becomes 192.168.1.15, with 14 usable hosts from 192.168.1.1 to 192.168.1.14. The same address in a smaller subnet has a smaller range — the prefix decides the block, not the address.
Try a larger one: 10.0.0.5/16. The network is 10.0.0.0, the broadcast is 10.0.255.255, and the usable hosts are 65,534. That is a whole company's worth of addresses in one subnet, which is why /16 blocks are used for large private networks.
Who uses a subnet calculator, and why
Network engineers are the main users. Designing a network means dividing the address space into subnets of the right sizes, and a calculator gives the boundaries of each block — the network, the broadcast, and the usable range — without doing binary arithmetic by hand.
System administrators are the second group. A server needs an address, a gateway, and a netmask, and the calculator gives the netmask and confirms that the address sits inside the right subnet. A wrong netmask is the classic cause of a server that can reach some hosts and not others.
Students and certification candidates are a third group. Subnetting is a core skill for network exams, and a calculator is the way to check an answer worked out by hand. A IP address lookup shows the public details of an address, which is the other half of understanding where an address lives.
Network administrators are a third group. A new office needs its addresses planned before the first machine is plugged in, and the plan is a set of subnets — one for the staff, one for the servers, one for the guests — each with its own prefix and its own range. The calculator is the tool for that plan: type the address and the prefix, and the network, broadcast, and host count are the numbers the plan is written from. A plan made by hand is where two subnets overlap, and the calculator shows the overlap before it happens.
Subnet calculator vs IP lookup
A subnet calculator works out the block an address belongs to; an IP lookup tells you about the address itself. The IP address lookup on this site shows the public information for an address — its location and its owner — while this tool computes the network, broadcast, and host count from the address and the prefix.
The two tools answer different questions. "Which subnet is 192.168.1.10/24 in?" is a calculation, and this tool answers it. "Where is 8.8.8.8?" is a lookup, and the IP lookup answers it. Both are part of understanding an address, and both run in the browser.
A DNS checker resolves a domain name to the address, which is the step before any subnet math — a name must resolve before its address can be placed in a subnet. A SSL checker verifies the certificate on an address, which is the next check after the network is right.
A subnet calculator is not an IP lookup, and the distinction matters when the question is about a public address rather than a private network. A lookup tells you where a public address lives — its location and its owner — which is the tool for an address that arrived from the internet. A subnet calculator works out the block an address belongs to, which is the tool for planning a network you control. Use the calculator to plan and the lookup to investigate — the two tools answer different questions about the same address.
Common subnet mistakes
The first mistake is using the network or broadcast address for a host. The network address identifies the subnet and the broadcast reaches every host in it, so neither can be assigned to a device. A device given the broadcast address will not work, and a device given the network address will confuse the router.
Second: the wrong prefix. A /24 and a /25 on the same address give different networks, and a device with the wrong netmask can reach some hosts and not others — the classic symptom of a netmask error. Check the prefix against the network's design, not against habit.
Third: forgetting that /31 and /32 are special. A /31 has 2 usable hosts and no reserved addresses, which is correct for a point-to-point link but wrong for a normal subnet. A /32 is a single host with no range at all, used for loopback addresses and host routes.
Fourth: counting the network and broadcast as usable. A /24 has 256 addresses but only 254 usable hosts, because two are reserved. Planning for 256 devices in a /24 means two devices will have nowhere to go.
A second mistake is using the network address or the broadcast address as a host address. The network address is the name of the network itself, and the broadcast address is the address that reaches every host on it, so neither can be assigned to a single machine. A device configured with the network address will not communicate, and a device configured with the broadcast address will send its traffic to everyone. The calculator shows all three — network, broadcast, and the usable range — so the mistake is visible before the address is configured.
How to use this subnet calculator
Type an IPv4 address into the box — the default is 192.168.1.10 — and set the CIDR prefix with the slider. The default /24 gives the network 192.168.1.0, the broadcast 192.168.1.255, and 254 usable hosts, with the netmask 255.255.255.0.
To copy the details, use the Copy button next to the output box. To check another subnet, change the address or the prefix and watch the four values update live.
Everything runs in your browser. No sign-up, no account, no data sent anywhere. It works offline once the page has loaded.
Type the IP address and the prefix, and the results appear at once: the network address, the broadcast address, the mask, and the number of usable hosts. The usable range is the addresses between the network and the broadcast, and those are the ones that can be assigned to devices. To plan a network, start with the number of hosts you need and pick the smallest prefix that holds them — a /24 for up to 254 hosts, a /25 for up to 126 — and the calculator shows whether the prefix you picked is big enough.