Skip to main content
Computers & TechnologyExact integer resultsPrivate · Runs in your browser

IP Subnet Calculator

Calculate IPv4 and IPv6 subnets using an IP address and CIDR prefix. Find subnet masks, network addresses, broadcast addresses, and usable hosts.

Instant updates · Exact network boundariesJump to results ↓

Find your subnet

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

Total addresses
64
Usable hosts
62
  • Conventional host count excludes the network and broadcast. Special-purpose ranges and operational reservations may reduce assignable addresses.
Normalized IP address
192.168.1.130
Network address
192.168.1.128
CIDR notation
192.168.1.128/26
Prefix length
/26
First address in range
192.168.1.128
Last address in range
192.168.1.191
Total addresses
64
Subnet mask
255.255.255.192
Wildcard mask
0.0.0.63
Broadcast address
192.168.1.191
First usable IP
192.168.1.129
Last usable IP
192.168.1.190
Usable hosts
62

Binary subnet visualization: IP AND mask

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.10000010

AND subnet mask

11111111.11111111.11111111.11000000

= Network address

11000000.10101000.00000001.10000000

Wildcard = inverted 32-bit mask. Broadcast = network OR wildcard; usable range excludes both boundary addresses.

IPv4 network 192.168.1.128/26. Total addresses 64.

On this page

What Is an IP Subnet Calculator?

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.

How to Use an IP Subnet Calculator

  1. Choose IPv4 or IPv6.
  2. Enter an IP address. You can paste an address with its /prefix.
  3. Select the CIDR prefix, or choose Subnet mask for IPv4 and enter a contiguous dotted-decimal mask.
  4. Read the network, full address range and counts. Copy any row or the complete result.
  5. Open the binary explanation for IPv4 or the prefix explanation for IPv6.

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.

What Is a Subnet Mask?

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.

What Is a Network Mask?

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.

What Is CIDR Notation?

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.

How to Calculate a Network Address

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.

How to Calculate a Broadcast 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.

How to Calculate Usable Hosts

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.

How to Convert CIDR to Subnet Mask

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 vs IPv6 Subnetting

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.

Common Subnet Masks Chart

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.

IPv4 CIDR prefixes, masks and address counts
CIDRSubnet maskTotal addressesHosts / endpoints
/00.0.0.04,294,967,2964,294,967,294
/1128.0.0.02,147,483,6482,147,483,646
/2192.0.0.01,073,741,8241,073,741,822
/3224.0.0.0536,870,912536,870,910
/4240.0.0.0268,435,456268,435,454
/5248.0.0.0134,217,728134,217,726
/6252.0.0.067,108,86467,108,862
/7254.0.0.033,554,43233,554,430
/8255.0.0.016,777,21616,777,214
/9255.128.0.08,388,6088,388,606
/10255.192.0.04,194,3044,194,302
/11255.224.0.02,097,1522,097,150
/12255.240.0.01,048,5761,048,574
/13255.248.0.0524,288524,286
/14255.252.0.0262,144262,142
/15255.254.0.0131,072131,070
/16255.255.0.065,53665,534
/17255.255.128.032,76832,766
/18255.255.192.016,38416,382
/19255.255.224.08,1928,190
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422
/32255.255.255.25511

What Does /24 Mean?

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.

What Does /26 Mean?

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.

How to Calculate an IP Address Range

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.

Frequently Asked Questions

What is a subnet?

A subnet is an address block defined by a network prefix. Addresses in that block share the same leading network bits.

What is a subnet mask?

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.

What does CIDR mean?

Classless Inter-Domain Routing. Its slash notation gives the number of network bits rather than relying on historical address classes.

How many IP addresses are in a /24?

An IPv4 /24 contains 256 numerical addresses, with 254 conventional usable hosts after excluding the network and broadcast boundaries.

How many usable IPs are in a /26?

A conventional IPv4 /26 has 62 usable host addresses out of 64 total addresses. Operational reservations may reduce actual assignments.

What is the subnet mask for /22?

255.255.252.0. A /22 contains 1,024 total IPv4 addresses and 1,022 conventional usable host positions.

How do I calculate my network address?

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.

What is a broadcast address?

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.

What is the difference between IPv4 and IPv6?

IPv4 addresses have 32 bits; IPv6 addresses have 128. IPv6 uses hexadecimal groups and different address-role rules, including the absence of broadcast.

Does IPv6 have broadcast addresses?

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.

Can an IP address alone determine the subnet mask?

No. Different prefixes can contain the same address. Read the actual configuration or ask the network administrator for the prefix or mask.

Why are there two usable addresses in a /31?

RFC 3021 permits both values as endpoints on a point-to-point IPv4 link. This calculator explicitly uses that convention for /31.