Subnet Calculator
Calculate IPv4 or IPv6 network boundaries, mask, last address and exact address count. Compressed IPv6 and embedded IPv4 tails are accepted; IPv6 counts remain exact decimal strings.
- Explicit formulas and worked examples
- Check your inputs, then calculate
- Data is calculated in this browser only
Check the stated input format, calculation convention and limits before using the result.
Check the example inputs, then calculate. Your values stay in this browser.
IPv4 uses /0–/32, with /31 point-to-point and /32 single-address host-count conventions. IPv6 uses /0–/128 and has no broadcast-address subtraction.
Understand the Subnet Calculator
Choose the right record before calculating
Select an IPv4 or IPv6 address and valid prefix length. The containing network is found by clearing host bits. Raw address counts are family-specific; IPv4 broadcast-host conventions must not be copied into IPv6. The output inspects a range and does not configure a network.
Content and calculation reviewed:
Understand the calculation
How to use it and the math behind it
Four steps to check your inputs and results
- Calculate IPv4 or IPv6 network boundaries, mask, last address and exact address count. Compressed IPv6 and embedded IPv4 tails are accepted; IPv6 counts remain exact decimal strings.
- Enter IPv4 or IPv6 address, Prefix length (IPv4 0–32; IPv6 0–128) in the stated format. Baseline values are for reproduction.
- Check the output unit and convention: Read network with its stated unit and convention. The default example and the independent worked scenario use different inputs, so compare the assumptions before comparing the numbers.
- Change one input and compare the result. IPv4 uses /0–/32, with /31 point-to-point and /32 single-address host-count conventions. IPv6 uses /0–/128 and has no broadcast-address subtraction. A count does not establish device routability or subnet allocation policy. VLSM planning, zone identifiers, discovery and configuration are outside this tool.
Subnet Calculator: calculation relationships
The prefix fixes network bits and leaves 32−prefix host bits. A /30 has 2²=4 addresses; 192.0.2.6 belongs to the block 192.0.2.4–192.0.2.7 with mask 255.255.255.252. Under the traditional broadcast convention, two addresses are usable hosts. /31 point-to-point links and /32 addresses use the separately stated exceptions. IPv6 prefixes instead span 0–128. A /128 is one address; a /127 is two. Compressed input is expanded internally before applying the mask, then output follows longest-zero-run compression.
size = 2^(address bits−prefix); network = floor(address/size) × size; address bits = 32 or 128
The detailed guide adds variable definitions, a reproducible example, a practice question and model limitations.
Questions before you calculate
Can this handle IPv6?
Yes. It uses 128-bit prefix arithmetic and exact large address counts.
Why does my entered address normalize?
Host bits are cleared to identify the containing prefix.
Does IPv6 reserve a broadcast endpoint?
No IPv4-style broadcast endpoint is subtracted from the raw range.
Why do /31 and /32 differ from ordinary IPv4 host counts?
/31 has a point-to-point convention and /32 is a single-address range.
Does the result authorize an allocation?
No. It is range arithmetic, not an operational assignment.
From question to result