IPv4 and IPv6 Subnet Calculator
Calculate network, broadcast, wildcard mask, first/last host and usable hosts for any IPv4 or IPv6 subnet. Accepts CIDR or dotted netmask, runs in your browser.
Examples: 192.168.1.10/24, 10.0.0.5 255.255.240.0, 2001:db8::1/48
| Address | 192.168.1.130 |
|---|---|
| CIDR notation | 192.168.1.0/24 |
| Network address | 192.168.1.0 |
| Subnet mask | 255.255.255.0 (/24) |
| Wildcard mask | 0.0.0.255 |
| Broadcast address | 192.168.1.255 |
| First usable host | 192.168.1.1 |
| Last usable host | 192.168.1.254 |
| Total addresses | 256 |
| Usable hosts | 254 |
| Address type | Private (RFC 1918) |
| Class (classful, historical) | C |
| Binary subnet mask | 11111111.11111111.11111111.00000000 |
| Hexadecimal address | 0xC0A80182 |
What is Subnet Calculator?
This subnet calculator takes an IP address with a prefix length or netmask and shows everything about the subnet it belongs to: network and broadcast address, subnet mask, wildcard mask, usable host range and the number of addresses. It works for both IPv4 and IPv6 and also tells you whether the address is public, private (RFC 1918), loopback, link-local, CGNAT or reserved.
How to use Subnet Calculator
- Type an address with its prefix, e.g.
192.168.1.130/24, or with a dotted netmask, e.g.10.1.2.3 255.255.240.0. - For IPv6 enter an address such as
2001:db8::1/64; a bare address is treated as a single host (/32 or /128). - Read the results table: network, subnet mask, wildcard, broadcast, first and last usable host, total addresses and usable hosts.
- Use the Copy button to copy a short summary for documentation or a ticket.
Example
192.168.1.130/24
Network 192.168.1.0, mask 255.255.255.0, wildcard 0.0.0.255, broadcast 192.168.1.255, hosts 192.168.1.1 – 192.168.1.254, 254 usable of 256 addresses, Private (RFC 1918), class C
With 10.1.2.3 255.255.240.0 the tool shows 10.1.0.0/20 with 4,094 usable hosts.
When to use Subnet Calculator
Use it when planning address ranges, writing firewall or security-group rules, configuring DHCP scopes or checking whether two hosts are on the same subnet. It does not scan or ping anything – it is pure arithmetic – and it does not know how your network is actually configured, so a different mask set on a device will give different real-world behaviour.
How Subnet Calculator works
The address is converted to a 32-bit (IPv4) or 128-bit (IPv6) integer. The prefix length produces a mask with that many leading 1-bits; network = address AND mask and the last address is network OR NOT mask. The total number of addresses is 2^(bits − prefix). For IPv4 the network and broadcast addresses are excluded from the usable hosts, except for /31 point-to-point links (RFC 3021, 2 usable) and /32 single hosts. IPv6 has no broadcast; the all-zero host address is the Subnet-Router anycast address, so it is not counted as usable. A dotted netmask is only accepted when its 1-bits are contiguous. Address types come from the ipaddr.js special-range tables.
Common Use Cases
- Find the broadcast address and host range for a /26 VLAN before configuring a router.
- Convert a netmask such as 255.255.248.0 to CIDR (/21) for cloud or Kubernetes configs.
- Get the wildcard mask needed for Cisco ACLs or OSPF network statements.
- Check how many addresses an IPv6 /64 or /56 delegation provides.
- Verify whether an address is private, CGNAT (100.64.0.0/10) or public before exposing a service.
FAQs
Why does a /31 show 2 usable hosts instead of 0?
RFC 3021 allows /31 networks on point-to-point links, where both addresses are used by the two ends and no broadcast address is needed. The calculator follows that rule; a /32 is a single host.
What is the wildcard mask?
It is the bitwise inverse of the subnet mask (for /24: 0.0.0.255). Cisco ACLs and OSPF use it to say which bits may vary.
Why is the first IPv6 address not counted as a usable host?
In IPv6 the address with an all-zero interface ID is reserved as the Subnet-Router anycast address (RFC 4291). IPv6 has no broadcast, so only that one address is excluded.
Is the IP class still relevant?
No. Classful addressing was replaced by CIDR in 1993. The class is shown only for reference because it still appears in exams and older documentation.