FormatterHQ

CIDR / Subnet Calculator

Enter an address with a prefix, such as 192.168.10.37/26, to get the netmask, wildcard mask, network and broadcast address, usable host range and scope.

Loading tool…
Ready.

How to use the CIDR / Subnet Calculator

  1. Enter an IPv4 address with a prefix length, such as 192.168.10.37/26.
  2. Or enter the address and a dotted mask separated by a space, such as 192.168.1.0 255.255.255.0; a bare address is treated as a /24.
  3. For IPv6, enter a prefix such as 2001:db8::/32.
  4. Read the network, broadcast, host range and host count, then copy the values you need.

CIDR calculator for IPv4 and IPv6 subnets

This CIDR calculator takes an address and prefix length and works out everything you need to plan or debug a subnet: the netmask, the wildcard mask, the network and broadcast addresses, the first and last usable host, the number of addresses, and whether the block is private or public. It also shows the mask and address in binary and the block as an integer range.

What CIDR notation means

Classless Inter-Domain Routing (CIDR, RFC 4632) writes a network as address/n, where n is how many leading bits belong to the network. The remaining 32 − n bits number the hosts inside it. CIDR replaced the fixed class A, B and C sizes in 1993, so a block can have any size that is a power of two.

Worked example: 192.168.10.37/26

Address:              192.168.10.37
CIDR notation:        192.168.10.0/26
Netmask:              255.255.255.192
Wildcard mask:        0.0.0.63
Network address:      192.168.10.0
Broadcast address:    192.168.10.63
First usable host:    192.168.10.1
Last usable host:     192.168.10.62
Total addresses:      64
Usable hosts:         62
Scope:                Private (RFC 1918)

Step by step: /26 means 26 one-bits, so the last octet of the mask is 11000000 = 192. The block size is 232−26 = 64, which splits the last octet into ranges starting at 0, 64, 128 and 192. The host .37 falls in the first range, so the network is .0 and the broadcast is .63. Excluding those two leaves .1 to .62: 62 usable hosts.

The formulas

  • Netmask: n one-bits followed by 32 − n zero-bits.
  • Wildcard mask: the inverse of the netmask, or 255 minus each mask octet. Cisco ACLs and OSPF statements use it.
  • Network address: address AND netmask.
  • Broadcast address: network OR wildcard.
  • Usable hosts: 232−n − 2 for prefixes up to /30.
PrefixNetmaskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/24255.255.255.0256254
/27255.255.255.2243230
/29255.255.255.24886
/30255.255.255.25242

The /31 and /32 special cases

A /31 has only two addresses. RFC 3021 allows both to be used on point-to-point links, since such a link needs no broadcast address, so the calculator reports 2 usable hosts; the "broadcast" line simply shows the upper address. A /32 is a single address, used for loopback interfaces, host routes and one-address firewall or security-group rules, and counts as 1 usable host.

Private ranges and scope

RFC 1918 reserves three blocks for private networks: 10.0.0.0/8 (16,777,216 addresses), 172.16.0.0/12 (172.16.0.0 to 172.31.255.255) and 192.168.0.0/16. The scope line also recognizes loopback (127.0.0.0/8), link-local (169.254.0.0/16), carrier-grade NAT (100.64.0.0/10, RFC 6598) and multicast (224.0.0.0/4). The class line is shown for reference only; classes no longer affect routing.

IPv6 prefixes

Enter a block such as 2001:db8:abcd:12::/64 to get the network, first and last address, expanded form and total count, here 18446744073709551616 (264). IPv6 has no broadcast address, so there is no usable-host subtraction.

Common mistakes

  • Host bits in a network ID. 192.168.10.37/26 describes a host, not a network. The calculator shows the real network, 192.168.10.0/26; many routers and cloud consoles reject the unaligned form.
  • Non-contiguous masks. A mask such as 255.0.255.0 is rejected, because a netmask must be ones followed by zeros.
  • Mixing up mask and wildcard. 0.0.0.63 in an ACL is not the same as the netmask 255.255.255.192.
  • Cloud reservations. Providers keep some addresses for themselves; AWS, for instance, reserves five in every VPC subnet, so a /28 gives you 11 hosts there, not 14.

To see the AND operation bit by bit, convert the address with IP to Binary or try the AND calculator. For IPv6 bit patterns, use IPv6 to Binary. All calculations run in your browser.

Frequently asked questions

How many usable hosts are in a /24?
A /24 has 256 addresses. Subtracting the network and broadcast addresses leaves 254 usable hosts.
What subnet mask is /26?
/26 is 255.255.255.192. It has 64 addresses and 62 usable hosts, and its wildcard mask is 0.0.0.63.
Why does a /31 show two usable hosts?
RFC 3021 allows /31 networks on point-to-point links, where no broadcast address is needed. Both addresses can be assigned to the two ends of the link.
Can I enter a dotted subnet mask instead of a prefix?
Yes. Type the address and the mask separated by a space, for example 192.168.1.0 255.255.255.0, and the calculator converts it to /24. A bare address without a prefix is treated as a /24.
Is 172.20.0.0 a private address?
Yes. The private block 172.16.0.0/12 runs from 172.16.0.0 to 172.31.255.255, so 172.20.x.x is inside it. Addresses such as 172.32.0.1 are public.
What is the difference between a subnet mask and a wildcard mask?
A subnet mask has 1s for the network bits, while a wildcard mask has 1s for the bits that may vary. The wildcard is simply the inverse, so /26 is 255.255.255.192 as a mask and 0.0.0.63 as a wildcard.

Last updated October 3, 2026

Guides

Related tools