CalcSeed

IPv4 Subnet Calculator

Enter an IPv4 address and a CIDR prefix length to find its network address, broadcast address and number of usable hosts.

=
Quick answer: with the default inputs (192, 168, 1, 0), the network address is 254. Change any input to update the result.
Network address
—

What this calculator returns

Give it four octets and a CIDR prefix, and it returns the network address, the broadcast address and the number of usable host addresses. The defaults are 192.168.1.0/24, which gives a network of 192.168.1.0, a broadcast of 192.168.1.255 and 254 usable hosts.

Those three numbers are what you need to configure a router, a DHCP scope or a firewall rule. Everything else about a subnet follows from them, including which addresses are legal to assign and which one a host must treat as local broadcast.

How the prefix splits the address

h=32−p,N=2h,Nusable=2h−2h=32-p, N=2^h, N_{usable}=2^h-2

An IPv4 address is 32 bits. A prefix of 24 means the first 24 bits identify the network and the remaining 8 identify hosts, so there are 28 = 256 addresses in the block. Two of those cannot be assigned: the all-zero host part is the network address and the all-one host part is the broadcast address.

The mask is just that split written as four octets. A /24 is 255.255.255.0, because 24 ones followed by 8 zeros gives three full octets of 255 and one of 0. A /26 is 255.255.255.192: 24 ones, then two more ones, then six zeros, and 11000000 is 192.

The network address comes from a bitwise AND between the address and the mask, and the broadcast from OR-ing the network with the inverted mask. Both operations act on the whole 32-bit number at once, which is why they never produce a partial octet.

Worked example: 192.168.1.0/24

Twenty-four network bits leave eight host bits. Two to the eighth power is 256 addresses, from 192.168.1.0 through 192.168.1.255. The first is the network address and the last is the broadcast, so assignable hosts run from 192.168.1.1 to 192.168.1.254, which is 254 addresses.

  • Mask: 255.255.255.0, written /24
  • Block size: 256 addresses, from .0 to .255
  • Reserved: .0 for the network, .255 for broadcast
  • Usable: .1 through .254, a total of 254 hosts

The usual gateway sits at .1 and the DHCP pool covers the middle of the range. Keeping .1 for the router and leaving the top of the range free for printers and servers is convention rather than requirement; the calculator only tells you which addresses exist.

Prefix reference

PrefixMaskHost bitsAddressesUsable
/24255.255.255.08256254
/25255.255.255.1287128126
/26255.255.255.19266462
/27255.255.255.22453230
/28255.255.255.24041614
/29255.255.255.248386
/30255.255.255.252242
/31255.255.255.254122
/32255.255.255.255011

Each step down halves the block and costs two usable addresses. That is why a /30 is the classic point-to-point link: four addresses, two usable, one for each end. The /31 and /32 rows are exceptions handled below.

Carving a network into subnets

A /24 splits neatly into four /26 blocks: .0–.63, .64–.127, .128–.191 and .192–.255. Each has 64 addresses and 62 usable hosts. Put 192.168.1.100/26 into the calculator and it returns a network of 192.168.1.64, a broadcast of 192.168.1.127 and 62 usable hosts, because 100 falls inside the second quarter.

The /31 and /32 exceptions

Strictly, a two-address block has no room for both a network and a broadcast, so /31 would have zero usable hosts. RFC 3021 allows both addresses on point-to-point links, and this calculator follows that convention, reporting 2. A /32 is a single host route with no subnet at all, reported as 1.

Where subnetting goes wrong

  • Writing the mask as a host address, so 255.255.255.0 appears in a device field instead of a prefix
  • Assuming every private network is 192.168.x.x when 10.0.0.0/8 holds 16,777,216 addresses and 172.16.0.0/12 holds 1,048,576
  • Forgetting the two reserved addresses, then planning for 256 hosts in a /24
  • Overlapping subnets across two routers, which produces intermittent reachability rather than an obvious failure
  • Using the broadcast address as a host, which some stacks accept and others silently drop

The 192.168 range is the smallest of the three private blocks at 65,536 addresses, which is why it appears in homes and small offices. It is also the most commonly duplicated, so a VPN that connects two sites both using 192.168.1.0/24 will route unpredictably.

A /32 is the other frequent special case. It routes a single address and is written with a mask of 255.255.255.255, so it appears in firewall rules and in cloud routing tables that point one public IP at a load balancer. There is no network or broadcast address to reserve, which is why the usable count is 1 rather than a negative number.

Sizing a subnet from host count

Work backwards from the largest number of hosts you need. Fifty devices need 52 addresses once the network and broadcast are added, so the next power of two is 64 and the prefix is /26. A hundred devices need 128 addresses, which is /25. Two hundred need 256, which is /24.

Rounding up to a power of two

Round up to the next power of two rather than the nearest, because a /26 holds 62 usable addresses and will not fit 70 devices no matter how the addresses are assigned. Then check that the resulting block does not cross into a neighbouring subnet, since a /26 must start on a multiple of 64.

The same rounding applies downward for links. A routed connection between two routers needs exactly two addresses, so a /30 with four addresses wastes two but keeps the broadcast rule intact. Using a /24 for that link burns 252 addresses that a later site expansion might need.

Frequently asked questions

How many usable hosts are in a /24?

254. A /24 has 256 addresses and two are reserved, so assignable addresses run from .1 to .254.

What is 192.168.1.0/24 in subnet mask form?

255.255.255.0. Twenty-four network bits fill three octets with ones and leave the last octet as zeros.

How many addresses does a /26 contain?

64, of which 62 are usable. The mask is 255.255.255.192 and the block size is 64.

What is the broadcast address of 192.168.1.100/26?

192.168.1.127. The block runs from .64 to .127, and the network address is .64.

Why does a /31 show 2 usable hosts?

Because RFC 3021 permits both addresses on point-to-point links. Strictly there is no broadcast address, so the usual minus-two rule does not apply.

What is 10.0.0.0/8 used for?

It is the largest private block, holding 16,777,216 addresses. It is common in enterprises and in cloud VPC defaults.

How many subnets does a /24 split into as /27s?

Eight, each with 32 addresses and 30 usable hosts. The blocks start at .0, .32, .64 and so on up to .224.

Which prefix do I need for 50 devices?

A /26, which holds 62 usable addresses. A /27 holds only 30, so it is too small.

Can I assign the network address to a device?

No. The all-zero host part identifies the network itself, and hosts treat it as local rather than as a peer. Some stacks will accept the configuration and then fail to communicate.

Is 172.16.0.0 private?

Yes, along with the rest of 172.16.0.0/12, which covers 172.16.0.0 through 172.31.255.255 and holds 1,048,576 addresses.

Method and sources

Calculation basis

Conversions and formats follow the relevant IETF RFCs and IEEE standards, including RFC 4648 for Base64 and RFC 791 for IPv4 addressing.

Last updated: November 17, 2026
Formula & data sources
  • IPv4 addressing and CIDR (RFC 4632) subnetting rules.

Cite this page

Reference formats
APA 7CalcSeed. (2026, November 17). IPv4 Subnet Calculator. https://calcseed.com/c/developer/ipv4-subnet-calculator/
MLA 9"IPv4 Subnet Calculator." CalcSeed, 17 Nov. 2026, calcseed.com/c/developer/ipv4-subnet-calculator/.
ChicagoCalcSeed. "IPv4 Subnet Calculator." Last modified November 17, 2026. https://calcseed.com/c/developer/ipv4-subnet-calculator/

Related calculators

More Developer calculators