Subnet Calculator

e.g. 10.0.0.5/22 or 10.0.0.5 255.255.252.0

Subnet calculation results
Network address192.168.1.0
Broadcast address192.168.1.255
First usable host192.168.1.1
Last usable host192.168.1.254
Total addresses256
Usable hosts254
Subnet mask255.255.255.0
Wildcard mask0.0.0.255
CIDR notation192.168.1.0/24
IP classClass C (legacy)
Address typePrivate (RFC 1918)
IP address (binary)11000000.10101000.00000001.00000000
Subnet mask (binary)11111111.11111111.11111111.00000000

■ network bits ■ host bits

About the /24 subnet

Runs entirely in your browser. Nothing you enter is sent to a server.

How to use the subnet calculator

Type an IPv4 address followed by a CIDR prefix (for example 10.0.0.5/22) or a subnet mask (10.0.0.5 255.255.252.0). Results update as you type. Every value has a copy button, and the page URL updates with your input so you can bookmark or share the calculation. Use the Split / VLSM tab to divide the network into smaller subnets by count or by required hosts.

Worked example: 192.168.10.37/27

A /27 prefix means the first 27 bits are the network and the last 5 bits are hosts. 2⁵ = 32 addresses per subnet, so subnets start every 32 addresses in the last octet: .0, .32, .64, .96, and so on. The address .37 falls in the block that starts at .32.

192.168.10.37/27
FieldValue
Network address192.168.10.32
Broadcast address192.168.10.63
Usable host range192.168.10.33 – 192.168.10.62
Total addresses32
Usable hosts30
Subnet mask255.255.255.224
Wildcard mask0.0.0.31

In binary, the last octet of the address is 001|00101. The first three bits (001) belong to the network; setting the five host bits to 0 gives the network address (.32), and setting them to 1 gives the broadcast address (.63).

How subnetting works

Network and host bits

An IPv4 address has 32 bits. The prefix length says how many of those bits identify the network; the rest identify hosts inside it. The subnet mask is the same information written as four octets: 24 ones followed by 8 zeros is 255.255.255.0.

Usable hosts: why we subtract 2

In a normal subnet, the first address (all host bits 0) is the network address and the last (all host bits 1) is the broadcast address. Neither can be assigned to a device, so usable hosts = 2ⁿ − 2, where n is the number of host bits.

/31 and /32 subnets

A /31 has only two addresses. RFC 3021 allows both to be used on point-to-point links, so this calculator shows 2 usable hosts and no broadcast. A /32 is a single address, used for loopbacks and host routes.

Subnet mask reference

Subnet masks from /16 to /32
PrefixSubnet maskAddressesUsable hosts
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422 (point-to-point)
/32255.255.255.25511 (single host)

See the full table from /0 to /32 in the subnet cheat sheet. Each prefix links to its own page (e.g. /24 subnet).

Frequently asked questions

How do I calculate a subnet mask from a CIDR prefix?

Write as many 1 bits as the prefix length, fill the rest of the 32 bits with 0s, and convert each group of 8 bits to decimal. /26 is 11111111.11111111.11111111.11000000, which is 255.255.255.192.

How many hosts are in a /24?

256 addresses, of which 254 are usable: 192.168.1.0 is the network address and 192.168.1.255 is the broadcast address.

What is a wildcard mask?

The inverse of the subnet mask (255.255.255.255 minus the mask). Cisco ACLs and OSPF use it. The wildcard for 255.255.255.224 is 0.0.0.31.

How do I find the network address of an IP?

Do a bitwise AND of the IP and the subnet mask. For 192.168.10.37/27, the last octet is 37 AND 224 = 32, so the network is 192.168.10.32.

What subnet should I use for 50 hosts?

You need at least 52 addresses (50 + network + broadcast), so the smallest fit is a /26 with 62 usable hosts.

Is my data sent anywhere?

No. The calculator runs entirely in your browser; nothing you type leaves your device.