Subnet Calculator
Calculate subnet mask, network address, broadcast address, usable host range, and CIDR notation for any IP address.
About this calculator
This calculator does IPv4 subnet math from an address and a CIDR prefix length. Network Address and Broadcast Address are the first and last addresses in the block, found by ANDing the IP with the subnet mask (network) and OR-ing with its complement (broadcast) -- both fall outside the usable host range. Usable Hosts is 2^(32-CIDR) minus 2 for any prefix of /30 or shorter, subtracting the network and broadcast addresses themselves; at /31 and /32, this calculator switches to point-to-point and single-host conventions (2 usable addresses at /31, 1 at /32) instead of subtracting 2 from a pool too small to hold both a dedicated network and broadcast address -- note that /30 and /31 both report 2 usable hosts, a genuine tie between two different rules, not a mistake.
IP Class reports the legacy classful designation (A/B/C/D/E) based purely on the first octet -- a historical scheme that CIDR replaced in 1993, so a network you've subnetted to a /26 or /27 can still show as "Class C" under this legacy convention even though CIDR notation, not IP class, is what actually determines the subnet's real size today; the full classful scheme has five classes, and 240.0.0.0 through 255.255.255.255 (including the limited-broadcast address 255.255.255.255) is Class E, reserved for future/experimental use. Address Type flags the three private-use ranges reserved by RFC 1918: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16; any address outside those ranges is reported as public. Every input is rounded to the nearest integer and then constrained to its valid range (octets 0-255, CIDR prefix 0-32) before the subnet math runs, so an out-of-range or fractional value from the API or embed still returns a well-formed answer rather than a garbled one.
Inputs
Results
Network Address
192.168.1.0
How to Use This Calculator
- Enter the four IP Address Octets (0–255 each) to form your IPv4 address (e.g., 192.168.1.100).
- Set the CIDR Prefix Length — /24 is the most common LAN size (254 usable hosts), /16 covers a larger campus.
- Review the Network Address and Broadcast Address that bound your subnet.
- Check Usable Hosts to confirm the subnet can accommodate your devices, and note the First and Last Usable Host IPs.
- Use IP Class and Address Type (Private/Public) to verify the address falls in the correct range for your deployment.
What each input means
- IP Octet 1
- First octet of the IP address.
- IP Octet 2
- Second octet of the IP address.
- IP Octet 3
- Third octet of the IP address.
- IP Octet 4
- Fourth octet of the IP address.
- CIDR Prefix Length
- CIDR notation subnet mask prefix length.
How this is calculated
Worked example, using the default values
- Identify Input Parameters5 parametersIP Octet 1 = 192, IP Octet 2 = 168, IP Octet 3 = 1, IP Octet 4 = 100, CIDR Prefix Length = 24 = 5 input(s) provided
- Calculate Network AddressNetwork Address192.168.1.0 = 192.168.1.0
- Calculate Broadcast AddressBroadcast Address192.168.1.255 = 192.168.1.255
- Calculate Subnet MaskSubnet Mask255.255.255.0 = 255.255.255.0
Engine last updated . Checked against 3 independently-derived tests — how we verify calculators. Built by Paul Gunder, a software engineer, not a licensed financial, medical, or legal professional.
Frequently Asked Questions
Why does Usable Hosts use a different rule at /31 and /32?
Because a /30 or shorter prefix has room to spare one address each for the network and broadcast identifiers, but a /31 (2 addresses total) and /32 (1 address total) do not. Per RFC 3021, a /31 is treated as a point-to-point link with both addresses usable (2 usable hosts, no dedicated broadcast address), and a /32 is a single host route (1 usable address) -- subtracting 2 the normal way would produce a negative or zero host count for those two prefix lengths. Note that this makes /30 (4 total - 2 = 2) and /31 (2 usable, RFC 3021) report the identical "2 usable hosts" despite being different rules applied at different prefix lengths.
Why does IP Class say Class C when I've configured a /26 or /27 prefix?
IP Class reports the legacy classful addressing scheme from before 1993, which assigns A/B/C/D/E purely from the first octet's numeric range, with no awareness of CIDR at all. CIDR replaced classful addressing specifically so networks could be split more flexibly than the old A/B/C boundaries allowed, so it's normal and expected for a 192.168.x.x address subnetted to /26 to still report "Class C" by the legacy convention while your actual subnet size is set entirely by the /26 prefix.
What are Class D and Class E, and does this calculator report both?
Yes. Classful addressing defines five classes from the first octet: A (1-127), B (128-191), C (192-223), D (224-239, reserved for IP multicast), and E (240-255, reserved for future or experimental use, and also where the special limited-broadcast address 255.255.255.255 falls). This calculator reports all five -- an address like 250.1.1.1 or 255.255.255.255 correctly shows as "E (Reserved/Experimental)," not Class D.
What does Address Type (Private/Public) actually check?
It checks whether the IP address falls inside one of the three ranges RFC 1918 reserves for private networks -- 10.0.0.0 through 10.255.255.255, 172.16.0.0 through 172.31.255.255, and 192.168.0.0 through 192.168.255.255. Any address outside those three ranges is reported as public, regardless of whether it's actually routed on the public internet in your network.
Does changing the IP address octets change how many hosts fit in the subnet?
No. Usable Hosts depends only on the CIDR Prefix Length -- it's purely 2^(32-CIDR) minus 2 (with the /31 and /32 exceptions above), regardless of which specific IP address you entered. The octets determine WHERE the subnet sits and what its network, broadcast, and host-range addresses actually are, but not how many usable addresses that subnet contains.
Related Calculators
The questions that sit next to this one — chosen by subject, including calculators filed under a different category.
Binary/Hex/Decimal Converter
Convert a decimal number into its binary, octal, and hexadecimal representations. Includes bit count, byte size, and ASCII character lookup.
Technology & ComputingPassword Strength Calculator
Check how strong your password could be based on length and character types. See estimated time to crack.
Technology & ComputingNetwork Tools Calculator
Subnet calculator, bandwidth estimator, and VLSM network planning.
Network DesignVLAN & Subnet Calculator
Calculate IP address allocation across VLANs with optimal subnet sizing, growth margin, and utilization analysis.
More in Technology & Computing.