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
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)
| CIDR | Netmask | Wildcard | Usable Hosts |
|---|---|---|---|
| /0 | 0.0.0.0 | 255.255.255.255 | 4,294,967,294 |
| /1 | 128.0.0.0 | 127.255.255.255 | 2,147,483,646 |
| /2 | 192.0.0.0 | 63.255.255.255 | 1,073,741,822 |
| /3 | 224.0.0.0 | 31.255.255.255 | 536,870,910 |
| /4 | 240.0.0.0 | 15.255.255.255 | 268,435,454 |
| /5 | 248.0.0.0 | 7.255.255.255 | 134,217,726 |
| /6 | 252.0.0.0 | 3.255.255.255 | 67,108,862 |
| /7 | 254.0.0.0 | 1.255.255.255 | 33,554,430 |
| /8 | 255.0.0.0 | 0.255.255.255 | 16,777,214 |
| /9 | 255.128.0.0 | 0.127.255.255 | 8,388,606 |
| /10 | 255.192.0.0 | 0.63.255.255 | 4,194,302 |
| /11 | 255.224.0.0 | 0.31.255.255 | 2,097,150 |
| /12 | 255.240.0.0 | 0.15.255.255 | 1,048,574 |
| /13 | 255.248.0.0 | 0.7.255.255 | 524,286 |
| /14 | 255.252.0.0 | 0.3.255.255 | 262,142 |
| /15 | 255.254.0.0 | 0.1.255.255 | 131,070 |
| /16 | 255.255.0.0 | 0.0.255.255 | 65,534 |
| /17 | 255.255.128.0 | 0.0.127.255 | 32,766 |
| /18 | 255.255.192.0 | 0.0.63.255 | 16,382 |
| /19 | 255.255.224.0 | 0.0.31.255 | 8,190 |
| /20 | 255.255.240.0 | 0.0.15.255 | 4,094 |
| /21 | 255.255.248.0 | 0.0.7.255 | 2,046 |
| /22 | 255.255.252.0 | 0.0.3.255 | 1,022 |
| /23 | 255.255.254.0 | 0.0.1.255 | 510 |
| /24 | 255.255.255.0 | 0.0.0.255 | 254 |
| /25 | 255.255.255.128 | 0.0.0.127 | 126 |
| /26 | 255.255.255.192 | 0.0.0.63 | 62 |
| /27 | 255.255.255.224 | 0.0.0.31 | 30 |
| /28 | 255.255.255.240 | 0.0.0.15 | 14 |
| /29 | 255.255.255.248 | 0.0.0.7 | 6 |
| /30 | 255.255.255.252 | 0.0.0.3 | 2 |
| /31 | 255.255.255.254 | 0.0.0.1 | 2 |
| /32 | 255.255.255.255 | 0.0.0.0 | 1 |
How to Use This Tool
- 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.
- 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.
- 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).
{
"ip": "192.168.1.10",
"prefix": 24
}- 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
How It Was Calculated (Formulas & Steps)
Mathematical Formulas
- Network Address = IP Address AND Subnet Mask
- Wildcard Mask = NOT (Subnet Mask)
- Broadcast Address = Network Address OR Wildcard Mask
- Total Addresses = 2^(32 − Prefix)
- Usable Hosts = 2^(32 − Prefix) − 2 (for /0 to /30), 2 addresses for /31 (RFC 3021), and 1 address for /32
Step-by-Step Calculation
- Input: 192.168.1.10/24 (Host bits = 32 − 24 = 8)
- Netmask: 255.255.255.0 (11111111.11111111.11111111.00000000), Wildcard: 0.0.0.255
- Network Address = 192.168.1.10 AND 255.255.255.0 = 192.168.1.0
- Broadcast Address = 192.168.1.0 OR 0.0.0.255 = 192.168.1.255
- Usable Hosts = 2^8 − 2 = 256 − 2 = 254 (192.168.1.1 – 192.168.1.254)
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.
Related Calculators
Split an IPv4 network into N equal subnets or allocate boundary-aligned VLSM blocks by required host count with CSV and Markdown export.
Expand and compress IPv6 addresses per RFC 5952, calculate network prefix boundaries, /64 SLAAC subnet counts, and child prefix blocks.
Calculate Limit-At (CIR), Max-Limit (MIR), Burst, PCQ, and FQ-CoDel for RouterOS v7 with automated configuration script generation.
References & Notes
- RFC 1918 — Address Allocation for Private Internets
- RFC 3021 — Using 31-Bit Prefixes on IPv4 Point-to-Point Links
- RFC 6598 — IANA-Reserved IPv4 Prefix for Shared Address Space (CGNAT)
- RFC 4632 — Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan
Note: Results above are mathematical estimates based on standard formulas. Always verify against official vendor documentation and site conditions before production deployment.