IPv4 subnet and netmask calculator
Calculate IPv4 subnet boundaries and usable endpoints, or convert a netmask and prefix.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Calculate the network, full address range, netmask, wildcard mask, and usable endpoints for one IPv4/CIDR. Switch to mask conversion for dotted masks and prefixes. Copy one field or download the complete JSON.
How to use this tool
- Select Calculate subnet or Convert netmask / prefix above the input.
- Enter IPv4/CIDR such as 192.168.1.34/24, or a mask such as 255.255.255.0.
- Review the preview, calculate, then copy a field or download the JSON.
Supported inputs and limits
One IPv4/CIDR or mask at a time. IPv6, batches, DNS, geolocation, and network scans are outside this calculator.
/31 has two point-to-point endpoints; /32 is one host route; /0 is a default route with no meaningful usable-host count.
Calculations run locally in your browser.
Worked example
Example input
192.168.1.34/24
Example options
{}Example output
{
"address": "192.168.1.34",
"cidr": "192.168.1.0/24",
"network": "192.168.1.0",
"lastAddress": "192.168.1.255",
"broadcast": "192.168.1.255",
"netmask": "255.255.255.0",
"wildcard": "0.0.0.255",
"prefix": 24,
"addresses": "256",
"firstHost": "192.168.1.1",
"lastHost": "192.168.1.254",
"usableHosts": "254",
"kind": "subnet"
}When something does not work
Check that you entered one IPv4/CIDR, contiguous dotted netmask, or prefix for the selected task.
Frequently asked questions
Can I convert a dotted netmask to a prefix?
Yes. Select Convert netmask / prefix and enter a contiguous dotted mask such as 255.255.255.0. The result gives /24 and its wildcard mask.
What happens with /31, /32, and /0?
A /31 has two usable point-to-point endpoints and no directed broadcast. A /32 is a single host route. A /0 is a default route, so this calculator does not label a broadcast or usable-host count.
Does it contact the address or scan a network?
No. This calculator performs local IPv4 arithmetic in your browser.
Is my input sent to a server?
No. Tool input is processed in your browser. Save any results you need before closing the tab.
Documentation & further reading
Related tools
IP range to CIDR
Turn an inclusive IPv4 address range into the smallest exact list of CIDR blocks.
Aggregate CIDR blocks
Reduce an IPv4 CIDR list without changing its address coverage.
IPv4 number converter
Convert one IPv4 address between dotted decimal, unsigned integer and 32-bit binary.
IPv6 expand and compress
Convert one IPv6 address to canonical, expanded and colon-free 32-digit forms.