Developer
IPv4 CIDR Calculator
Enter an IPv4 address and prefix to see network, broadcast, netmask, wildcard, and host range. Prefixes /31 and /32 keep every address. Copy the summary.
Enter an IPv4 CIDR to inspect the subnet.
Subnet details
—
Output actions
Ready to copy output once your result appears.
Network, mask, and host range
IPv4 CIDR Calculator takes one address and a prefix length from 0 to 32. It applies a bitwise mask and prints the network, broadcast, netmask, wildcard, host range, total address count, and usable host count. Prefixes 31 and 32 do not subtract two for a network and broadcast reservation. IPv6 is rejected.
How to calculate a subnet
- 1The field IPv4 CIDR opens as 192.168.1.10/24. Replace it with address/prefix, or press Load sample, which writes 10.0.0.15/28. Press Enter in the field or press Calculate.
- 2Read Subnet details. The eight lines are address, network, broadcast, netmask, wildcard, host range, total addresses, and usable hosts. The status reads Subnet calculated.
- 3Press Copy output for those lines. There is no download control and no list of every host.
What it is good for
- • Seeing the network and broadcast for a prefix you were given as a single CIDR.
- • Checking /31 and /32, where the usable count is the whole block.
- • Turning a leading-zero octet into the decimal value the calculator actually stored.
Example
Input
192.168.1.10/24
Output
Address: 192.168.1.10/24 Network: 192.168.1.0/24 Broadcast: 192.168.1.255 Netmask: 255.255.255.0 Wildcard: 0.0.0.255 Host range: 192.168.1.1 - 192.168.1.254 Total addresses: 256 Usable hosts: 254
This is the text already in the field when the page opens. Calculate does not change the typed address. 10 is a host inside 192.168.1.0/24.
What the eight lines mean
The address line reprints the parsed octets and the prefix, so 192.168.001.010/24 is shown as 192.168.1.10/24. Leading zeros are decimal, not octal. The network is the address with the host bits cleared. For a /24 that is the first three octets plus 0. The broadcast is the network with the host bits set, 192.168.1.255 for that /24. The netmask is the prefix as a dotted value, 255.255.255.0. The wildcard is the bitwise complement of the mask, 0.0.0.255. Host range excludes the network and the broadcast when the prefix is 30 or shorter, so /24 runs from 192.168.1.1 through 192.168.1.254. Total addresses is 2 to the power of 32 minus the prefix, which is 256 for /24. Usable hosts is that total minus 2, which is 254.
Load sample uses 10.0.0.15/28. The mask for /28 is 255.255.255.240, the wildcard is 0.0.0.15, and the block size is 16. The network is 10.0.0.0/28, the broadcast is 10.0.0.15, and the host range is 10.0.0.1 through 10.0.0.14, with 14 usable hosts. The typed 15 is the broadcast of that block, and the address line still shows 10.0.0.15/28. The page does not mark the address as a broadcast in a separate warning.
Prefixes 0, 31, and 32
A prefix of 31 or 32 sets usable hosts equal to the total, and the host range runs from the network through the broadcast. /32 has one address: network, broadcast, first host, and last host are the same dotted value, total 1, usable 1, netmask 255.255.255.255, wildcard 0.0.0.0. /31 has two addresses and usable 2. For 10.1.2.3/31 the network is 10.1.2.2/31, the broadcast is 10.1.2.3, and the host range is 10.1.2.2 - 10.1.2.3. The calculator does not apply the older rule that reserves both ends inside a /31.
Prefix 0 uses a zero mask. 0.0.0.0/0 prints network 0.0.0.0/0, broadcast 255.255.255.255, netmask 0.0.0.0, wildcard 255.255.255.255, host range 0.0.0.1 - 255.255.255.254, total addresses 4294967296, and usable hosts 4294967294. The page does not print every address in that range. Prefix values must be integers. 24.5, a minus sign, or 33 fails with CIDR prefix must be an integer from 0 to 32.
When a mask octet needs another base
The netmask and wildcard are already dotted decimal. This page does not print the mask in binary or hexadecimal. A single integer, such as the prefix 28 or the octet 240, can be rewritten on the number base converter, which converts one number among binary, octal, decimal, and hex. It does not accept a dotted quad, so paste one octet or the prefix, not the whole CIDR.
The field does not split a list of routes. One address, a slash, and one prefix. Press Enter or Calculate. Load sample replaces the field and does not calculate until you ask. Copy output copies the eight lines from the last success. A later error clears the panel, so there is nothing new to copy until the next success.
Addresses the parser refuses
Four decimal octets are required, each matching digits only and each in the range 0 through 255. A letter, an empty octet, or a fifth dot fails. 256 in any position fails with Each octet must be between 0 and 255. A non-digit fails with Each octet must be numeric. Fewer or more than four parts fails with IPv4 addresses must use four dotted octets. A missing slash fails with Use the form address/prefix, for example 10.0.0.5/28. An empty field fails with Enter an IPv4 address with a CIDR prefix, for example 192.168.1.10/24.
IPv6 text, including a compressed colon form, does not parse. There is no zone index and no IPv4-mapped IPv6 form. The page also does not emit a reverse-DNS name, a range expressed as a firewall rule, or a list of hosts. Usable hosts is a count, and the host range is only the first and last address.
Rules and limitations
Input is IPv4 address/prefix. Octets are decimal 0–255, and leading zeros stay decimal. The prefix is an integer 0–32. Output is eight labeled lines: address, network, broadcast, netmask, wildcard, host range, total, usable.
Prefixes 0–30 reserve the network and broadcast in the usable count. Prefixes 31 and 32 count every address as usable. There is no IPv6, no host inventory, and no download control.
Common problems
If 192.168.001.010/24 shows 192.168.1.10/24, the zeros were decimal padding. The calculator does not read 010 as octal eight.
If /31 reports two usable hosts, that is the rule on this page. It does not subtract a network address and a broadcast address inside a two-address block.
Frequently asked questions
Why does /32 say one usable host?
For prefixes 31 and 32 the usable count equals the total. A /32 has one address, so usable hosts is 1 and the host range is that single address.
Are leading zeros octal?
No. 010 is decimal 10. The address line reprints the octets without the extra zeros.
Does it list every host?
No. It prints the first and last host and the counts. A /0 still prints only those summary lines, with total addresses 4294967296.
Can I enter an IPv6 prefix?
No. The parser requires four decimal octets and a prefix from 0 to 32. Colon-separated addresses fail the IPv4 check.
Is my input uploaded or saved?
This tool processes input in your browser and does not save its input or output to local storage. Copy and download are user actions. The site uses analytics for page and action metadata and may use ads and production error reporting; see the Privacy Policy for those services.
About this tool
Maintained by Toolbench. For large or deeply nested files, split the input into smaller batches and verify representative results before using them in an import or application. Report reproducible problems through Contact.
Next steps
Related tools
Continue the workflow with nearby tools for formatting, publishing, debugging, or follow-up checks.
Number Base Converter
Convert one whole number between binary, octal, decimal, and hexadecimal.
Open Number Base ConverterText Diff Viewer
Compare two text blocks line by line, by row index.
Open Text Diff ViewerURL and Query String Parser
Split a URL or query string into components and decoded parameters.
Open URL and Query String ParserHTML Beautifier
Reindent HTML with 2 spaces, 4 spaces, or a tab.
Open HTML BeautifierTrust
Policies, contact, and answers
Clear pages for how Toolbench works, what we collect, and how to reach us.