๐ŸŒ

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.
IPv4 Subnet Calculator
Compute network address, broadcast, host range, total addresses, wildcard, IP class, plus binary and hex representations. Supports both CIDR notation (/0-/32) and dotted-decimal masks. Divide a subnet into smaller equal subnets.
Format: X.X.X.X (e.g. 192.168.1.100). Each octet 0-255.
Slide or type a number. /24 means 24 network bits, 8 host bits (256 addresses).
Format: X.X.X.X (e.g. 255.255.255.0). Auto-syncs with CIDR.
Network
192.168.1.0/24
Total Addresses: 256 โ€ข Usable Hosts: 254 โ€ข Private (RFC 1918)
Summary
Network Address192.168.1.0
Broadcast Address192.168.1.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Usable Host Range192.168.1.1 - 192.168.1.254
Total Addresses256
Usable Hosts254
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
CIDR/24
IP ClassClass C
IP TypePrivate (RFC 1918)
Binary Representation
IP (Binary)11000000.10101000.00000001.01100100
Mask (Binary)11111111.11111111.11111111.00000000
Network (Binary)11000000.10101000.00000001.00000000
IP (Hexadecimal)0xC0A80164
Subnet Division
Enter 2, 4, 8, 16, 32, 64, 128, etc. The network is split evenly.
Division Result: /26 (255.255.255.192) - 64 addresses each
No.NetworkBroadcastHost RangeCount
1192.168.1.0/26192.168.1.63192.168.1.1 - 192.168.1.6262
2192.168.1.64/26192.168.1.127192.168.1.65 - 192.168.1.12662
3192.168.1.128/26192.168.1.191192.168.1.129 - 192.168.1.19062
4192.168.1.192/26192.168.1.255192.168.1.193 - 192.168.1.25462
Common Subnet Reference
CIDRSubnet MaskTotal AddressesUsable Hosts
/16255.255.0.065,53665,534
/17255.255.128.032,76832,766
/18255.255.192.016,38416,382
/19255.255.224.08,1928,190
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422
/32255.255.255.25511
About IPv4 Subnetting
What is CIDR?
Classless Inter-Domain Routing (CIDR) expresses a subnet mask as the count of leading "1" bits. For example, /24 means the first 24 bits are network, the rest are host. CIDR replaced the rigid Class A/B/C system with flexible subnet sizes.
Why is /24 so common?
/24 (255.255.255.0) gives 256 addresses with 254 usable hosts, perfect for one office network or VLAN. Easy to remember, easy to split, and matches a comfortable ethernet broadcast domain size.
Subnetting Math
Total addresses = 2^(32 - CIDR). Usable hosts = total - 2 (subtract network + broadcast). Exceptions: /31 (RFC 3021) = 2 hosts for point-to-point links, /32 = a single host address.
Private IPs (RFC 1918)
Three blocks are reserved for private networks: 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16. Not routed on the public internet, must traverse NAT to reach the outside.
CGNAT (RFC 6598)
100.64.0.0/10 is reserved for Carrier-Grade NAT. ISPs use it to share a single public IP among many subscribers. Avoid using it as your LAN range as it can collide with your ISP.
IPv4 vs IPv6
IPv4 only provides ~4.3 billion addresses and has long been exhausted (IANA pool ran out in 2011). IPv6 (128 bits, ~3.4 x 10^38 addresses) is the long-term answer. Default IPv6 subnet size is /64.
Results are technical information for network planning. Production configuration still requires validation directly on the devices and connectivity testing.

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