IPv4 Subnet Calculator

Enter an IPv4 address with a CIDR prefix or subnet mask to get the full breakdown: network, broadcast, usable range, wildcard mask, and binary form. Handles /31 and /32 correctly.

Input

You can enter the CIDR inline above (e.g. 192.168.1.10/24) or provide a mask/prefix here.

Results

IP Address
—
CIDR
—
Subnet Mask
—
Network Address
—
Broadcast Address
—
First Usable
—
Last Usable
—
Total Addresses
—
Usable Addresses
—
Address Class
—
Wildcard Mask
—

Binary Representation

FieldBinary
IP Address—
Subnet Mask—
Network—
Broadcast—

Overview

The IPv4 Subnet Calculator takes an IP address plus a prefix length (such as /26) or a dotted subnet mask, and shows the network that address belongs to: the network address, broadcast address, first and last usable host, total and usable address counts, the wildcard mask, and the binary form of the key values.

Use it when you are planning address space, checking whether two hosts are in the same subnet, or double-checking a configuration before you apply it to a router, firewall, switch, or cloud network. It is aimed at network engineers, system administrators, and students learning to subnet by hand who want a way to check their working.

How It Works

An IPv4 address is a 32-bit number, usually written as four decimal octets. A subnet mask is also 32 bits: a run of 1s marking the network portion followed by a run of 0s marking the host portion. A prefix length such as /26 is simply the number of leading 1s.

The calculator performs two bitwise operations. The network address is the IP address AND the mask, which clears every host bit. The broadcast address is the network address OR the inverted mask, which sets every host bit to 1. The addresses strictly between them are normally the usable host addresses, so a subnet with h host bits has 2h total addresses and 2h − 2 usable ones.

Two prefix lengths are special. A /31 has no separate network or broadcast address: RFC 3021 allows both addresses to be used on a point-to-point link. A /32 identifies exactly one host. The tool reports these correctly instead of subtracting two. The "address class" row is shown only for historical context; modern networks are classless.

How to Use the IPv4 Subnet Calculator

  1. Type the address with its prefix in the first field, for example 192.168.10.77/26. Alternatively, enter only the address there and put a mask (255.255.255.192) or a prefix number (26) in the second field.
  2. Press Calculate. Every field is computed in your browser; nothing is sent anywhere.
  3. Read the network address, broadcast address, and usable range. These are the values you would use for a DHCP scope, a static route, or an access-list entry.
  4. Use Copy Results to paste a clean text summary into a ticket or change request.
  5. If you see an error message, correct the input and calculate again (see Troubleshooting below).

Worked Example

Which subnet is 192.168.10.77/26 in?

A host is configured as 192.168.10.77 with mask 255.255.255.192. You want its network address and the range of hosts it can reach directly.

Input

IP address: 192.168.10.77/26

Output

IP Address:        192.168.10.77
CIDR:              /26
Subnet Mask:       255.255.255.192
Network Address:   192.168.10.64
Broadcast Address: 192.168.10.127
First Usable:      192.168.10.65
Last Usable:       192.168.10.126
Total Addresses:   64
Usable Addresses:  62
Wildcard Mask:     0.0.0.63

A /26 leaves 32 − 26 = 6 host bits, so each subnet holds 26 = 64 addresses, and subnets start every 64 addresses in the last octet: .0, .64, .128, .192. The address .77 falls in the block that starts at .64, which is why the network address is 192.168.10.64 and the broadcast address (the last address in that block) is 192.168.10.127.

In binary, the last octet 77 is 01001101 and the mask's last octet 192 is 11000000. ANDing them gives 01000000, which is 64. The 62 usable hosts run from 192.168.10.65 to 192.168.10.126. A host at 192.168.10.130 would be in a different subnet and would need a router to reach this one.

Interpreting Results

Network address
The first address of the subnet, with all host bits 0. It identifies the subnet in routing tables and ACLs and is not assigned to a host (except in a /31 or /32).
Broadcast address
The last address, with all host bits 1. Packets sent here are delivered to every host on the subnet.
First / last usable
The range you can assign to devices. Your router or gateway interface also consumes one of these addresses.
Total vs. usable
Total counts every address in the block; usable excludes the network and broadcast addresses (except for /31 and /32). The note box under the results explains when a special case applies.
Wildcard mask
The inverse of the subnet mask, used by Cisco-style ACLs and OSPF network statements. It is not a subnet mask. See the Wildcard Mask Calculator.

Troubleshooting

"Invalid IPv4 address."
Each octet must be 0–255 and there must be exactly four. Leading zeros such as 192.168.01.1 are rejected on purpose, because some systems read a leading zero as octal and interpret the address differently.
"CIDR prefix must be between 0 and 32."
IPv4 prefixes range from /0 to /32. A value such as /64 is an IPv6 prefix length.
"Invalid subnet mask (not a contiguous mask)."
A valid mask is ones followed by zeros, such as 255.255.255.192. A value like 0.0.0.63 is a wildcard mask, and 255.0.255.0 is not a valid mask at all.
Two hosts "look" like they are on the same subnet but cannot communicate.
Calculate the network address for each host using its own configured mask. A mismatched mask on one side (for example /24 on one host and /26 on the other) puts them in different subnets from each other's point of view.

Limitations and Accuracy

  • IPv4 only. IPv6 uses 128-bit addresses and different conventions.
  • The tool does the mathematics; it does not know your real network. It cannot detect overlapping subnets, VLAN assignments, NAT, or addresses already in use.
  • Some platforms reserve extra addresses in every subnet (AWS, for example, reserves five), so the usable count in a cloud VPC can be lower than shown here. Check your provider's documentation.
  • The address class (A/B/C/D/E) is historical and has no effect on modern routing.

Data Handling

Runs in your browser. What you enter is processed on your device and is not sent to NetEngToolkit’s servers or to any third party.

Frequently Asked Questions

Why are there two fewer usable addresses than total addresses?

Because the lowest address names the subnet itself and the highest is the broadcast address. A /26 has 64 addresses and 62 usable hosts. The exceptions are /31 and /32.

Can I really use a /31?

On point-to-point links, yes: RFC 3021 defines it, and 203.0.113.4/31 gives two usable addresses (203.0.113.4 and 203.0.113.5). Support varies, so confirm that both devices support /31 before relying on it.

How do I check my own subnetting by hand?

Compute the block size (2 to the number of host bits), find which multiple of that size contains your address in the interesting octet, and the next multiple minus one is the broadcast. The IPv4 subnetting guide walks through this step by step.