ToolNimba Browse

🌐 IP Subnet Calculator (CIDR)

By ToolNimba Web Dev Team · Updated 2026-06-19

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

A 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.

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. 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. This 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.

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.
  • Studying for networking certifications (CCNA, Network+) by checking subnetting answers against a known-good calculator.

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.

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 − 24 = 8, so total addresses = 2^8 = 256.
  5. Usable hosts = 256 − 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 − 26 = 6, so total addresses = 2^6 = 64.
  5. Usable hosts = 64 − 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.

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

Common mistakes to avoid

  • Subtracting 2 hosts for a /31 or /32. The usual usable = total − 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.

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.

Frequently asked questions

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.

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.