ToolNimba

๐ŸŒ IP Subnet Calculator (CIDR, Mask, Broadcast & Hosts)

Shihab Mia By Shihab Mia ยท Updated 2026-08-01

Enter an IPv4 address and a CIDR prefix, then press Calculate.

An IP subnet calculator turns an IPv4 address and its CIDR prefix (such as 192.168.1.10/24) into the numbers you actually need to configure a network: the network address, the broadcast address, the subnet mask and its wildcard, the first and last usable host, and how many addresses the block holds. Type an address and a prefix from 0 to 32, press Calculate, and every value appears at once. All the work is plain bitwise math on the 32-bit address, run entirely in your browser, so nothing you type is ever sent anywhere.

What is the IP Subnet Calculator?

Every IPv4 address is really a single 32-bit number, usually written as four 8-bit octets in dotted-decimal form like 192.168.1.10. The CIDR prefix (the number after the slash) says how many of those 32 bits, counting from the left, are the network portion. A /24 fixes the first 24 bits as the network and leaves the last 8 bits free for hosts. The subnet mask is just those network bits set to 1 and the host bits set to 0, so /24 is 255.255.255.0, and the wildcard mask is the exact inverse (0.0.0.255), which is what access-control lists and routing rules often expect. Any ip subnet calculator worth using should show all four of these values together, because they describe the same block from four different angles.

The two boundary addresses fall straight out of the mask. The network address is the IP with every host bit forced to 0, found by a bitwise AND of the address and the mask. The broadcast address is the IP with every host bit forced to 1, found by a bitwise OR of the network and the wildcard. Those two are reserved and cannot be assigned to a machine, so for any prefix shorter than /31 the usable hosts are the addresses in between: the first usable host is the network plus one, and the last usable host is the broadcast minus one. The total number of addresses in the block is 2 raised to the power of the number of host bits (32 minus the prefix).

Two prefixes are special cases that trip up a lot of manual subnetting. A /31 has only two addresses and no room to spare both a network and a broadcast, so RFC 3021 lets both addresses be used as hosts on a point-to-point link. A /32 is a single address, a host route to one exact machine, with no separate network or broadcast at all. A reliable ip subnet calculator handles those edge cases instead of reporting a negative or zero host count, which is the trap a naive total-minus-two formula falls into.

Before CIDR existed, IPv4 addressing was classful: Class A networks used the first 8 bits for the network portion, Class B used the first 16, and Class C used the first 24, with no flexibility in between. That rigid scheme wasted huge blocks of address space, because an organization that needed 300 addresses had to take a whole Class B network of 65,536. CIDR, introduced in 1993, replaced the fixed classes with the flexible prefix notation this calculator uses, letting a network be exactly as large as it needs to be, from a /30 point-to-point link to a /8 backbone allocation.

CIDR also enabled variable length subnet masking (VLSM), which is the practice of splitting one address block into subnets of different sizes instead of forcing every subnet to match. A site might carve a /24 into a /26 for a busy office segment, a /28 for a server room, and several /30 links for router-to-router connections, all from the same parent block. Running each candidate prefix through an ip subnet calculator before committing it to a router configuration is the fastest way to confirm the network, broadcast and usable range do not overlap with a neighboring subnet, which is the single most common cause of routing conflicts in a VLSM design.

Subnetting matters beyond exam questions because every router, firewall rule, DHCP scope and cloud VPC depends on getting the mask and boundaries right. A misconfigured mask can silently merge two subnets that were meant to be isolated, or leave a segment with far fewer usable addresses than planned. Working through the math with an ip subnet calculator, then cross-checking against the reference tables below, is the quickest way to catch that kind of mistake before it reaches production hardware.

When to use it

  • Planning an office or home network: finding the usable host range and how many devices a given prefix will hold.
  • Configuring a router, firewall or switch where you need the exact subnet mask and broadcast address for an interface.
  • Writing access-control lists or routing rules that ask for a wildcard mask rather than a subnet mask.
  • Designing a VLSM addressing plan that splits one parent block into differently sized subnets for offices, servers and point-to-point links.
  • Studying for networking certifications (CCNA, Network+, CompTIA) by checking subnetting answers against a known-good calculator.
  • Documenting cloud VPC or data center address plans where every subnet and its range need to be recorded accurately.

How to use the IP Subnet Calculator

  1. Type an IPv4 address into the address box, for example 192.168.1.10.
  2. Enter the CIDR prefix length from 0 to 32 in the prefix box, for example 24.
  3. Press Calculate to see the network address, broadcast, mask, wildcard, host range and counts.
  4. Use Copy results to grab every value as plain text for your notes or a config file.
  5. Re-run the calculator for each candidate subnet if you are dividing one parent block into several VLSM subnets, and confirm the ranges do not overlap.

Formula & method

Network = IP AND mask. Broadcast = network OR wildcard, where wildcard = NOT mask. Total addresses = 2 to the power of (32 minus prefix). Usable hosts = total minus 2 (with /31 giving 2 and /32 giving 1). First host = network plus 1, last host = broadcast minus 1.

Worked examples

Calculate the subnet for 192.168.1.10/24, a common home or office LAN.

  1. Prefix 24 means 24 network bits, so the mask is 255.255.255.0 and the wildcard is 0.0.0.255.
  2. Network = 192.168.1.10 AND 255.255.255.0 = 192.168.1.0.
  3. Broadcast = 192.168.1.0 OR 0.0.0.255 = 192.168.1.255.
  4. Host bits = 32 minus 24 = 8, so total addresses = 2^8 = 256.
  5. Usable hosts = 256 minus 2 = 254, from 192.168.1.1 to 192.168.1.254.

Result: Network 192.168.1.0, broadcast 192.168.1.255, hosts 192.168.1.1 to 192.168.1.254, 254 usable.

Calculate the subnet for 192.168.1.130/26, one of four equal blocks of 192.168.1.0/24.

  1. Prefix 26 means 26 network bits, so the mask is 255.255.255.192 and the wildcard is 0.0.0.63.
  2. Network = 192.168.1.130 AND 255.255.255.192 = 192.168.1.128.
  3. Broadcast = 192.168.1.128 OR 0.0.0.63 = 192.168.1.191.
  4. Host bits = 32 minus 26 = 6, so total addresses = 2^6 = 64.
  5. Usable hosts = 64 minus 2 = 62, from 192.168.1.129 to 192.168.1.190.

Result: Network 192.168.1.128, broadcast 192.168.1.191, hosts 192.168.1.129 to 192.168.1.190, 62 usable.

Use VLSM to split 10.0.0.0/24 into a 50-host office segment and a 20-host server segment without wasting addresses.

  1. The office needs 50 hosts, so pick the smallest prefix that covers it: /26 gives 62 usable hosts, enough with room to grow.
  2. Run 10.0.0.0/26 through the calculator: network 10.0.0.0, broadcast 10.0.0.63, usable range 10.0.0.1 to 10.0.0.62.
  3. The server segment needs 20 hosts, so the next block starts right after the first: /27 gives 30 usable hosts.
  4. Run 10.0.0.64/27 through the calculator: network 10.0.0.64, broadcast 10.0.0.95, usable range 10.0.0.65 to 10.0.0.94.
  5. The remaining 10.0.0.96/27 and beyond stay free for future subnets, instead of being locked into two equal /25 blocks that would waste dozens of addresses.

Result: Office subnet 10.0.0.0/26 (62 hosts), server subnet 10.0.0.64/27 (30 hosts), rest of the /24 left free.

Common IPv4 prefixes: subnet mask, total addresses and usable hosts

CIDRSubnet maskWildcardTotal addressesUsable hosts
/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
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122 (RFC 3021)
/32255.255.255.2550.0.0.011 (host route)

Private IPv4 address ranges (RFC 1918)

RangeCIDR blockAddresses
10.0.0.0 to 10.255.255.25510.0.0.0/816,777,216
172.16.0.0 to 172.31.255.255172.16.0.0/121,048,576
192.168.0.0 to 192.168.255.255192.168.0.0/1665,536

Legacy classful address ranges (superseded by CIDR, still asked about in exams)

ClassFirst octet rangeDefault maskTypical use
A1 to 126255.0.0.0 (/8)Very large networks
B128 to 191255.255.0.0 (/16)Mid-sized networks
C192 to 223255.255.255.0 (/24)Small networks
D224 to 239n/aMulticast
E240 to 255n/aReserved, experimental

Common mistakes to avoid

  • Subtracting 2 hosts for a /31 or /32. The usual usable = total minus 2 rule assumes a separate network and broadcast address. A /31 has only 2 addresses and, under RFC 3021, both are usable on a point-to-point link. A /32 is a single host route. Blindly subtracting 2 gives 0 or a negative count, which is wrong.
  • Confusing the subnet mask with the wildcard mask. The subnet mask has the network bits set to 1 (255.255.255.0 for a /24). The wildcard mask is its exact inverse (0.0.0.255) and is what many access-control lists and OSPF rules want. Pasting one where the other is expected silently matches the wrong addresses.
  • Assuming the entered IP is the network address. Typing 192.168.1.10/24 does not make 192.168.1.10 the network. The calculator masks the host bits off, so the network is 192.168.1.0. Any address inside the block resolves to the same network and broadcast.
  • Forgetting that a bigger prefix means a smaller network. A larger prefix number fixes more bits as network and leaves fewer for hosts, so /26 is smaller than /24. It is easy to read /26 as bigger because the number is larger, when it actually holds only 64 addresses against 256.
  • Sizing every VLSM subnet the same instead of matching actual host counts. Forcing every subnet in a design to use one prefix wastes addresses when segments need very different host counts. VLSM lets a 200-host office use a /24 while a 2-host router link uses a /30 from the same parent block, and checking each candidate in an ip subnet calculator before deploying it avoids overlap.
  • Mixing up the prefix length with the number of subnets it creates. Borrowing 2 bits from a /24 to make /26 subnets creates 4 subnets, not 2 or 26. The number of subnets from borrowing n bits is 2^n, and it is easy to confuse that with the new prefix number itself when planning a subnetting scheme by hand.

Glossary

CIDR prefix
The number after the slash, from 0 to 32, giving how many leading bits of the address form the network portion.
Subnet mask
A 32-bit value with the network bits set to 1 and host bits set to 0, such as 255.255.255.0 for a /24.
Wildcard mask
The bitwise inverse of the subnet mask, used by access-control lists and some routing protocols.
Network address
The first address in a block, with all host bits set to 0, identifying the subnet itself.
Broadcast address
The last address in a block, with all host bits set to 1, used to reach every host on the subnet.
Usable host
An address that can be assigned to a device, excluding the network and broadcast addresses in most prefixes.
VLSM
Variable length subnet masking, the practice of using different prefix lengths for different subnets carved from the same parent block, instead of one fixed size for all of them.
Classful addressing
The pre-1993 scheme that fixed IPv4 networks into Class A, B or C sizes with no flexibility in between, replaced in practice by CIDR.

Frequently asked questions

What does an IP subnet calculator actually do?

An ip subnet calculator takes an IPv4 address and a CIDR prefix and works out the subnet mask, wildcard mask, network address, broadcast address, and the range and count of usable host addresses in that block, all using bitwise math.

What does the slash and number in 192.168.1.10/24 mean?

The number after the slash is the CIDR prefix length. It is how many of the 32 bits in the address, counting from the left, belong to the network. A /24 means the first 24 bits are the network and the remaining 8 bits are available for hosts, giving 256 total addresses.

Why does a /24 have 254 usable hosts and not 256?

A /24 holds 256 addresses, but two of them are reserved: the network address (all host bits 0) and the broadcast address (all host bits 1). Neither can be assigned to a device, so 256 minus 2 leaves 254 usable host addresses.

How do I work out the subnet mask from the prefix?

Set the leftmost bits equal to the prefix length to 1 and the rest to 0, then read off the four octets. A /24 is 24 ones then 8 zeros, which is 255.255.255.0. A /26 is 255.255.255.192. The calculator does this conversion for you.

What is the difference between a subnet mask and a wildcard mask?

They are exact inverses. The subnet mask marks network bits with 1 (255.255.255.0), while the wildcard mask marks host bits with 1 (0.0.0.255). Subnet masks appear in interface configuration, while wildcard masks appear in access-control lists and protocols like OSPF.

How are /31 and /32 handled?

A /31 has just two addresses, and RFC 3021 allows both to be used as hosts on a point-to-point link, so this tool reports 2 usable hosts and no separate broadcast. A /32 is a single address, a host route to one machine, reported as 1 usable host.

What is VLSM and why would I use it instead of one fixed subnet size?

VLSM (variable length subnet masking) lets you assign different prefix lengths to different subnets carved from the same parent block, so a 200-host office and a 2-host router link each get a subnet sized to their actual need instead of both taking the same oversized block.

How many subnets does borrowing extra bits create?

Borrowing n additional bits from the host portion creates 2^n subnets. Going from a /24 to a /26 borrows 2 bits, which creates 4 equal subnets of 64 addresses each, not 2 or 26 subnets.

What is the difference between classful addressing and CIDR?

Classful addressing fixed networks into Class A (/8), Class B (/16) or Class C (/24) with no in-between sizes, which wasted address space. CIDR, introduced in 1993, replaced fixed classes with any prefix length from /0 to /32, letting network size match actual need.

Does this tool send my IP address anywhere?

No. The calculation is plain bitwise arithmetic on the 32-bit address and runs entirely in your browser with vanilla JavaScript. Nothing you type is uploaded, logged, or sent over the network, so it is safe to use with internal addressing plans.