IP Subnet Calculator

Enter an IPv4 address and CIDR prefix to get the network address, broadcast address, usable host count and subnet mask.

What Is IP Subnet Calculator

An IP subnet calculator splits a network: 192.168.1.0/24 → network 192.168.1.0, broadcast 192.168.1.255, mask 255.255.255.0, 254 usable hosts. The CIDR prefix says how many bits are network; the rest are host bits (2^8 − 2 = 254, minus network and broadcast). /31 and /32 are special-cased (point-to-point links and single hosts).

How to Use

  1. Enter the IPv4 address.
  2. Enter the CIDR prefix (0–32).
  3. Click “Calculate Subnet”.

Formula

Hosts = 2^(32−CIDR) − 2 (except /31 → 2, /32 → 1).

Worked Example

192.168.1.0/24: network 192.168.1.0; broadcast 192.168.1.255; mask 255.255.255.0; usable hosts 254.

How It Works, In Plain Words

An IPv4 address is really a 32-bit number written as four blocks, like 192.168.1.0. The CIDR prefix tells the calculator where to draw the line inside that number: the first so-many bits name the network itself, and the remaining bits are free to vary from device to device. With a /24 prefix, 24 bits are network bits and 8 are host bits. Everything else follows from that one split. The subnet mask is the split written out in full — 24 ones followed by 8 zeros — which reads as 255.255.255.0. The network address is what you get when every host bit is set to 0: 192.168.1.0, the name of the network itself. The broadcast address is the opposite extreme, every host bit set to 1: 192.168.1.255, the address used to speak to all devices at once. The 8 host bits give 2^8 = 256 combinations in total, and because the first and last are reserved for those two special addresses, the usable hosts come to 256 − 2 = 254. The two inputs are all the tool needs: any address inside the network, plus its prefix.

Real-World Uses

A home user is giving a network printer a fixed address so it always stays in the same place. Their router uses a /24 network, and the calculator confirms which addresses sit safely inside 192.168.1.0/24 and which two ends are off-limits, so they choose an address in between instead of accidentally grabbing the broadcast address. A networking student revising for an exam works subnet questions out by hand, then checks each one here — network, broadcast, mask and host count side by side — which makes a wrong answer easy to spot and to understand. An office administrator setting up a small network uses it to confirm that a /24, with its 254 usable addresses, leaves enough room for the computers, phones and printers that will connect, before configuring anything at all.

Benefits

  • Network, broadcast, mask and hosts together
  • /31 and /32 handled
  • Input validation
  • Useful for networking study and setup

Features of Our Tool

  • Instant results in your browser
  • No sign-up, no download, 100% free
  • Works on mobile, tablet and desktop
  • Clear step-by-step explanation below the tool
  • Private — your entries never leave your device

Common Mistakes

  • Forgetting to subtract network and broadcast (254, not 256)
  • Mixing up the mask and the wildcard
  • Assuming /24 always — check the actual prefix

Common Mistakes to Avoid

The classic error is forgetting the two reserved addresses and announcing that a /24 holds 256 hosts. It holds 254 usable ones, because the network and broadcast addresses cannot be given to devices. Next, do not mix up the subnet mask with the wildcard mask: the two are mirror images of each other, and some equipment asks for one while other equipment asks for the other. Third, never assume the prefix is /24 simply because home networks often use it — read the actual prefix from the router or from whoever assigned the address, because one wrong number changes every result. Finally, never assign a device the network or broadcast address itself: both are reserved, and the device simply will not work on the network.

FAQ

How many hosts in a /24?

254 usable.

What is the subnet mask of /24?

255.255.255.0.

What are network and broadcast addresses?

The first (all host bits 0) and last (all 1s) — not assignable to devices.

What is CIDR?

Classless Inter-Domain Routing: the /n says how many bits are the network part.

What is a /32?

A single host address — 1 usable.

What are the first and last usable addresses in 192.168.1.0/24?

192.168.1.1 is the first usable address and 192.168.1.254 is the last — everything between the network address (192.168.1.0) and the broadcast address (192.168.1.255) can be given to devices.

Does this calculator work with IPv6?

No. This calculator is for IPv4, whose addresses are 32 bits long. IPv6 addresses are written differently and are far longer, so they need a different tool.

Related Calculators