Free tool

IPv4 subnet calculator (CIDR, mask & IP range)

IP Subnet Calculator

Free, no sign-up. We only fetch the public URL you enter.

Short answer

Enter an IPv4 address in CIDR notation (192.168.1.0/24) or as address plus subnet mask (10.0.0.5 255.255.255.0). The calculator returns the network address, broadcast address, subnet mask, wildcard mask, first and last host address, the number of usable hosts, the address class and whether the range is private or public. A /24 gives 256 addresses, 254 of them usable for hosts. If the servers in that range run websites, monitordefend can watch them for downtime.

  • Accepts CIDR (/8 to /32) or dotted subnet mask.
  • Network, broadcast, mask, wildcard, host range, usable hosts.
  • Shows address class and private or public range.
IPv4 subnet · example result
192.168.1.0/24
Network        192.168.1.0
Broadcast      192.168.1.255
Subnet mask    255.255.255.0
Wildcard mask  0.0.0.255
Host range     192.168.1.1 – 192.168.1.254
Usable hosts   254 · Class C · private
One CIDR block, every value you need to configure a network.

This free IPv4 subnet calculator turns an address and a prefix into everything you need to plan a network: the network address, the broadcast address, the subnet mask in dotted notation, the wildcard mask, the first and last usable host, the number of usable hosts, the historic address class and whether the range is private or public. Type a CIDR block such as 192.168.1.0/24 or an address with a mask such as 10.0.0.5 255.255.255.0, and the result appears instantly — no sign-up, no spreadsheet, no binary arithmetic on paper.

What is a subnet calculator?

A subnet calculator is a tool that takes an IP address and a subnet mask — or the equivalent CIDR prefix — and works out the boundaries of the network that address belongs to. Instead of converting four octets into 32 bits by hand and applying a logical AND, you get the network address, the broadcast address, the usable host range and the size of the block in one step.

Network administrators use it to split a large address space into smaller subnets for departments, VLANs or server zones. Developers and DevOps engineers use it when they define virtual networks in the cloud, write firewall rules, configure Kubernetes pod and service ranges or describe infrastructure as code, where a single wrong prefix can make two networks overlap and break routing in ways that are hard to debug later.

How to use the IPv4 subnet calculator

Type the address into the field above in one of two formats. CIDR notation writes the address followed by a slash and the number of network bits, for example 192.168.1.0/24 or 10.20.0.0/16. Alternatively, write the address and the dotted subnet mask separated by a space, for example 10.0.0.5 255.255.255.0. Both formats describe the same thing, so use whichever your router, firewall or cloud console shows you.

  1. Address 192.168.1.77
  2. Prefix /26 = 26 network bits
  3. Network 192.168.1.64
  4. Hosts .65 – .126 (62 usable)
The prefix length decides which bits belong to the network and which to the hosts.

You do not need to enter the network address itself. If you type any host address such as 192.168.1.77/26, the calculator determines the block that address sits in and shows its network address, 192.168.1.64, together with all the other values. That makes it handy for answering the everyday question of which subnet a particular machine is in and which neighbours share it.

CIDR notation and the subnet mask

Classless Inter-Domain Routing, CIDR for short, replaced the rigid class system in the 1990s. The number after the slash says how many of the 32 bits of an IPv4 address belong to the network part; the remaining bits number the hosts. A /24 therefore leaves 8 host bits, which is 2 to the power of 8, or 256 addresses.

The subnet mask expresses the same split in dotted decimal: a one for every network bit, a zero for every host bit. /24 becomes 255.255.255.0, /26 becomes 255.255.255.192 and /30 becomes 255.255.255.252. Many older devices only accept the dotted mask, while cloud platforms and routing tables almost always use the prefix, so being able to switch between the two is a daily need.

How the calculation works

Behind every result is simple binary logic. The network address is the address combined with the mask by a bitwise AND, which sets all host bits to zero. The broadcast address sets all host bits to one. Every address in between can be given to a device, which is why the first host is the network address plus one and the last host is the broadcast address minus one.

192.168.1.77/26 in binary
Address  11000000.10101000.00000001.01|001101
Mask     11111111.11111111.11111111.11|000000
Network  11000000.10101000.00000001.01|000000  = .64
Broadc.  11000000.10101000.00000001.01|111111  = .127
All host bits zero gives the network address, all host bits one gives the broadcast address.

The number of usable hosts follows from the host bits: 2 to the power of the host bits, minus two for the network and broadcast addresses. A /26 has 6 host bits, so 64 addresses and 62 usable hosts. Two special cases break that rule. A /31 has only two addresses and, under RFC 3021, both may be used on point-to-point links between two routers. A /32 describes exactly one address and is used for single hosts, loopbacks and firewall rules.

The wildcard mask

The wildcard mask is the bitwise inverse of the subnet mask: zeros where the mask has ones and the other way round. For 255.255.255.0 it is 0.0.0.255, for 255.255.255.192 it is 0.0.0.63. A zero means this bit must match, a one means this bit can be anything.

You need it mainly for access control lists and routing protocols on network equipment, for example in OSPF network statements or ACL entries on enterprise routers, which expect the wildcard form rather than the subnet mask. Calculating it by hand is a common source of typos, so the calculator shows it next to the mask.

Table of typical IPv4 subnets

The table lists the prefix lengths you meet most often, with their dotted mask, the total number of addresses and the usable hosts. Halving or doubling is the rule of thumb: every additional bit of prefix halves the block, every bit less doubles it.

/24 254 usable hosts
/25 126 usable hosts
/26 62 usable hosts
/27 30 usable hosts
/28 14 usable hosts
/29 6 usable hosts
Every extra prefix bit halves the block and costs two more addresses per subnet.
CIDRSubnet maskAddressesUsable hostsTypical use
/8255.0.0.016,777,21616,777,214Very large network, former class A
/12255.240.0.01,048,5761,048,574Private range 172.16.0.0/12
/16255.255.0.065,53665,534Medium network, former class B, cloud VPC
/20255.255.240.04,0964,094Large cloud subnet
/22255.255.252.01,0241,022Campus or large office segment
/24255.255.255.0256254Small network, former class C, home LAN
/25255.255.255.128128126Half of a /24
/26255.255.255.1926462Quarter of a /24
/27255.255.255.2243230Small department or VLAN
/28255.255.255.2401614Very small subnet, small server group
/29255.255.255.24886Small public block from a provider
/30255.255.255.25242Classic point-to-point link
/31255.255.255.25422 (RFC 3021)Router-to-router links
/32255.255.255.25511Single host, loopback, firewall rule

IP address classes

Before CIDR, the first bits of an address fixed the size of its network. Class A covered 1.0.0.0 to 126.255.255.255 with a /8 mask, class B 128.0.0.0 to 191.255.255.255 with a /16, class C 192.0.0.0 to 223.255.255.255 with a /24. Class D, 224.0.0.0 to 239.255.255.255, is reserved for multicast, and class E above that for experimental use.

Classes no longer determine routing, but they are still taught, asked about in certifications and used as shorthand, which is why the calculator reports the class the address falls into. Treat it as a label, not as a statement about the real size of the network — 10.1.2.0/24 is a class A address in a block of only 256 addresses.

Private and public address ranges

RFC 1918 reserves three ranges for private networks: 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. These addresses are not routed on the public internet and can be reused in any number of separate networks; devices reach the internet through network address translation. Everything else is, with a few special exceptions such as loopback 127.0.0.0/8, link-local 169.254.0.0/16 and the carrier-grade NAT range 100.64.0.0/10, public address space.

Private IPv4 ranges (RFC 1918)
10.0.0.0/8
16,777,216 addresses · former class A
172.16.0.0/12
1,048,576 addresses · 172.16 – 172.31
192.168.0.0/16
65,536 addresses · home and office LANs
Everything else
Public, routed on the internet (with special exceptions)
The calculator flags whether your block falls inside one of these private ranges.

The distinction matters for security and for troubleshooting. A server that should be reachable from the internet needs a public address or a port forwarding; a database that should never be reachable from outside belongs into a private range. The calculator tells you at once which side of that line your block is on.

Subnetting in the cloud and in infrastructure as code

Cloud providers ask for CIDR blocks the moment you create a virtual network, and each subnet inside it takes a slice of that block. Plan the large block first, for example a /16 per environment, and carve /20 or /24 subnets out of it per availability zone and tier. Leave room: changing a VPC range later usually means rebuilding resources.

Note that cloud platforms often reserve more than two addresses per subnet for their own routers, DNS and future use, so the number of addresses you can actually assign may be a few lower than the calculator’s usable-host count. In Terraform or similar tools, keep the blocks in variables and check them with the calculator before applying, so that staging, production and peered networks never overlap.

Common subnetting mistakes

Most subnetting problems come from a handful of errors that are easy to avoid once you know them. A quick check with the calculator before you change a router, a firewall or a cloud network catches nearly all of them.

Keep the services in your subnets online

A correct subnet is the foundation, but it says nothing about whether the websites running on those addresses actually answer. monitordefend checks each website’s homepage every five minutes, confirms an outage with a second attempt and sends an email. Plans start with a 7-day free trial.

Frequently asked questions

How many usable hosts are in a /24?

A /24 contains 256 addresses. The first is the network address and the last the broadcast address, so 254 addresses remain for hosts, from .1 to .254.

What is the subnet mask for /27?

A /27 corresponds to 255.255.255.224. It contains 32 addresses, 30 of them usable, and its wildcard mask is 0.0.0.31.

Can I enter a host address instead of the network address?

Yes. The calculator works out the block any address belongs to. 192.168.1.77/26, for example, lies in the network 192.168.1.64 with the broadcast address 192.168.1.127.

Why does a /31 show two usable hosts?

On point-to-point links between two routers, RFC 3021 allows both addresses of a /31 to be used, because no network or broadcast address is needed there.

Does the calculator support IPv6?

This page handles IPv4. For IPv6 prefixes such as 2001:db8::/48, use the IPv6 subnet calculator.

Monitor the websites in your network

Start for free and set up your first check in minutes.

Start for free