๐ŸŒ

IPv4 Subnet Calculator

Calculate IPv4 subnet network, broadcast, usable hosts, wildcard mask, and divide a subnet into smaller blocks.

MATH

Calculate IPv4 subnet network address, broadcast, usable host range, wildcard mask, and divide a subnet into smaller equal-size blocks.

Bidirectional CIDR slash and dotted-decimal mask inputs stay in sync. Shows network class (A-E), private vs public (RFC 1918), CGNAT (100.64.0.0/10), loopback, link-local, plus binary and hex representations. RFC 3021 note appears for /31 point-to-point links.

Disclaimer: This calculator handles IPv4 only. Production network design should account for VLSM, route summarization, and security boundaries beyond pure subnet math.
Loading calculatorโ€ฆ
Advertisement

Calculator information

How to use this calculator

  1. Enter an IPv4 address in dotted-decimal format, for example 192.168.1.10.
  2. Pick a CIDR prefix (/0 through /32) or type a subnet mask (e.g., 255.255.255.0); the two fields sync automatically.
  3. Click Calculate to view the network address, broadcast address, host range, wildcard mask, and number of usable hosts.
  4. Check the classification label: Class A/B/C/D/E, private (RFC 1918), CGNAT (100.64.0.0/10), loopback (127.0.0.0/8), or link-local (169.254.0.0/16).
  5. Use the 'Split into subnets' feature to divide a block into smaller sub-prefixes matching your VLAN needs.
  6. Tip: for point-to-point links use /31 per RFC 3021 (2 hosts with no network/broadcast), instead of /30 which wastes 2 IPs.

IPv4 Subnet (CIDR)

network = ip AND mask ; broadcast = network OR (NOT mask) ; usable_hosts = 2^(32 - prefix) - 2 (in general) ; wildcard = NOT mask
  • ip = address as a 32-bit integer
  • mask = subnet mask (prefix-many leading ones)
  • prefix = number of network bits (0-32)
  • AND, OR, NOT = bitwise operations
  • Exceptions: /31 = 2 usable hosts (RFC 3021), /32 = 1 host

The wildcard mask is the bitwise complement of the subnet mask and is used in Cisco ACLs. Total addresses = 2^(32 - prefix); usable hosts are reduced by 2 for the network and broadcast addresses, except for /31 and /32.

Worked example: Subnet 192.168.10.50/26

Given:
  • IP: 192.168.10.50
  • Prefix: /26 (mask 255.255.255.192)
Steps:
  1. Mask /26 in binary: 11111111.11111111.11111111.11000000 = 255.255.255.192.
  2. Wildcard = 0.0.0.63.
  3. Network = 192.168.10.50 AND 255.255.255.192 = 192.168.10.0 (nearest multiple of 64 at or below 50).
  4. Broadcast = 192.168.10.0 OR 0.0.0.63 = 192.168.10.63.
  5. Usable host range: 192.168.10.1 to 192.168.10.62 = 62 hosts.
  6. Classification: Class C, private (RFC 1918).

Result: Network 192.168.10.0/26, broadcast 192.168.10.63, 62 usable hosts from 192.168.10.1 to 192.168.10.62.

Frequently asked questions

What is the difference between IP classes and CIDR?
Classful addressing (Class A/B/C/D/E) uses the first octet to determine the network size and has been considered obsolete since 1993. CIDR (Classless Inter-Domain Routing, RFC 4632) uses a flexible prefix length so address blocks can be sized precisely, conserving address space. Modern routers use CIDR exclusively.
Which ranges are considered private IPs?
RFC 1918 defines three private ranges: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Additionally there is CGNAT 100.64.0.0/10 (RFC 6598) for ISPs, loopback 127.0.0.0/8, link-local 169.254.0.0/16 (RFC 3927), and documentation ranges 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24.
Why does /31 have 2 hosts instead of 0?
Traditionally /31 has 2 addresses with 1 network + 1 broadcast, leaving 0 usable hosts. RFC 3021 (December 2000) revised this specifically for point-to-point links: both addresses are used as host endpoints with no network/broadcast concept. Most modern routers support this; if not, fall back to /30.
How do I split a /24 into 4 equal-sized subnets?
Add 2 bits (log2 4 = 2) to the prefix: /24 + 2 = /26. Each subnet has 64 addresses with 62 usable hosts. For 192.168.1.0/24 the result is: 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26, 192.168.1.192/26. Use the Split feature to visualize this automatically.
Is a subnet mask of 255.255.255.255 valid?
Yes, it is equivalent to /32 and points to a single host, commonly used on router loopback interfaces or for advertising specific routes via BGP. There is no network or broadcast address; just one IP. Conversely, 0.0.0.0 (mask /0) represents all IPs (the default route).

Last updated: May 11, 2026

Sponsored