Subnet Calculator
Compute network/broadcast/host range and mask from an IPv4 CIDR.
What Subnet Calculation Does
Subnet calculation takes an IPv4 network in CIDR notation (for example 192.168.1.0/24) and breaks it down into its concrete addressing components. The prefix length, the number after the slash, tells you how many of the 32 bits are the network portion; the remaining bits are available for hosts. Changing the prefix directly changes both the boundaries of the subnet and how many addresses it can hold.
This tool parses your CIDR input and computes the network address, broadcast address, subnet mask, wildcard mask, the first and last usable host, the total and usable host counts, plus the IP class (A/B/C/D/E) and whether the address is private or public, all at once. Edge cases like /31 and /32, which have fewer than two normal hosts, are handled correctly.
Every calculation runs instantly in your browser as pure JavaScript, and the IP address or prefix you type is never sent to any server. That makes it safe to work with internal network ranges or customer IP details without worrying about data leaving your machine.
How to Use
- Type a network in CIDR notation into the input field, for example 10.0.0.0/24. If you omit the prefix, the tool defaults to /24.
- You can enter any host address inside the range (for example 192.168.1.57/24), not just the network address. The tool applies the mask and finds the network it belongs to automatically.
- Read the network, broadcast, mask, and host range from the result card, and use the copy button next to each value to grab it directly.
Frequently Asked Questions
- Why does a /24 have 254 usable hosts instead of 256?
- In each subnet the first address is reserved as the network address and the last as the broadcast address, so neither can be assigned to a host. That leaves 256 minus 2, or 254, usable hosts. As exceptions, a /31 is treated as a point-to-point link where both addresses are usable, and a /32 is a single host with one usable address.
- What is the wildcard mask used for?
- The wildcard is the bitwise inverse of the subnet mask, and it is mainly used in Cisco ACLs and OSPF network statements to define which bits must match. For a mask of 255.255.255.0 the wildcard is 0.0.0.255, meaning any value in the last octet matches.
- How does it decide whether an IP is private?
- It flags the RFC 1918 ranges 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16, along with the loopback range 127.0.0.0/8, as private. These ranges are not routed on the public internet and are used freely on internal networks behind NAT.