Developer Tools calculator

Free IPv4 subnet calculator

Enter an IPv4 address and a CIDR prefix and this IP subnet calculator returns the network address, broadcast address, usable host range, host count, subnet mask, and wildcard mask — for any prefix from /0 to /32, updated live, as you type.

InputsLive
IP address
Prefix length (CIDR)
/
Result
Network
192.168.1.0/24
Mask: 255.255.255.0 · Usable hosts: 254
Network192.168.1.0
Broadcast192.168.1.255
Usable hosts254
Subnet mask255.255.255.0

IPv4 subnetting only. IPv6 subnets have different addressing rules.

Results are estimates. Consult a professional.

What it does

What the IP subnet calculator does

An IP subnet calculator takes an IPv4 address and a CIDR prefix — like 192.168.1.10/24 — and works out everything that prefix implies: the network address, the broadcast address, the usable host range, how many hosts fit, the subnet mask, and the wildcard mask. Subnetting is the act of carving one block of IP addresses into smaller, self-contained networks, and the prefix is the dial that controls how big each piece is.

The tool above runs the math live as you type. Enter an address and a prefix between /0 and /32, and it reports the network (the first address, which names the subnet), the broadcast (the last address), the first and last usable host, the dotted subnet mask and wildcard, and both the total and usable host counts. Nothing is sent to a server — the bit arithmetic happens on your device.

One prefix decides everything
Every figure on this page is derived from just two inputs: the IP and the prefix length. Change the prefix by one and you halve or double the subnet — which is exactly why getting the prefix right matters so much in network design.
How it works

How CIDR notation works

An IPv4 address is 32 bits, usually written as four dotted decimals (each an 8-bit "octet"). CIDR — Classless Inter-Domain Routing — splits those 32 bits into a network part and a host part. The slash number is the prefix length: it counts how many leading bits belong to the network. In /24, the first 24 bits are the network and the last 8 are free for hosts; in /26, 26 bits are network and only 6 are left for hosts.

The prefix is just a compact way of writing the subnet mask — a 32-bit pattern of 1-bits (network) followed by 0-bits (host). A /24 mask is twenty-four 1s then eight 0s, which in dotted decimal is 255.255.255.0. The wildcard mask is the bitwise inverse — the 0s and 1s flipped — so a /24 wildcard is 0.0.0.255. The network address is the IP with every host bit set to 0; the broadcast is the IP with every host bit set to 1.

mask = (0xffffffff << (32 prefix)) & 0xffffffff
network = ip AND mask
broadcast = network OR (NOT mask)
total addresses = 2^(32 prefix)
usable hosts = 2^(32 prefix) 2
CIDR and variable-length prefixes are defined in RFC 4632, "Classless Inter-Domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan" (IETF, 2006). The original subnetting model is RFC 950.
How to use it

How to use the subnet calculator

You only need two things: an IPv4 address and a prefix. The prefix can come from CIDR notation you already have, or you can pick one to fit a target number of hosts.

  1. Enter the IPv4 address. Any address inside the subnet works — you don't need the network address itself. The calculator finds the network for you, so 192.168.1.10 and 192.168.1.200 both resolve to the same /24 network.
  2. Set the CIDR prefix (0–32). Smaller numbers mean bigger subnets: /24 gives 254 usable hosts, /26 gives 62, /30 gives 2.
  3. Read the results. Network and broadcast bracket the subnet; first and last host give the assignable range; the subnet mask and wildcard are ready to paste into router, firewall, or DHCP config.

If you know the subnet mask but not the prefix, convert it: count the 1-bits. 255.255.255.0 is 8 + 8 + 8 + 0 = 24, so it is /24; 255.255.255.192 is 8 + 8 + 8 + 2 = 26, so it is /26. The prefix and the mask are two notations for the same thing.

Quick reference

CIDR prefix, subnet mask, and host count table

This is the table most people come here for: each common prefix, its dotted subnet mask, the total addresses in the block, and how many are usable for hosts. Every step down the table halves the subnet — one more network bit, one fewer host bit.

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
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.120 (2 point-to-point)
/32255.255.255.2550.0.0.010 (single host)

Usable hosts = total − 2 (network + broadcast), except /31 and /32 — see the special cases below. Total addresses = 2^(32 − prefix). Values follow RFC 4632 (CIDR) and RFC 3021 (/31).

The pattern repeats above /24 too. A /16 (255.255.0.0) holds 65,536 addresses with 65,534 usable; a /8 (255.0.0.0) holds 16,777,216 with 16,777,214 usable. Each bit you give back to the network quarters, eighths, and so on the host space.

Example

A worked subnet example: 192.168.1.10/24

Example: 192.168.1.10 with a /24 prefix

Take the calculator's default, 192.168.1.10/24. We'll find the network, broadcast, host range, and counts by hand, then confirm them against the tool.

Step 1 — Split network from host bits

A /24 mask is 255.255.255.0: the first three octets are network, the last octet is host. So the network part is 192.168.1 and the host part is the final .10.

Step 2 — Find the network and broadcast

Set every host bit to 0 for the network: 192.168.1.0. Set every host bit to 1 for the broadcast: 192.168.1.255. These two addresses bracket the subnet and can't be given to a device.

Step 3 — Count the hosts and read the range

The block holds 2^8 = 256 addresses. Subtract the network and broadcast for 254 usable hosts, running from 192.168.1.1 to 192.168.1.254.

192.168.1.0/24 — 254 usable hosts, .1 to .254
The calculator shows exactly this: network 192.168.1.0, broadcast 192.168.1.255, mask 255.255.255.0, wildcard 0.0.0.255, and 256 total / 254 usable addresses.

Now tighten it to a /26

Change the prefix to /26 and the mask becomes 255.255.255.192. Now 26 bits are network and 6 are host, so the block is 2^6 = 64 addresses. 192.168.1.10 still falls in the first sub-block, whose network is 192.168.1.0 and broadcast is 192.168.1.63 — giving 62 usable hosts from 192.168.1.1 to 192.168.1.62. The same /24 space now splits into four equal /26 subnets (.0, .64, .128, .192).

The three addresses

Network vs broadcast vs usable hosts

Every subnet reserves its first and last address for special roles, which is why the usable count is always two short of the total. Understanding the three roles is the difference between a working network and a subtle misconfiguration.

  • Network address (first address). All host bits 0. It names the subnet itself — it's what appears in routing tables — and is never assigned to a device.
  • Broadcast address (last address). All host bits 1. A packet sent here reaches every host on the subnet at once. It can't be a device's own address.
  • Usable host addresses (everything between). These are the addresses you actually assign to computers, phones, printers, and router interfaces. For a /24 that's the 254 addresses from .1 to .254.
Why "− 2"?
Usable hosts = 2^(host bits) − 2. The two subtracted are the network and broadcast addresses. A /24 has 256 addresses but only 254 usable; a /30 has 4 but only 2 — just enough for the two ends of a point-to-point link.
Ranges & edge cases

Private ranges and the /31 and /32 special cases

Most subnets you'll calculate sit inside the private address ranges set aside by RFC 1918 — the addresses that never route on the public internet and that home and office networks use freely behind NAT.

Private blockCIDRAddress rangeTypical use
10.0.0.0/8/810.0.0.0 – 10.255.255.255Large enterprise networks
172.16.0.0/12/12172.16.0.0 – 172.31.255.255Mid-size networks, many cloud VPCs
192.168.0.0/16/16192.168.0.0 – 192.168.255.255Home and small-office LANs

The three RFC 1918 private IPv4 ranges. Addresses inside them are non-routable on the public internet and reusable on any private network.

Two prefixes break the usual "− 2" rule, and the calculator handles both:

  • /31 — two addresses, both usable. On a point-to-point link there's no need for a broadcast address, so RFC 3021 lets a /31 assign both of its two addresses to the two ends. The calculator marks 0 "usable" under the classic rule but the block still works for a router-to-router link.
  • /32 — a single host. The mask 255.255.255.255 matches exactly one address. It's used for loopbacks, host routes, and firewall rules that target one machine — a network of one.
Private IPv4 ranges are reserved by RFC 1918, "Address Allocation for Private Internets" (IETF, 1996). The /31 point-to-point exception is RFC 3021.
In practice

Use cases and common subnetting mistakes

Subnet math shows up anywhere addresses are allocated or filtered. A few jobs come up constantly:

  • Network design. Right-size each subnet to the number of devices it holds, so you don't waste a /24 on a link that needs four addresses.
  • Firewall and ACL rules. Express "this whole subnet" as a single CIDR block instead of listing every address — and use the wildcard mask in routers (Cisco ACLs) that expect it instead of a subnet mask.
  • VLANs and segmentation. Map each VLAN to its own subnet to keep broadcast domains small and traffic isolated.
  • Cloud VPCs. Plan non-overlapping CIDR blocks before you launch, because resizing a live VPC subnet is painful.

And the mistakes that bite most often:

  • Forgetting the − 2. A /29 has 8 addresses but only 6 usable hosts. Plan for the usable count, not the total.
  • Off-by-one on the prefix. A /25 is not "half a /24 minus a bit" — it's exactly 128 addresses, 126 usable. Each bit halves the block, so a single-digit slip quarters or doubles your space.
  • Assigning the network or broadcast address. Handing .0 or .255 (on a /24) to a device causes hard-to-trace failures.
  • Overlapping subnets. Two blocks that share addresses break routing — always confirm new subnets don't collide with existing ones.
Encoding ≠ filtering
CIDR describes which addresses belong to a subnet; it doesn't secure anything by itself. A subnet boundary is an organizing tool — real isolation comes from firewall rules, VLANs, and routing policy built on top of it.
Definitions

IP subnet definitions

The number after the slash in CIDR notation. It counts how many leading bits of the 32-bit address belong to the network. The rest are host bits. A larger prefix means a smaller subnet.
A 32-bit pattern of network 1-bits followed by host 0-bits, written in dotted decimal (e.g. 255.255.255.0). It's the same information as the CIDR prefix in a different notation.
The bitwise inverse of the subnet mask (e.g. 0.0.0.255 for a /24). Used by some routers, notably in Cisco access control lists, where the mask is expressed as the bits that may vary.
The first address of a subnet, with all host bits set to 0. It names the subnet in routing tables and is never assigned to a device.
The last address of a subnet, with all host bits set to 1. A packet sent to it reaches every host on the subnet, so it can't be a device's own address.
The addresses you can actually assign to devices: total addresses minus the network and broadcast. For most prefixes this is 2^(host bits) − 2.
Accuracy

How accurate is this subnet calculator?

The math is exact. Network, broadcast, mask, wildcard, and host counts are computed with the same bitwise operations defined in the CIDR standard, so the calculator agrees digit for digit with any correct subnet tool. There's no rounding and no estimate — a /24 always resolves to 256 total and 254 usable addresses.

This tool covers IPv4 only. IPv6 follows the same prefix principle but in a vastly larger 128-bit space, where subnets are typically /48, /56, or /64. For related transfer math, see our bandwidth calculator and download time calculator.

Address and prefix arithmetic follows RFC 4632 (CIDR) and RFC 950 (subnetting); private ranges follow RFC 1918.
Questions

Frequently asked questions about the free IPv4 subnet calculator

An IP subnet calculator is a free online tool that helps you calculate IPv4 network address, broadcast, usable host range, and subnet mask from CIDR notation. CIDR notation `IP/prefix` defines a subnet by the number of leading 1-bits in the mask. The network address is IP AND mask; broadcast is IP OR ~mask. It runs entirely in your browser with instant results and no sign-up.
The first address is the network identifier; the last is the broadcast address. Neither is assignable to a host. /31 (RFC 3021) waives this for point-to-point links.
/24 has 256 addresses (254 usable). /25 splits that in half: 128 addresses (126 usable) per subnet. Each additional bit halves the subnet size.
Same principle but vastly larger address space. This calculator covers IPv4 only; IPv6 typically uses /48, /56, or /64 subnets.
About

About this IP subnet calculator

This IPv4 subnet calculator runs entirely in your browser. The address and prefix you enter are never stored, logged, or sent to any server — the network, broadcast, host range, subnet mask, and wildcard are computed locally with plain bit arithmetic, so the tool works the same offline.

It is one of our free developer tools. Browse the full set on the all calculators page.

Want a calculator built for your business?

Customize any of our 400+ tools to match your brand, or commission a new one tailored to how your business actually calculates — pricing, payroll, quotes, anything. Deployed on your domain, math runs in your visitors' browsers.