CalculateItNow home

Subnet Calculator

IPv4 subnet from an address and CIDR prefix: network and broadcast addresses, usable host range and count, subnet mask and wildcard mask, with exact 32-bit maths.

Subnet Calculator: with the default inputs, network address is 192.168.1.128.

/
Try an example
192.168.1.130 is a host inside 192.168.1.128/26, not the network address itself. The network address is 192.168.1.128.
Network address
192.168.1.128

The first address in the block. It identifies the subnet and is not assignable to a host.

Broadcast address
192.168.1.191
Usable host range
192.168.1.129 – 192.168.1.190
Usable hosts
62
Subnet mask
255.255.255.192
Wildcard mask
0.0.0.63
Network in CIDR notation
192.168.1.128/26
Total addresses in the block
64
Host bits
6
Address type
Private (RFC 1918, 192.168.0.0/16)
Assumptions
  • IPv4 only; IPv6 uses 128-bit prefixes and no broadcast address.
  • Usable host count is 2^host_bits − 2, except /31 (2) and /32 (1).
  • Exact 32-bit unsigned integer arithmetic — no floating-point rounding anywhere in the address maths.
  • Address type is reported from the reserved-range registries, not from the obsolete class A/B/C rules.
CIDR prefix reference
PrefixSubnet maskWildcardAddressesUsable hosts
/8255.0.0.00.255.255.25516,777,21616,777,214
/9255.128.0.00.127.255.2558,388,6088,388,606
/10255.192.0.00.63.255.2554,194,3044,194,302
/11255.224.0.00.31.255.2552,097,1522,097,150
/12255.240.0.00.15.255.2551,048,5761,048,574
/13255.248.0.00.7.255.255524,288524,286
/14255.252.0.00.3.255.255262,144262,142
/15255.254.0.00.1.255.255131,072131,070
/16255.255.0.00.0.255.25565,53665,534
/17255.255.128.00.0.127.25532,76832,766
/18255.255.192.00.0.63.25516,38416,382
/19255.255.224.00.0.31.2558,1928,190
/20255.255.240.00.0.15.2554,0964,094
/21255.255.248.00.0.7.2552,0482,046
/22255.255.252.00.0.3.2551,0241,022
/23255.255.254.00.0.1.255512510
/24255.255.255.00.0.0.255256254
/25255.255.255.1280.0.0.127128126
/26255.255.255.1920.0.0.636462
/27255.255.255.2240.0.0.313230
/28255.255.255.2400.0.0.151614
/29255.255.255.2480.0.0.786
/30255.255.255.2520.0.0.342
/31255.255.255.2540.0.0.122
/32255.255.255.2550.0.0.011

Each step down the table halves the block. Usable hosts is total minus 2, except /31 (RFC 3021 point-to-point, both usable) and /32 (a single host route).

Math verified by automated testsUpdated 2026-09-093 sources cited

How this is worked out

The formula

mask      = 32 bits, with the top <prefix> bits set to 1
network   = IP AND mask
broadcast = network OR NOT(mask)
wildcard  = NOT(mask)

total addresses = 2^(32 − prefix)
usable hosts    = 2^(32 − prefix) − 2      (except /31 → 2 and /32 → 1)

Open How it’s calculated above to see this worked through with your own numbers.

What you enter

IP address — first octet
A number.from 0 to 255 · whole numbers only · defaults to 192
Second octet
A number.from 0 to 255 · whole numbers only · defaults to 168
Third octet
A number.from 0 to 255 · whole numbers only · defaults to 1
Fourth octet
A number.from 0 to 255 · whole numbers only · defaults to 130
CIDR prefix length
The number after the slash: /24 is a 255.255.255.0 mask, /26 splits that into four.from 0 to 32 · whole numbers only · defaults to 26

What you get back

Network addressmain answer
The first address in the block. It identifies the subnet and is not assignable to a host.
Broadcast address
Usable host range
Usable hosts
Subnet mask
Wildcard mask
Network in CIDR notation
Total addresses in the block
Host bits
Address type

What this assumes

  • IPv4 only; IPv6 uses 128-bit prefixes and no broadcast address.
  • Usable host count is 2^host_bits − 2, except /31 (2) and /32 (1).
  • Exact 32-bit unsigned integer arithmetic — no floating-point rounding anywhere in the address maths.
  • Address type is reported from the reserved-range registries, not from the obsolete class A/B/C rules.

About this calculator

Subnetting is bitwise AND, done on 32 bits and written in four decimal chunks so humans can read it. The prefix says how many leading bits identify the network; everything after them identifies a host inside it. Enter an address and a prefix and you get the network and broadcast addresses, the usable range, the mask and the wildcard.

How the arithmetic works

A /26 mask is 26 ones followed by 6 zeros: 11111111.11111111.11111111.11000000, which is 255.255.255.192. AND your address with that and the host bits vanish, leaving the network address. OR the network with the inverted mask and every host bit turns on, giving the broadcast address.

Worked through for 192.168.1.130/26: the last octet 130 is 10000010, the mask's last octet is 11000000, and the AND is 10000000 = 128. So the network is 192.168.1.128, the broadcast is 192.168.1.191, and the usable hosts run .129 to .190 — 62 of them. The 6 host bits give 64 addresses; two are spoken for.

The two you cannot use

Every subnet spends its first address on the network identifier and its last on the directed broadcast. That is why a /24 hosts 254 devices, not 256, and why the penalty for small subnets is savage: a /30 gives you 4 addresses and 2 usable ones — 50% overhead — which is why point-to-point links between routers are exactly that size.

Two exceptions:

  • /31 (RFC 3021) has no network or broadcast address by definition and gives you both addresses for a point-to-point link. Modern routers support it; older equipment does not.
  • /32 is a single address — a host route, a loopback, or an ACL entry matching one machine.

Masks, wildcards, and where each is used

The subnet mask (255.255.255.192) is what you configure on an interface. The wildcard mask (0.0.0.63) is its bitwise inverse and is what Cisco ACLs and OSPF network statements want. They carry the same information, inverted, and mixing them up is one of the most common configuration errors there is.

Sizing a subnet

Work backwards from hosts: you need host_bits where 2^host_bits − 2 ≥ your device count, then prefix = 32 − host_bits. 100 devices needs 7 bits (126 usable), so a /25. Always round up and leave room — resizing a subnet in production means renumbering every static address, every firewall rule and every DNS record on it.

Do not size on today's count. DHCP leases outlive devices, and phones, printers, cameras, badge readers and guest devices all consume addresses.

What this does not do

  • IPv4 only. IPv6 subnetting is 128 bits, uses /64 for essentially every LAN, and has no broadcast address at all.
  • Classful addressing (A/B/C) has been obsolete since CIDR arrived in 1993. The address type shown here is about the use of the range (private, loopback, multicast), not its old class.
  • It does not check whether the address is actually assigned, reachable, or in use.
  • VLSM — splitting one block into unequal subnets — is done by applying this same calculation repeatedly, one subnet at a time.

Frequently asked questions

How many hosts are in a /26?
  1. A /26 leaves 6 host bits, so 2⁶ = 64 addresses, minus the network address and the broadcast address.
What is the network address of 192.168.1.130/26?

192.168.1.128. The /26 mask is 255.255.255.192, and 130 AND 192 = 128. The broadcast is 192.168.1.191 and hosts run .129 to .190.

What is a wildcard mask?

The bitwise inverse of the subnet mask — 255.255.255.192 becomes 0.0.0.63. Cisco access lists and OSPF network statements use wildcards, where a 0 bit means 'must match'.

Why can't I use the first and last address?

The first identifies the subnet itself and the last is the directed broadcast for it. The exceptions are /31, where RFC 3021 makes both usable on point-to-point links, and /32, a single host route.

What size subnet do I need for 100 devices?

A /25: 7 host bits give 126 usable addresses. A /26 tops out at 62, and you want headroom for DHCP churn, printers and guest devices anyway.

Put this calculator on your own site

A working subnet, free for any site, with no ads and no sign-up. It resizes to fit wherever you paste it and updates itself as this page improves.

Paste this anywhere. It works on any site, carries no ads, never expires, and always shows the current version.

Subnet Calculator by CalculateItNow

The page's own title. The clearest description of what the link leads to.

The credit line sits outside the widget on purpose, so it is a real link on your page rather than one buried in a frame. Please keep it — it is what pays for CalculateItNow staying free and ad-free. The script only resizes the widget to fit its contents; drop it and the widget still works.

Browse every calculator widget·How to add it to WordPress, Squarespace or Wix

The questions people ask next to a subnet.

All business calculators·Browse everything