Skip to main content

IPv4 Subnet and CIDR Calculator

Calculate IPv4 network address, broadcast, usable host range, netmask, wildcard, binary mask, and RFC address type (RFC 1918, /31, CGNAT).

Input Parameters

Try Example:

Accepts 192.168.1.10/24, 192.168.1.10 255.255.255.0, or 192.168.1.10 0.0.0.255.

Used when the IP field above does not include an inline /prefix or mask.

Calculation Results

ip
192.168.1.10
prefix
24
cidr
192.168.1.0/24
network
192.168.1.0
broadcast
192.168.1.255
firstUsable
192.168.1.1
lastUsable
192.168.1.254
usableCount
254
totalAddresses
256
netmask
255.255.255.0
wildcard
0.0.0.255
binaryMask
11111111.11111111.11111111.00000000
binaryIp
11000000.10101000.00000001.00001010
addressType
Private (RFC 1918)
ipClass
C
hexIp
0xC0A8010A
reverseArpa
1.168.192.in-addr.arpa
CIDR Quick Reference Table (/0 to /32)
CIDRNetmaskWildcardUsable Hosts
/00.0.0.0255.255.255.2554,294,967,294
/1128.0.0.0127.255.255.2552,147,483,646
/2192.0.0.063.255.255.2551,073,741,822
/3224.0.0.031.255.255.255536,870,910
/4240.0.0.015.255.255.255268,435,454
/5248.0.0.07.255.255.255134,217,726
/6252.0.0.03.255.255.25567,108,862
/7254.0.0.01.255.255.25533,554,430
/8255.0.0.00.255.255.25516,777,214
/9255.128.0.00.127.255.2558,388,606
/10255.192.0.00.63.255.2554,194,302
/11255.224.0.00.31.255.2552,097,150
/12255.240.0.00.15.255.2551,048,574
/13255.248.0.00.7.255.255524,286
/14255.252.0.00.3.255.255262,142
/15255.254.0.00.1.255.255131,070
/16255.255.0.00.0.255.25565,534
/17255.255.128.00.0.127.25532,766
/18255.255.192.00.0.63.25516,382
/19255.255.224.00.0.31.2558,190
/20255.255.240.00.0.15.2554,094
/21255.255.248.00.0.7.2552,046
/22255.255.252.00.0.3.2551,022
/23255.255.254.00.0.1.255510
/24255.255.255.00.0.0.255254
/25255.255.255.1280.0.0.127126
/26255.255.255.1920.0.0.6362
/27255.255.255.2240.0.0.3130
/28255.255.255.2400.0.0.1514
/29255.255.255.2480.0.0.76
/30255.255.255.2520.0.0.32
/31255.255.255.2540.0.0.12
/32255.255.255.2550.0.0.01

How to Use This Tool

  1. Enter an IPv4 address in the input field using CIDR notation (e.g. 192.168.1.10/24), IP with netmask (192.168.1.10 255.255.255.0), IP with wildcard mask (192.168.1.10 0.0.0.255), or enter a bare IP and select a prefix length from /0 to /32.
  2. Review the instant calculation results including Network Address, Broadcast Address, First and Last Usable Host range, Usable Host Count, Netmask, Wildcard Mask, binary mask representation, and RFC address classification.
  3. Use the Copy buttons, export to Markdown or CSV, or expand the CIDR Quick Reference Table (/0 to /32) to compare adjacent subnet block sizes.

Worked Example: Office LAN /24 (192.168.1.10/24)

For input 192.168.1.10/24, a bitwise AND with netmask 255.255.255.0 produces network address 192.168.1.0 and broadcast address 192.168.1.255 (wildcard 0.0.0.255). Out of 256 total addresses (2^8), there are 254 usable host addresses ranging from 192.168.1.1 to 192.168.1.254 classified as Private (RFC 1918).

Example Input
{
  "ip": "192.168.1.10",
  "prefix": 24
}
Calculated Output
ip:
192.168.1.10
prefix:
24
cidr:
192.168.1.0/24
network:
192.168.1.0
broadcast:
192.168.1.255
firstUsable:
192.168.1.1
lastUsable:
192.168.1.254
usableCount:
254
totalAddresses:
256
netmask:
255.255.255.0
wildcard:
0.0.0.255
binaryMask:
11111111.11111111.11111111.00000000
binaryIp:
11000000.10101000.00000001.00001010
addressType:
Private (RFC 1918)
ipClass:
C
hexIp:
0xC0A8010A
reverseArpa:
1.168.192.in-addr.arpa

Core Concept & Engineering Notes

IPv4 subnetting and Classless Inter-Domain Routing (CIDR) calculation form the foundation of modern IP network design and routing architecture. Every IPv4 address consists of 32 bits written as four dotted-decimal octets ranging from 0.0.0.0 to 255.255.255.255. A CIDR prefix length such as /24 specifies how many leading bits from the left identify the network segment, while the remaining trailing bits (32 minus the prefix length) identify individual host interfaces within that broadcast domain. This calculator determines the network address using a bitwise AND operation between the IPv4 address and the netmask, and computes the broadcast address using a bitwise OR between the network address and the wildcard mask. For standard prefixes from /0 through /30, two addresses are reserved in every block—the first address identifies the network itself and the last address serves as the directed broadcast address—leaving two to the power of the host bits minus two usable host addresses. Special handling applies to /31 point-to-point router links defined in RFC 3021, which provide two usable addresses with no broadcast waste, and /32 host routes, which lock onto a single interface address. Common operational mistakes include sizing a VLAN subnet too tightly without room for future DHCP growth, inverting netmasks and wildcard masks when configuring OSPF network statements or firewall access control lists, and overlapping RFC 1918 private ranges across VPN tunnels. Inspecting the exact network boundary, usable host range, binary mask structure, and RFC address classification helps network engineers prevent routing overlaps and interface misconfigurations before deploying changes to production switches and routers.

How It Was Calculated (Formulas & Steps)

Frequently Asked Questions (FAQ)

Why does a /24 subnet have 254 usable hosts instead of 256?

A /24 subnet leaves 8 host bits, yielding 2^8 = 256 total addresses. However, the first address (e.g. 192.168.1.0) is reserved as the Network ID and the last address (192.168.1.255) is reserved as the Broadcast Address, leaving 254 assignable host addresses.

When should I use a /30 vs a /31 prefix for point-to-point router links?

A /30 prefix allocates 4 total addresses (2 usable hosts) and works with all legacy equipment. A /31 prefix (RFC 3021) saves 50% of IPv4 space by providing 2 usable point-to-point addresses with no broadcast address, and is supported by virtually all modern routers.

What is the difference between a Subnet Mask and a Wildcard Mask?

A subnet mask uses binary 1s to mark network bits and 0s for host bits (e.g. /24 = 255.255.255.0). A wildcard mask is the bitwise inverse (NOT) of the subnet mask (e.g. /24 = 0.0.0.255) and is commonly used in OSPF network statements and router ACLs.

What is the CGNAT 100.64.0.0/10 (RFC 6598) address range?

The 100.64.0.0/10 block (100.64.0.0 through 100.127.255.255) is reserved by IANA under RFC 6598 specifically for Carrier-Grade NAT (Shared Address Space) between service provider cores and customer premises equipment so it does not collide with customer RFC 1918 LANs.

References & Notes

Last updated: Content Status: Draft (Pending Editorial Review)

Note: Results above are mathematical estimates based on standard formulas. Always verify against official vendor documentation and site conditions before production deployment.