Subnet Calculator
Enter an IPv4 address with a CIDR prefix such as 192.168.1.10/24, or with a subnet mask such as 255.255.255.0. The calculator returns the network details.
Result
- Broadcast address
- 192.168.1.255
- Total addresses
- 256
- Subnet mask
- 255.255.255.0
- Wildcard mask
- 0.0.0.255
- Address class
- C
- Address type
- Private (RFC 1918)
- Mask in binary
- 11111111.11111111.11111111.00000000
- Address in binary
- 11000000.10101000.00000001.00001010
Formula
- Network address = IP address AND subnet mask
- Broadcast address = network address OR wildcard mask
- Total addresses = 2^(32 − prefix)
- Usable hosts = 2^(32 − prefix) − 2
How the Subnet Calculator works
An IPv4 address is 32 bits. The prefix length says how many of the leading bits identify the network. The remaining bits identify hosts within it. A /24 leaves 8 host bits, which is 256 addresses.
The first address in a subnet is the network address and the last is the broadcast address, so neither is assigned to a device. That is why a /24 has 254 usable hosts.
The subnet mask is the same information written as four numbers: a /24 is 255.255.255.0. The wildcard mask is its inverse and is used in access control lists.
Worked example
192.168.1.10/24 has the mask 255.255.255.0. The network is 192.168.1.0, the broadcast address is 192.168.1.255, and hosts run from 192.168.1.1 to 192.168.1.254, which is 254 usable addresses.
Frequently asked questions
How many hosts are in a /24, /25 and /26?
A /24 has 254 usable hosts, a /25 has 126 and a /26 has 62. Each extra prefix bit halves the block.
What is the subnet mask for /16?
255.255.0.0, which gives 65,534 usable hosts.
Which IP ranges are private?
10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are reserved for private networks by RFC 1918.
Related calculators
- Hex CalculatorAdd, subtract, multiply and divide hexadecimal, binary, octal or decimal numbers, and apply bitwise AND, OR and XOR. Results in all four bases.
- Binary Translator: Text to BinaryConvert text to binary code and binary back to text. Uses 8-bit bytes with UTF-8, so it handles ASCII and every other character.
- Chmod CalculatorBuild Unix file permissions by ticking read, write and execute for owner, group and others. Get the octal number, symbolic notation and chmod command.
- Morse Code TranslatorTranslate text to Morse code and Morse code back to text. Supports letters, numbers and punctuation in International Morse Code.
- Hex Translator: Text to HexadecimalConvert text to hexadecimal bytes and hex back to text using UTF-8. Useful for reading hex dumps and encoding strings.
- Base64 Encoder and DecoderEncode text to Base64 or decode Base64 back to text, with full UTF-8 support and a URL-safe variant.
- Text to ASCII and Unicode ConverterConvert text to ASCII codes and Unicode code points in decimal and hex, or turn a list of character codes back into text.
- Caesar Cipher Encoder and SolverEncrypt or decrypt text with a Caesar shift cipher. Shows all 25 possible shifts so you can solve a cipher without knowing the key, including ROT13.
- Letter to Number Converter (A1Z26)Convert letters to their alphabet position numbers, where A is 1 and Z is 26, or convert numbers back to letters.
- IEEE 754 Floating Point ConverterConvert a decimal number to its IEEE 754 single and double precision representation: sign, exponent and mantissa bits, hex value and the exact stored number.
Related unit converters
Calculations run in your browser and nothing you enter is sent to a server. Results are provided for general information. Check critical figures independently before relying on them.