Subnet calculator

Calculate IPv4 and IPv6 network ranges, address counts and masks. Everything is calculated in your browser.

Calculated in your browser. IPv4 accepts a CIDR prefix or a contiguous dotted mask; IPv6 uses a prefix. Your input is not submitted.

Illustrative example · 192.168.1.0/24. This calculated example explains the output. Enter your own values and run the tool to replace it.

How this address is divided (IPv4 /24)

24 network bits; 8 host bits
How this address is divided (IPv4 /24)
24 network bits
How this address is divided (IPv4 /24)
8 host bits
2 raised to 8 host bits = 256 address values. The bar shows the actual fraction of network and host bits.

Address range (IPv4 /24)

Network address
192.168.1.0
Usable host range
192.168.1.1 – 192.168.1.254
Broadcast address
192.168.1.255
The conventional IPv4 host count excludes network and broadcast addresses. Your gateway and reserved addresses still consume that allowance.
On this page

Learn more about Subnet calculator

Calculate one IPv4 or IPv6 subnet

The subnet calculator runs in this browser after the page loads. Your input is not submitted to a calculation API, and the tool does not scan the proposed range. This makes it suitable for private address planning. Loading the website still uses a network connection; local arithmetic does not mean the whole website works offline.

Enter an address followed by a slash and a prefix length, then select Calculate. You can start with a host address; the calculator finds the network containing it. For IPv4, prefixes run from /0 through /32. IPv6 accepts /0 through /128. Examples fill the input without changing a device or contacting the address.

Read more

An IPv4 dotted mask also works: 192.168.1.10/255.255.255.0 means the same network as 192.168.1.10/24. Masks must have consecutive network bits followed by host bits. A pattern such as 255.0.255.0 is rejected rather than interpreted as a normal subnet. IPv6 uses a prefix length; it does not use the IPv4 dotted-mask format.

Start with a planning question

Use this subnet calculator when you need boundaries, a mask, or an exact address count for one block. If you need to divide a parent into children, combine several networks, or convert arbitrary endpoints into blocks, open the CIDR calculator. Those operations require additional constraints beyond the properties of a single subnet.

For example, 192.168.1.10/24 belongs to 192.168.1.0/24. The mathematical interval runs from 192.168.1.0 to 192.168.1.255 and contains 256 address values. Changing the prefix to /25 halves the block to 128 values. The entered address determines which half contains the result.

Understand boundaries, counts and the bit diagram

The subnet calculator first identifies the normalized network. Normalization clears host bits; it does not announce that your computer changed its address. The first and last address fields describe the entire mathematical interval. The colored bar shows the actual proportion of network bits and host bits in a 32-bit IPv4 or 128-bit IPv6 address.

Read more

Each remaining host bit doubles the number of address values. A /24 IPv4 network leaves eight host bits, so its total is two to the eighth power, or 256. A /64 IPv6 prefix leaves 64 host bits. Its total is 18446744073709551616, displayed exactly rather than rounded through floating-point arithmetic.

The subnet mask sets network bits to one and host bits to zero. The IPv4 wildcard reverses those bits: /24 has mask 255.255.255.0 and wildcard 0.0.0.255. Some access-control systems use wildcard syntax, while others require a mask or prefix. Confirm the destination field before copying any value.

Total addresses are not a device inventory

For conventional IPv4 subnets through /30, the network and directed-broadcast addresses are excluded from the host count. A /24 therefore has 254 conventional host addresses. The displayed first and last host addresses reflect that convention, while the full-range fields still include both boundary values.

A gateway, static reservation, printer and DHCP client each use space within your allocation. The tool does not subtract these operational choices or discover which addresses are occupied. If you plan 254 clients plus a separate gateway, a conventional /24 does not provide enough host addresses for that arrangement.

Exceptional prefixes require context

An IPv4 /31 contains two values. Under the RFC 3021 point-to-point convention, both may be endpoints; this calculator reports two rather than subtracting two. Check that your equipment and link support that use. A /32 represents one address, commonly a host route, without a separate broadcast address.

IPv6 does not use IPv4-style broadcast. Its conventional IPv4 usable-host count and wildcard fields are therefore omitted. A mathematical first or last value is not a recommendation to assign it. Address architecture, reservations and configuration methods determine which values belong in your operational plan. Inter-router /127 use is described in RFC 6164.

Apply the result without confusing calculation and observation

A valid range does not establish ownership, reachability or permission to use it. Private and documentation addresses are legitimate arithmetic inputs but do not become public allocations. For a public network's registered holder, use IP lookup; for a route's observed origin, use ASN lookup. Neither replaces an internal address inventory.

Read more

Before adding a network, compare it with existing LANs, VPN pools, container ranges and remote sites. Two locations may independently use the same private prefix until a connecting tunnel makes the overlap troublesome. Check both boundaries and prefix alignment rather than relying on different labels in a spreadsheet.

Rejecting ambiguous input is deliberate. Use four decimal IPv4 octets or ordinary IPv6 notation. URLs, ports, abbreviated IPv4, octal-looking values and zone identifiers are not accepted. For IPv4-mapped IPv6 addresses, enter the equivalent IPv4 address and its IPv4 prefix explicitly so the address family stays clear.

For a worked derivation, read CIDR notation explained. RFC 4632 describes CIDR's routing model. Copying a report preserves the arithmetic and its conventions; successful deployment still requires checking the target device's documentation, existing configuration and allocation plan.

Subnet calculator questions

Why did the network address change from my input?

A host address can sit anywhere inside its network. The calculation clears its host bits to find the boundary. For 192.168.1.200/25, the containing network is 192.168.1.128/25. This is normalization of the input, not a change to your computer's configuration.

Will this tell me which addresses are free?

No. Counts and boundaries are mathematical. The tool does not inspect leases, query devices or detect conflicts. Compare the range with your DHCP server, address inventory and reserved assignments before allocating it. A successful calculation is not evidence that an address is unoccupied.

Is a subnet mask the same as a wildcard mask?

No. For a contiguous IPv4 subnet, the wildcard is the bitwise inverse of the mask. Some vendor rule languages permit other wildcard patterns that do not represent one CIDR subnet. This calculator validates the contiguous case and does not validate a complete firewall rule.

Why is the IPv6 address count so large?

IPv6 has 128 bits. Compressed notation shortens the text without reducing the underlying address space. The exact total helps explain the prefix; it is not a target number of devices. Choose an IPv6 allocation according to your routing and address-configuration requirements.

Can the subnet calculator accept a host address?

Yes. The calculator finds the containing network from the address and prefix. Compare the returned boundary with your intended range before copying. The original host value is not necessarily the first address in that network.

Does this subnet calculator scan devices in the range?

No. This is local address arithmetic, with no traffic sent to the represented hosts. Counts and boundaries do not identify active devices, free leases or registered resources. Device discovery needs separate local evidence.

Can an IPv6 prefix use a dotted IPv4 subnet mask?

No. IPv6 uses a numeric prefix length. The dotted-mask option applies to IPv4 and requires contiguous network bits. Invalid mask patterns should be corrected instead of interpreted as a special allocation policy.

Does the subnet calculator apply a route or DHCP setting?

No. It returns mathematical results in the browser. A network device’s accepted syntax, reservations and operating policy still need review before configuration. Copying a valid prefix does not establish authority to allocate it.