Hexadecimal Calculator
Convert hex, decimal, binary and octal integers, or calculate exact hexadecimal arithmetic.
Calculate IPv4 and IPv6 subnets using an IP address and CIDR prefix. Find subnet masks, network addresses, broadcast addresses, and usable hosts.
Example loaded: 192.168.1.130/26.
Enter an address or paste address/prefix. An inline /prefix also updates the selection below.
Subnet mask: 255.255.255.192
Addresses stay in this tab. This calculator does not scan or contact the network.
Network address
192.168.1.128
192.168.1.128/26
The first 26 bits identify the network. AND keeps an IP bit only where the mask bit is 1. The remaining 6 bits describe the address within the block.
IP address
11000000 .10101000 .00000001 .10000010AND subnet mask
11111111 .11111111 .11111111 .11000000= Network address
11000000 .10101000 .00000001 .10000000Wildcard = inverted 32-bit mask. Broadcast = network OR wildcard; usable range excludes both boundary addresses.
IPv4 network 192.168.1.128/26. Total addresses 64.
An IP subnet calculator finds the block of addresses containing an IP address for a given prefix. For IPv4, it also translates between CIDR and a subnet mask, calculates the wildcard mask and shows conventional host boundaries. IPv6 mode calculates a 128-bit prefix and its numerical address range.
The address and prefix work together. The same 192.168.1.130 address belongs to different blocks under /24 and /26, so a standalone IP address does not determine a unique subnet.
The example 192.168.1.130/26 produces network 192.168.1.128/26. Reset restores that example and the default IPv6 example. Values are calculated locally; the tool does not probe a device, discover your current mask or test whether an address is reachable.
An inline prefix controls the prefix selector. If you enter both an inline prefix and a dotted mask, they must match; conflicting values produce an error.
An IPv4 subnet mask is a 32-bit value separating the network bits from the host bits. Valid CIDR masks contain consecutive 1s on the left and then 0s. For example, 255.255.255.192 is 11111111.11111111.11111111.11000000 in binary: twenty-six 1s, so /26.
A noncontiguous value such as 255.0.255.0 has 1s after the host bits have begun. It cannot describe one CIDR prefix, and the calculator rejects it rather than counting its set bits and inventing a prefix.
Network mask and netmask commonly refer to the same network/host boundary expressed by an IPv4 subnet mask. Applying the mask to an address leaves the network portion. A wildcard mask flips all thirty-two bits: 255.255.255.192 becomes 0.0.0.63.
Modern routing uses the supplied prefix rather than inferring an old class A, B or C default. A historical “class C” description does not tell you the actual prefix configured on a device. Ask for its prefix or subnet mask.
CIDR stands for Classless Inter-Domain Routing. Slash notation writes an address followed by the count of network bits, as in 192.168.1.128/26. The remaining 32 − 26 = 6 bits identify positions within that IPv4 block.
An interface address can include host bits, such as 192.168.1.130/26. This tool normalizes the network CIDR to 192.168.1.128/26. IPv4 prefixes range from /0 through /32; IPv6 prefixes range from /0 through /128. RFC 4632 describes classless IPv4 allocation and aggregation.
Network = IP address AND subnet mask. AND returns 1 only when both corresponding bits are 1.
For 192.168.1.130/26, the final octet is 10000010 and the mask’s final octet is 11000000. Their AND is 10000000, or 128. The other three octets remain unchanged, giving 192.168.1.128.
The binary visualization above shows all thirty-two bits, marking the network portion. With /0, there are no fixed network bits and the block starts at 0.0.0.0. With /32, all bits are fixed and the block is one address.
For conventional IPv4 subnets through /30, set the host bits to 1: broadcast = network OR wildcard mask. For 192.168.1.128/26, the wildcard is 0.0.0.63, giving a broadcast boundary of 192.168.1.191.
A /31 point-to-point subnet has two endpoints and no directed broadcast. A /32 is a single host route with no separately reserved broadcast. IPv6 does not use broadcast addresses at all. The calculator keeps these cases separate.
A mathematical broadcast boundary does not mean routers will forward directed broadcast traffic or that all addresses in the block can be used on a real network.
Total IPv4 addresses = 232 − prefix. For conventional /0–/30 blocks, subtract the network and broadcast boundaries to get the conventional host count.
A /26 has 2⁶ = 64 addresses and 62 conventional hosts. The usable range of 192.168.1.128/26 runs from 192.168.1.129 through 192.168.1.190.
For /31, this tool applies RFC 3021 point-to-point semantics: both addresses are endpoints. A /32 contains one host address. These counts describe subnet arithmetic; special-purpose address ranges, device reservations and deployment rules may reduce actual assignments.
Write as many leading 1 bits as the prefix requests, fill the rest of the thirty-two bits with 0s, then convert each eight-bit octet to decimal. For /22, that gives 11111111.11111111.11111100.00000000, or 255.255.252.0.
For mask-to-CIDR conversion, first check that all 1s are contiguous, then count them. The mask 255.255.255.128 has twenty-five leading 1s, so it is /25. All-zero and all-one masks correspond to /0 and /32.
Switch the input mode above to use a dotted mask. The matching prefix appears underneath it; switching back preserves the valid network settings.
IPv4 has thirty-two address bits and dotted-decimal notation. IPv6 has 128 bits written in hexadecimal groups. Both use a prefix length, but IPv6 has no IPv4-style broadcast or universal “total minus two” host rule.
For 2001:db8:abcd:1234::5/64, the network is 2001:db8:abcd:1234::/64. Its final sixty-four bits vary, giving 2⁶⁴ = 18,446,744,073,709,551,616 numerical addresses. This is not a promise that every value is assignable to an ordinary host.
The IPv6 mode accepts compressed and expanded notation, plus an embedded IPv4 tail. It removes unnecessary leading zeros, compresses the longest run of at least two zero groups and uses the first run when tied. IPv4-mapped addresses use mixed notation such as ::ffff:192.0.2.1. These rules follow RFC 4291 and RFC 5952.
To understand the base-sixteen digits in an IPv6 group, try the Hexadecimal Calculator.
This reference is generated by the same subnet engine as the calculator. /31 counts assume a point-to-point link; /32 describes one host route. Other rows show conventional host arithmetic, without checking address reservations.
| CIDR | Subnet mask | Total addresses | Hosts / endpoints |
|---|---|---|---|
| /0 | 0.0.0.0 | 4,294,967,296 | 4,294,967,294 |
| /1 | 128.0.0.0 | 2,147,483,648 | 2,147,483,646 |
| /2 | 192.0.0.0 | 1,073,741,824 | 1,073,741,822 |
| /3 | 224.0.0.0 | 536,870,912 | 536,870,910 |
| /4 | 240.0.0.0 | 268,435,456 | 268,435,454 |
| /5 | 248.0.0.0 | 134,217,728 | 134,217,726 |
| /6 | 252.0.0.0 | 67,108,864 | 67,108,862 |
| /7 | 254.0.0.0 | 33,554,432 | 33,554,430 |
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 |
| /9 | 255.128.0.0 | 8,388,608 | 8,388,606 |
| /10 | 255.192.0.0 | 4,194,304 | 4,194,302 |
| /11 | 255.224.0.0 | 2,097,152 | 2,097,150 |
| /12 | 255.240.0.0 | 1,048,576 | 1,048,574 |
| /13 | 255.248.0.0 | 524,288 | 524,286 |
| /14 | 255.252.0.0 | 262,144 | 262,142 |
| /15 | 255.254.0.0 | 131,072 | 131,070 |
| /16 | 255.255.0.0 | 65,536 | 65,534 |
| /17 | 255.255.128.0 | 32,768 | 32,766 |
| /18 | 255.255.192.0 | 16,384 | 16,382 |
| /19 | 255.255.224.0 | 8,192 | 8,190 |
| /20 | 255.255.240.0 | 4,096 | 4,094 |
| /21 | 255.255.248.0 | 2,048 | 2,046 |
| /22 | 255.255.252.0 | 1,024 | 1,022 |
| /23 | 255.255.254.0 | 512 | 510 |
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
| /31 | 255.255.255.254 | 2 | 2 |
| /32 | 255.255.255.255 | 1 | 1 |
A /24 IPv4 prefix fixes the first twenty-four bits, leaving eight host bits. Its mask is 255.255.255.0, its block contains 256 addresses and its conventional host count is 254.
For 192.168.1.10/24, the network is 192.168.1.0, broadcast is 192.168.1.255 and the conventional usable range is 192.168.1.1–192.168.1.254.
A /26 fixes twenty-six bits and leaves six host bits. The mask is 255.255.255.192, with blocks of 64 addresses and 62 conventional hosts each.
Within 192.168.1.0/24, the /26 networks begin at .0, .64, .128 and .192. Address .130 falls in the block .128–.191. Moving to a larger prefix number makes each block smaller.
The first numerical address is the network value with all trailing host bits zero. The last is the network value with all trailing bits one. The full range includes both ends; conventional IPv4 usable-host ranges exclude them through /30.
IPv6 uses the same numerical boundaries with 128 bits. A /128 has one address, while /0 covers the entire 128-bit space. The engine calculates these boundaries directly rather than enumerating the addresses, so huge prefixes do not produce huge lists.
This tool does not infer public routability, split networks into child subnets or read a device’s configuration. Numerical membership alone does not establish routing or permission to assign an address.
A subnet is an address block defined by a network prefix. Addresses in that block share the same leading network bits.
It is a 32-bit IPv4 value with leading 1s for the network portion and trailing 0s for the host portion. For example, 255.255.255.0 corresponds to /24.
Classless Inter-Domain Routing. Its slash notation gives the number of network bits rather than relying on historical address classes.
An IPv4 /24 contains 256 numerical addresses, with 254 conventional usable hosts after excluding the network and broadcast boundaries.
A conventional IPv4 /26 has 62 usable host addresses out of 64 total addresses. Operational reservations may reduce actual assignments.
255.255.252.0. A /22 contains 1,024 total IPv4 addresses and 1,022 conventional usable host positions.
Obtain the configured prefix or mask, then AND the IP address with that mask. For 192.168.1.130/26, the result is 192.168.1.128.
For a conventional IPv4 subnet, it is the network value with all host bits set to 1. /31 point-to-point links and /32 host routes do not reserve a separate directed broadcast.
IPv4 addresses have 32 bits; IPv6 addresses have 128. IPv6 uses hexadecimal groups and different address-role rules, including the absence of broadcast.
No. IPv6 does not use broadcast addressing. The calculator shows a numerical range and address count instead of inventing an IPv4-style broadcast or usable-host count.
No. Different prefixes can contain the same address. Read the actual configuration or ask the network administrator for the prefix or mask.
RFC 3021 permits both values as endpoints on a point-to-point IPv4 link. This calculator explicitly uses that convention for /31.