Subnet Mask Calculator
Calculate subnet mask, network address, broadcast address, number of hosts, and more from an IP address and CIDR prefix length.
Was this calculator helpful?
How to use this tool?
This calculator computes key subnet details from an IP address and CIDR prefix.
- Enter IP Address – Type a valid IPv4 address (e.g.,
192.168.1.0). - Enter CIDR Prefix – Provide a number between
0and32(e.g.,24). - Click "Calculate" – The form validates inputs and displays results.
Outputs explained:
- Network Address – The subnet’s base address.
- Broadcast Address – The subnet’s broadcast address.
- Subnet Mask – Dotted decimal mask (e.g.,
255.255.255.0). - Number of Hosts – Usable hosts (2^(32-CIDR) – 2).
- First/Last Usable Host – Range for assigning to devices.
Note: For CIDR /31 or /32, host fields show "N/A" (no usable hosts).
Previous Results
| Result | Inputs | Date |
|---|
Frequently Asked Questions
A subnet mask is a 32-bit number that divides an IP address into network and host portions, used to identify the subnet to which a device belongs.
CIDR (Classless Inter-Domain Routing) notation is a compact representation of an IP address and its associated routing prefix, written as IP address followed by a slash and the prefix length (e.g., 192.168.1.0/24).
The number of usable hosts is 2^(32 - prefix length) - 2, subtracting the network and broadcast addresses.