IPv4 Subnet Calculator
Calculate a CIDR network, mask, full address range, broadcast convention and host range from an IPv4 address and prefix or dotted subnet mask.
YOUR CALCULATION
Result
—
Calculation steps
Work through one step at a time or reveal the complete calculation. The steps use your current inputs.
How to calculate
Interpret the IPv4 address as an unsigned 32-bit number. A prefix defines a power-of-two address block; round the input address down to the block boundary and calculate the final address.
Block size=2^(32−prefix); network=floor(address/block size)×block size
Worked example
192.168.1.130/26 belongs to 192.168.1.128/26 with mask 255.255.255.192. The conventional host range is .129–.190 and broadcast is .191, with 62 host addresses.
Assumptions and input details
Accepts four decimal octets 0–255 without leading zeros; no octal, shorthand, IPv6 or embedded slash. Prefix is an integer 0–32. Dotted masks must have contiguous leading one bits. For /0–/30 the conventional host count excludes network and broadcast. /31 reports two endpoints under RFC 3021 point-to-point usage; /32 reports one host route. /31 and /32 have no separate broadcast in this convention. Counts are arithmetic and do not imply every address is publicly routable, assignable or available; reserved ranges and specific network policy remain outside this calculator.
References: RFC 4632 CIDR · RFC 3021 point-to-point /31
Using this calculator
Can I enter my own problem?
Yes. Replace the example values with your own inputs. The result, calculation steps, tables and applicable diagrams update from those inputs. Blank or invalid values clear the result; example values are never silently substituted for missing inputs.
Are the results exact?
Results use floating-point arithmetic and displayed rounding. Read the formula, assumptions and any stated data precision before interpreting the result.
Is my input uploaded?
The calculation runs in your browser. No account, file upload or external AI service is required. Inputs are not saved between page reloads.
Convert a signed integer between bases 2–36 using exact arithmetic. Compare binary, octal, decimal, hexadecimal and base-36 values with place-value steps.
Find transfer time, required nominal speed or data size. Distinguish bits, bytes, decimal and binary units and include an explicit effective-throughput percentage.
Divide signed integers with a nonnegative remainder. Verify the identity and use the same modulo convention for cyclic positions and clock arithmetic.
Reserved advertising space.