Skip to content
Calciyums

Subnet Calculator

From an IPv4 address and a CIDR prefix, work out the network address, broadcast address, subnet mask and usable host range.

Developer

Input

Calculated in your browser; what you enter is never sent to a server.

Result

Network address

192.168.1.0/24

Broadcast address
192.168.1.255
Subnet mask
255.255.255.0
First usable address
192.168.1.1
Last usable address
192.168.1.254
Usable hosts
254
Total addresses
256

How does it work?

Enter an IPv4 address and a CIDR prefix (like /24). The tool derives the subnet mask from the prefix, ANDs the address with the mask to get the network address, sets the remaining bits to get the broadcast address, and shows the usable host range in between. /31 and /32 are special cases: per RFC 3021, /31 has no separate broadcast reservation for its two hosts, and /32 addresses a single host. Example: entering 192.168.1.0/24 shows that a /24 prefix corresponds to a 255.255.255.0 subnet mask; the network address is 192.168.1.0, the broadcast address is 192.168.1.255, and the usable range runs from 192.168.1.1 to 192.168.1.254 — 254 usable hosts (2^8 − 2 = 254). Use this tool to plan how many devices a home or office network can be split into, check which network a static IP belongs to before assigning it to a server, or quickly verify CIDR arithmetic while studying for a networking course or certification exam. When planning a network, you can run this tool repeatedly with different prefix values to split a large block (say, a /16) into smaller subnets (like /24s).

Formula

Network address = IP AND Mask
Broadcast address = Network address OR (NOT Mask)
Usable hosts = 2^(32−prefix) − 2 (the ordinary case)

Example

IP address: 192.168.1.0 · Prefix (CIDR, /0–/32): 24 → Network address: 192.168.1.0/24

Similar Tools

Toolbox Get your Toolbox ready.

Star the tools you use most and, with an account, they follow you to every device.

Create account

Frequently asked questions

How many hosts does a /24 give me?

2^(32−24) = 256 addresses, minus 2 (network and broadcast) leaves 254 usable hosts.

Why are /31 and /32 different?

/32 addresses a single device, with no network/broadcast split. /31 is specifically reserved by RFC 3021 for two-device point-to-point links and both its addresses are usable; the ordinary network/broadcast rule doesn't apply there.

Does this only support IPv4?

Yes, IPv4 only for now. IPv6 uses a much larger address space and would need a tool of its own.

Where do I find my own IP address?

A computer's local network IP is shown in its operating system's network settings; this tool accepts any IPv4 address, so you don't need to look up your own device's IP to use it.

What's the relationship between the prefix (CIDR) and the subnet mask?

The prefix is the number of 1 bits in the mask; for example /24 corresponds to the mask 255.255.255.0 (24 ones followed by 8 zeros).