Free · IPv4 · Instant

IP subnet calculator

Enter an IP address with a CIDR prefix or subnet mask and get the network address, broadcast, usable host range, wildcard mask and a binary breakdown — instantly.

🔒 Calculated locally in your browser.

How to calculate a subnet

⌨️

1. Enter IP / CIDR

Type something like 192.168.1.130/26 — or pick the mask from the dropdown.

📊

2. Read the results

Network, broadcast, first and last usable host, host count, wildcard and full binary view.

📋

3. Copy what you need

Every value has one-click copy — ready for configs and documentation.

Subnetting splits a network into smaller ranges: the prefix length (/26) says how many bits identify the network, and the rest address hosts. A /26 leaves 6 host bits → 64 addresses, 62 usable (network and broadcast are reserved). Common sizes: /24 = 254 hosts (the classic LAN), /30 = 2 hosts (point-to-point links), /32 = a single host route. Check your public address with What Is My IP, or do the binary math by hand with the Number Base Converter.

What the prefix length actually says

CIDR notation such as 192.168.1.0/24 states how many leading bits identify the network, leaving the rest to identify hosts. A /24 fixes 24 bits and leaves 8, giving 256 addresses. Each additional bit halves the block: /25 is 128 addresses, /26 is 64, and so on.

Two addresses in each block are conventionally unusable. The all-zeros host address identifies the network itself, and the all-ones address is the broadcast address, so usable hosts number 2ʰ − 2. A /24 provides 254 usable addresses, and a /30 — four addresses — provides just two, which is why /30 was long the standard for point-to-point links.

RFC 3021 permits /31 for point-to-point links specifically, where the broadcast concept is meaningless because there are only two endpoints. That yields two usable addresses from two, halving address consumption on router links. A /32 represents a single host and is used for loopbacks and specific-host routes.

Subnetting without wasting addresses

Splitting a network means borrowing bits from the host portion. Dividing a /24 into four subnets requires two extra bits, producing four /26 blocks of 62 usable hosts each. Borrowing three bits gives eight /27 blocks of 30 hosts.

Fixed-size subnetting wastes addresses whenever segments differ in size, which they almost always do. Variable-length subnet masking allocates each segment only what it needs — a /26 for an office of 50 machines, a /30 for a router link — and it is what makes efficient use of a limited range possible.

Blocks must be aligned to their own size, which is the constraint people most often violate. A /26 can begin at .0, .64, .128 or .192 and nowhere else. Starting one at .50 is not a valid subnet, even though it looks like it should work, and equipment will reject it.

Private ranges, NAT and IPv6

RFC 1918 reserves three ranges for private use: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. They are not routed on the public internet, which is why home and office networks use them behind network address translation. Note that the 172 range is a /12 — 172.16.0.0 to 172.31.255.255 — not the whole 172 space, a boundary frequently misremembered.

Two other ranges are worth recognising: 127.0.0.0/8 for loopback, and 169.254.0.0/16 for link-local addresses, which a machine self-assigns when DHCP fails. An interface showing a 169.254 address means no DHCP server answered, and that diagnosis alone resolves a great many connectivity problems.

IPv6 changes the arithmetic entirely. A standard /64 subnet holds roughly 1.8 × 10¹⁹ addresses, so subnetting is about hierarchy and routing rather than conservation, and the convention is to allocate a /64 to every network segment regardless of size. Sites typically receive a /48 or /56, leaving ample room to delegate.

Subnet calculator FAQ

How many usable hosts are in a /24?

A /24 has 8 host bits → 256 addresses. Two are reserved (network and broadcast), so 254 are usable for devices.

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) writes the subnet mask as a prefix length: 192.168.1.0/24 means the first 24 bits are the network part — the same as netmask 255.255.255.0.

What is a wildcard mask?

The inverse of the subnet mask, used in Cisco ACLs and OSPF configs: for /24 the mask is 255.255.255.0 and the wildcard is 0.0.0.255.

Why are the first and last addresses reserved?

The first address (all host bits 0) names the network itself; the last (all host bits 1) is the broadcast address. Exception: /31 point-to-point links use both addresses (RFC 3021).

Why are two addresses unusable in each subnet?

The all-zeros address identifies the network and the all-ones address is the broadcast address, so usable hosts are 2ʰ − 2. The exception is /31 on point-to-point links under RFC 3021, where both addresses are usable.

Why is my subnet rejected as invalid?

Blocks must be aligned to their own size. A /26 can start only at .0, .64, .128 or .192 — starting at an arbitrary address is not a valid network boundary.