Subnet Calculator – IPv4 Network, Mask, Hosts and Broadcast

Enter an IPv4 address and prefix length to get the network address, broadcast address, usable host range, host count, wildcard mask and CIDR notation.

Free & Instant•Version: v1.0•Formula, examples and assumptions

Calculator InputsFormula v1.0

Dotted decimal, for example 10.0.0.42.

026/bits32
Calculated Output

Network address = IP AND mask; broadcast = network OR wildcard; usable hosts = 2^(32 − prefix) − 2 for prefixes /1–/30

Network address

192.168.1.128/26
Subnet mask255.255.255.192
Wildcard mask0.0.0.63
Broadcast address192.168.1.191
Usable host range192.168.1.129 – 192.168.1.190
Usable hosts62
Total addresses in the block64
CIDR block192.168.1.128/26
Address classClass C
Private address spaceYes (RFC 1918)
Host bits6
Instant Browser CalculationNo Server Logging

Step-by-Step Mathematical Working

Convert the address to 32 bits: 11000000.10101000.00000001.10000010.
Mask for /26 is 255.255.255.192, i.e. 26 leading 1 bits.
Network = IP AND mask = 192.168.1.128. Broadcast = network OR wildcard = 192.168.1.191.
Usable hosts = 2^6 − 2 = 62.

Formula and method

Network address = IP AND mask; broadcast = network OR wildcard; usable hosts = 2^(32 − prefix) − 2 for prefixes /1–/30

The prefix length fixes the network size; the address only selects which subnet within the classless space you are using. Two addresses per subnet are reserved for the network and broadcast, so a /24 provides 254 usable hosts, not 256.

Variables

IPv4 address
Any address in the subnet, in dotted decimal form
Prefix
CIDR prefix length from 0 to 32, equivalent to the number of leading 1 bits in the mask
Wildcard mask
The bitwise inverse of the subnet mask, used in access control lists

Worked example

192.168.1.130/26 has network 192.168.1.128, broadcast 192.168.1.191, usable hosts 192.168.1.129–192.168.1.190, and 62 usable addresses.

Who this calculator is for

Network administrators, students studying for networking certifications, and anyone configuring a router, firewall, or VLAN.

Complete guide to the subnet calculator – ipv4 network, mask, hosts and broadcast

Every figure below comes from this calculator itself. The method is Network address = IP AND mask; broadcast = network OR wildcard; usable hosts = 2^(32 − prefix) − 2 for prefixes /1–/30, applied to the tool's default inputs and then stress-tested one input at a time.

What the Subnet Calculator – IPv4 Network, Mask, Hosts and Broadcast works out

Subnet Calculator – IPv4 Network, Mask, Hosts and Broadcast answers one specific question: Enter an IPv4 address and prefix length to get the network address, broadcast address, usable host range, host count, wildcard mask and CIDR notation. It is written for network administrators, students studying for networking certifications, and anyone configuring a router, firewall, or VLAN.

The method is Network address = IP AND mask; broadcast = network OR wildcard; usable hosts = 2^(32 − prefix) − 2 for prefixes /1–/30. The inputs are IPv4 address, Prefix length (CIDR) (/bits). With the default values - IPv4 address = 192.168.1.130, Prefix length (CIDR) = 26 /bits - the result is Network address: 192.168.1.128/26. Raising Prefix length (CIDR) from 26 /bits to 28.60 /bits moves the headline result from 192.168.1.128/26 to 192.168.1.128/29.

Reading the result, line by line

Alongside 192.168.1.128/26 this method reports 10 supporting quantities: Subnet mask: 255.255.255.192; Wildcard mask: 0.0.0.63; Broadcast address: 192.168.1.191; Usable host range: 192.168.1.129 – 192.168.1.190. Reading them side by side separates the effect of each assumption.

The arithmetic as executed: Convert the address to 32 bits: 11000000.10101000.00000001.10000010. Mask for /26 is 255.255.255.192, i.e. 26 leading 1 bits. Network = IP AND mask = 192.168.1.128. Broadcast = network OR wildcard = 192.168.1.191. Usable hosts = 2^6 − 2 = 62. Repeat the arithmetic on paper; agreement means the method was applied to the values you meant to enter.

How to interpret the answer

The prefix length fixes the network size; the address only selects which subnet within the classless space you are using. Two addresses per subnet are reserved for the network and broadcast, so a /24 provides 254 usable hosts, not 256.

Read it as one scenario: 192.168.1.128/26 with subnet mask at 255.255.255.192 holds only for the inputs shown. Change whichever input you are genuinely unsure about and read the pair of figures together.

Common mistakes to avoid

Subtracting 2 for hosts on a /31 or /32, which are point-to-point and single-host special cases. Confusing the subnet mask with the wildcard mask. Assigning the network or broadcast address to a host. Forgetting that overlapping subnets break routing even when each looks valid in isolation.

Before relying on the figure, re-read IPv4 address, Prefix length (CIDR) (/bits) and confirm each entry matches its label, including whether a quantity is entered in the unit the label names. Adjust Prefix length (CIDR) on its own and watch whether the result behaves as the method says it should - here 192.168.1.128/26 should shift smoothly rather than jump.

Limitations and responsible use

IPv4 only. IPv6 prefix delegation and address planning are not modelled here. Assumes classless (CIDR) addressing and standard point-to-point conventions.

Each number above is bounded by the limits just described, so treat it as a conditional result. Every figure here can be reproduced by hand from the formula shown, but no calculation can confirm that the inputs match your actual circumstances. For a consequential decision, check the current figure against a primary source, since published values are revised.

Frequently asked questions

How many hosts are in a /24?

256 addresses total and 254 usable, because the network and broadcast addresses are reserved.

What is a /31 used for?

Point-to-point links. Both addresses are usable under RFC 3021, so no address is wasted.

What is a wildcard mask?

The bitwise inverse of the subnet mask. On a /24 the mask is 255.255.255.0 and the wildcard is 0.0.0.255.

Related searches for this calculator

People also look for subnet calculator, cidr calculator, ip subnet mask calculator, network address calculator and usable hosts per subnet. Everything on this page is calculated in your browser from the formula shown above.

Related Science Calculators

Explore another calculator in this subject.