Skip to content
Calcipedia

IP Subnet Calculator

Use this IP subnet calculator to convert IPv4 CIDR prefixes or subnet masks into network address, broadcast address, first and last usable host, wildcard mask.

Last updated

IP subnet calculator Calculate an IPv4 subnet from a CIDR prefix or dotted subnet mask, then compare the network address, broadcast address, first and last usable host, wildcard mask, host count, and binary breakdown.

Common subnet presets

Current subnet: 192.168.1.0/24 uses 24 network bits and 8 host bits.

Planning notes

Cloud VPCs can reserve provider-specific addresses inside each subnet, so the raw IPv4 usable host count may be higher than the number a cloud platform lets you attach to instances.

Wildcard masks are the inverse of subnet masks and are commonly used in ACLs, firewall rules, and routing policy syntax.

Result

192.168.1.0/24

This private subnet is a common LAN or VLAN size. Check the usable host count against DHCP pools, gateways, printers, servers, and growth room.

254

Usable hosts

256

Total addresses

/24

CIDR prefix

255.255.255.0

Subnet mask

IP Address192.168.1.100
Network Address192.168.1.0
Broadcast Address192.168.1.255
First Usable IP192.168.1.1
Last Usable IP192.168.1.254
Usable Host Range192.168.1.1 – 192.168.1.254
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
CIDR Prefix/24
Network / Host Bits24 / 8
IP ClassC
IP TypePrivate
Binary IP11000000.10101000.00000001.01100100
Binary Mask11111111.11111111.11111111.00000000
Binary Network11000000.10101000.00000001.00000000

Subnet cheat sheet

CIDRMaskAddressesUsableTypical use
/16255.255.0.065,53665,534Large private block or route summary
/22255.255.252.01,0241,022Small business or cloud tier
/24255.255.255.0256254Common LAN or VLAN
/27255.255.255.2243230Small department subnet
/30255.255.255.25242Router-to-router link
/31255.255.255.25422RFC 3021 point-to-point link
/32255.255.255.25511Single host route
← All IP Subnetting calculators

IPv4 Subnetting

IP subnet calculator guide: CIDR, subnet masks, host ranges, wildcard masks

An IP subnet calculator shows how an IPv4 address and prefix length divide a network into network bits and host bits. This page also explains the main assumptions behind the ip subnet calculator result, highlights the supporting figures shown by the calculator, and helps the reader use the estimate without overstating what a quick online tool can prove.

What subnetting changes

Subnetting takes a larger IPv4 address block and defines how much of it belongs to the network portion and how much is left for host addresses. In CIDR notation, that split is written as a prefix such as /24 or /27. A larger prefix leaves fewer host bits available, which reduces the number of addresses inside the subnet while creating a more specific route.

This is why a subnet calculator is useful in day-to-day network planning. It answers common questions such as what subnet a host belongs to, how many usable hosts are available, what the first and last host addresses are, and whether an entered address is in private, public unicast, loopback, link-local, shared address, documentation, multicast, or reserved space.

The calculator works from either a CIDR prefix or a dotted-decimal subnet mask, because network documentation, router interfaces, cloud consoles, access control lists, and exam questions do not always use the same notation. Showing both forms helps users move between a route such as 192.168.1.0/24 and a subnet mask such as 255.255.255.0 without losing the underlying binary meaning.

Core subnet formulas

Most subnetting maths comes from counting host bits. Once the prefix length is known, the remaining bits determine the total address count. For ordinary IPv4 subnets, the network address and broadcast address are reserved, so the usable host count is usually two less than the total.

The network address is found by applying a bitwise AND between the IPv4 address and the subnet mask. The broadcast address is the network address with all host bits set to 1. The wildcard mask is the inverse of the subnet mask, so it highlights the host-bit positions that can vary inside the block.

Host bits = 32 - Prefix length

IPv4 addresses are 32 bits long, so the prefix length tells you how many bits are fixed for the network and how many remain for hosts.

Total addresses = 2^(32 - Prefix length)

This gives the size of the subnet in raw addresses before any special-case exclusions are applied.

Usable hosts = 2^(32 - Prefix length) - 2

For most IPv4 subnets, the all-zero network address and all-one broadcast address are not assigned to ordinary hosts.

Wildcard mask = 255.255.255.255 - Subnet mask

This inverted mask is commonly used when writing ACLs, firewall rules, and routing policy matches.

Worked example: 192.168.1.100/24

Suppose a host has the address 192.168.1.100/24. The /24 prefix means 24 network bits and 8 host bits. The subnet mask is 255.255.255.0, the wildcard mask is 0.0.0.255, and the network address is 192.168.1.0.

Because 8 host bits give 2^8 total addresses, the block contains 256 raw addresses. In an ordinary /24 subnet, the first address identifies the network and the last address is the broadcast address, leaving 254 usable host addresses from 192.168.1.1 through 192.168.1.254.

That interpretation is what many users are really trying to confirm when they search for an IP range calculator, subnet range calculator, or CIDR host calculator. The headline result gives the clean block, while the detailed rows show the host range, binary mask, wildcard mask, and address type needed for configuration work.

  • Input host: 192.168.1.100
  • CIDR prefix: /24
  • Network address: 192.168.1.0
  • Broadcast address: 192.168.1.255
  • First usable IP: 192.168.1.1
  • Last usable IP: 192.168.1.254
  • Usable hosts: 254

Special cases such as /31 and /32

Subnetting is not always as simple as subtracting two addresses. A /32 identifies one exact host address, so there is no separate broadcast address and the host range collapses to that single address. A /31 is a special point-to-point case used on suitable routed links, where both addresses can be treated as usable endpoints.

This is one reason a good IP subnet calculator is more reliable than mental arithmetic alone. It can account for the practical edge cases while still showing the binary mask, wildcard mask, and CIDR form that engineers need for configuration work.

For traditional point-to-point links, a /30 remains common because it gives two usable host addresses plus network and broadcast addresses. A /31 is more address-efficient when the devices and operating environment support the point-to-point behaviour described in RFC 3021.

  • A /24 subnet has 256 total addresses and 254 usable host addresses.
  • A /30 subnet has 4 total addresses and 2 usable host addresses.
  • A /31 subnet is commonly used on point-to-point links under RFC 3021.
  • A /32 represents one exact IPv4 host route.

Private ranges, public ranges, and special address space

Many everyday subnetting tasks involve RFC 1918 private space such as 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. These ranges are intended for internal addressing rather than public Internet routing. A web calculator that identifies address type helps avoid confusion when planning internal VLANs, lab networks, and office addressing.

Special-purpose address ranges matter too. Loopback addresses, link-local addresses, shared address space used by carrier-grade NAT, documentation ranges, multicast ranges, and reserved or experimental ranges can all appear in examples, logs, or configuration snippets. Flagging those ranges reduces the risk of treating a non-routable or documentation-only address like a normal public unicast address.

For practical network design, the most useful outputs are usually the CIDR block, the dotted-decimal subnet mask, the first and last usable host, the wildcard mask, and the total host count. Those values make this kind of subnet mask calculator and CIDR calculator useful for routing tables, firewall rules, DHCP scopes, and general troubleshooting.

Further reading

Using subnet results for planning, VLSM, and cloud networks

A single-subnet result is often the first step in a larger addressing plan. For VLSM planning, allocate the largest required subnets first, then move down to smaller departments, point-to-point links, lab ranges, or management networks. This avoids leaving fragmented gaps that are too small for later requirements.

Cloud subnets need an extra caution. Some providers reserve a small number of addresses inside each subnet for network infrastructure, so a /24 may not expose the same assignable instance count as a pure IPv4 calculation. Treat the calculator's total and usable host count as the protocol-level baseline, then compare it with the platform's own subnet reservation rules before finalising a VPC, VNet, or security-group plan.

For troubleshooting, compare the host IP, subnet mask, default gateway, and route table together. Devices with different masks may believe different addresses are local, which can create confusing one-way reachability, wrong gateway decisions, or DHCP pool overlap even when each individual address looks valid.

Frequently asked questions

What does CIDR notation mean?

CIDR (Classless Inter-Domain Routing) notation writes the subnet mask as a prefix length after a slash, such as /24. The number indicates how many of the 32 IPv4 bits are set to 1 for the network portion. A /24 network has 24 network bits and 8 host bits, giving 256 total addresses before ordinary network and broadcast exclusions.

How many usable hosts does a subnet have?

Usable host count usually equals 2 raised to the power of the host bits, minus 2. The first address is the network address and the last is the broadcast address, so neither is assigned to an ordinary host. For a /24, host bits equal 8, so 2 to the power of 8 equals 256 total, minus 2 equals 254 usable hosts. /31 and /32 are special cases.

What is the difference between a network address and a broadcast address?

The network address is the first address in the subnet range. It identifies the subnet itself and normally cannot be assigned to a host. The broadcast address is the last address and is used to reach all hosts on that subnet simultaneously. Ordinary IPv4 LAN subnets reserve both values, while /31 point-to-point links and /32 host routes behave differently.

What are private IP address ranges?

Private ranges are 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16 under RFC 1918. They are reserved for internal networks and are not routed over the public internet. Most home and office networks use private ranges with NAT (Network Address Translation) to share one or more public IP addresses among internal devices.

What is a wildcard mask?

A wildcard mask is the inverse of the subnet mask. For example, the subnet mask 255.255.255.0 has the wildcard mask 0.0.0.255. In many Cisco-style ACLs and routing policy examples, zero bits mean the corresponding address bit must match and one bits mean the bit can vary.

Is /24 the same as 255.255.255.0?

Yes. /24 and 255.255.255.0 describe the same subnet mask. The CIDR prefix says that the first 24 bits are network bits, while the dotted-decimal mask writes those same 24 one-bits as three full 255 octets followed by a zero octet.

Why does a /31 have two usable addresses?

A /31 leaves one host bit, so there are two possible addresses. Historically those two values looked like network and broadcast addresses, but RFC 3021 allows both to be interpreted as host addresses on point-to-point links. That makes /31 useful for conserving IPv4 addresses on router-to-router links when the devices support it.

What is a /32 subnet used for?

A /32 identifies one exact IPv4 address. It is commonly used for host routes, firewall allowlists, loopback interfaces, monitoring targets, and configuration entries where the intention is to match one address rather than a broader subnet.

Can this calculator split one network into many VLSM subnets?

This page calculates one IPv4 subnet at a time. You can still use it during VLSM planning by checking each proposed prefix, starting with the largest host requirement and then moving to smaller blocks. It does not automatically allocate a full multi-subnet plan or check every overlap across an address-management spreadsheet.

Why can cloud subnet host counts differ from the calculator?

The calculator shows protocol-level IPv4 results: network address, broadcast address, and usable host range for the block itself. Cloud providers can reserve additional addresses inside each subnet for gateways, DNS, platform services, or future use. Always compare the raw subnet result with the provider's own reservation rules before sizing production cloud networks.

How do I know whether an IP address belongs to a subnet?

Apply the subnet mask to both the IP address and the subnet's network address. If the masked results match, the IP is inside that subnet. The calculator performs that bitwise operation for the entered address and prefix, then shows the resulting network address and host range so you can compare the value directly.

Guides

Featured in articles

Step-by-step guides that use this calculator to solve real problems.

Related

More from nearby categories

These related calculators come from the same leaf category, nearby sibling categories, or the same top-level topic.