IPv4 Subnet & CIDR Calculator
Calculate network address, broadcast address, subnet mask, wildcard mask, and usable IP range for any IPv4 address and CIDR prefix.
Algorithm Step-by-Step Simulator
Enter your custom input data → Run the real algorithm engine → Observe step transitions.
⚙️ Customize Algorithm Input Data
Mathematical Formula
Overview & Explanation
An IPv4 Subnet Calculator partitions IP networks into logical sub-networks, determining exact network boundaries, broadcast addresses, and host capacities.
How It Works
- Convert IP address and CIDR prefix to 32-bit binary representations.
- Apply Bitwise AND with subnet mask to calculate Network Address.
- Apply Bitwise OR with wildcard mask to calculate Broadcast Address.
Practical Applications
- Network engineering
- VLSM design
- Cloud VPC CIDR allocation
How a subnet is worked out
An IPv4 address has 32 bits. The prefix length, as in /26, says how many bits identify the network, and the remaining 32 - prefix bits identify hosts. A subnet holds 2^(32 - prefix) addresses, and normally 2 are reserved: the network address and the broadcast address. So usable hosts = 2^(32 - prefix) - 2.
A /24 has 256 addresses and 254 usable hosts. A /26 has a mask of 255.255.255.192 and 64 addresses per block, so 192.168.10.0/24 splits into the blocks .0, .64, .128 and .192.
Worked example
For 192.168.10.77/26, 77 falls in the block starting at 64. The network address is 192.168.10.64, the broadcast is 192.168.10.127 and the usable hosts run from .65 to .126, which is 62 addresses. A quick method is to find the block size, 256 minus the last non-255 mask octet, and see which multiple of it your address falls in.
Edge cases
A /30 gives 2 usable hosts, a classic choice for point-to-point links. A /31 can be used for point-to-point links with both addresses usable (RFC 3021), and a /32 identifies a single host.
Subnetting 192.168.1.100/24
Calculating network metrics for /24 prefix
Mask
32 - 24 = 8 host bits
Network
192.168.1.100 & Mask
Broadcast
Network | Wildcard
Frequently Asked Questions
How many usable hosts does a /24 subnet support?
What is CIDR notation?
Why can't I use the network and broadcast addresses?
Related Calculators
Digital Logic & Truth Table Generator
Generate interactive truth tables and evaluate Boolean logic gates (AND, OR, NOT, NAND, NOR, XOR, XNOR).
Bubble Sort Visualizer & Step Calculator
Interactive step-by-step Bubble Sort execution visualizer with comparisons, swaps, and time complexity breakdown.
Selection Sort Visualizer & Calculator
Step-by-step Selection Sort execution visualizer tracking minimum element indices, swaps, and comparisons.
Insertion Sort Visualizer & Step Generator
Interactive Insertion Sort step generator showing array shifts and key element insertion.