IP & Subnet Tools

Subnet calculator with explicit host rules

Enter an IP with a CIDR prefix, or supply a separate prefix or IPv4 netmask. Compare the complete range with the selected host convention.

Subnet calculator

Network input

Leave the second field empty with CIDR, or enter an equivalent prefix. For a bare IP, supply 24, /24 or 255.255.255.0.

Subnet result

Conventional IPv4: exclude the network and directed broadcast for prefixes /0–/30. This is an arithmetic host count, not an availability check.

Address family
IPv4
Input address
192.168.1.10
Network CIDR
192.168.1.0/24
Total addresses
256
Addresses under this convention
254
Network / first address
192.168.1.0
Last address
192.168.1.255
Network bits / prefix
24
Host bits
8
Subnet mask
255.255.255.0
Inverse / wildcard mask
0.0.0.255
Broadcast address
192.168.1.255
Counted range starts
192.168.1.1
Counted range ends
192.168.1.254

Host bits were cleared in the network result. Your input has not been rewritten.

All calculations stay in this browser; input addresses are not queried or uploaded.

Address counting

IPv6 always shows the complete range and total count; the IPv4 convention does not apply.

192.168.1.0/24 · 256 total addresses

The subnet calculator helps you turn an interface address into the network it belongs to. An address ending in .130 can identify a host while the corresponding /26 network begins at .128.

When reviewing a route or access list, compare all covered addresses with the host range before copying the result. A number of addresses is not a count of online devices.

Why use a subnet calculator?

Keep the network boundary and the address-counting convention visible.

Locate the containing network

The subnet calculator preserves the address you entered and derives the containing block. For 192.168.1.130/26, the result begins at .128 and ends at .191; it does not start the range at .130.

A host marker inside a highlighted address block points to the block’s first boundary

Explain the two-address exception

An ordinary eight-address IPv4 subnet reserves its first and last addresses. A /31 point-to-point link instead uses both endpoints. The result states which convention produced the displayed count.

Eight address cells with reserved edges contrasted with two usable point-to-point endpoints

Resolve the three common ambiguities

01

Give the prefix only once

Paste a complete CIDR, or enter a bare IP and a separate prefix or dotted IPv4 netmask. If you fill both forms, their prefix lengths must match.

  • A bare address never silently becomes a /24, /64 or classful network.
02

Choose what you are counting

Keep conventional hosts for the usual IPv4 host range. Choose all addresses when you need the full set covered by an access rule; IPv6 always uses full-range semantics.

  • For /31, the conventional result assumes a point-to-point link; /32 identifies one address.
03

Wait for a current result

Automatic calculation waits 350 ms after the latest edit. Turn it off to reveal the calculate button; Ctrl/Cmd + Enter runs manually.

  • An edit immediately disables exports. TXT is localized; JSON preserves counts as decimal strings.

Network boundaries, masks and exact capacity

Two address families, one calculation

The CIDR calculator accepts IPv4 prefixes /0–/32 and IPv6 prefixes /0–/128. Compressed IPv6 and embedded IPv4 tails are supported; an IPv4-mapped IPv6 address stays in the IPv6 address space.

Masks in both directions

Use the subnet mask calculator with 255.255.255.192 to obtain /26, or start with /26 to inspect that mask and the wildcard mask 0.0.0.63. Noncontiguous masks are rejected instead of rounded to a plausible prefix.

Exact counts for large networks

The IPv6 subnet calculator computes 2^(128−prefix) without enumerating addresses. Even the /0 count is exact. JSON uses strings for counts so downstream parsers do not round values above their integer precision limit.

What the result does and does not establish

One subnet per calculation
Only one IP and its prefix are accepted. Hostnames, URLs, ports, zone IDs, brackets and batches are outside the input contract. Leading zeros in IPv4 octets are rejected; surrounding field whitespace is allowed.
Explicit prefix and contiguous mask
A missing prefix is an error. A separate /24 is accepted, but the slash in CIDR must be followed by a numeric length. Dotted masks are IPv4 only; a wildcard such as 0.0.0.255 is not accepted as a netmask.
Capacity is not allocation
No ping, DNS lookup, DHCP inventory or cloud-specific reservation check is performed. Ordinary IPv4 host arithmetic excludes two edge addresses; special-purpose address ranges may have further restrictions that this calculation does not classify.
No subnet planning or address expansion
This page does not split a block, plan VLSM, combine CIDR sets or enumerate hosts. Use the related set and range tools for those transformations; a /0 result is represented by boundaries and a count.
Bounded input and reversible replacement
Each field accepts up to 256 UTF-16 code units. Example and clear actions preview the number of nonempty fields before applying. One undo restores both the previous inputs and the previous result, including its stale or error state.

Subnet calculator questions

Is 255.255.255.0 a /24?

Yes. In IPv4, /24 means the first 24 bits are the network part. The equivalent mask is 255.255.255.0. Enter either form; if both are supplied, this tool checks that they describe the same prefix.

How many usable hosts are in a /24?

There are 256 total addresses and 254 conventional IPv4 host addresses. The first and last are the network and directed broadcast. All-addresses mode instead counts all 256 for coverage; it is not a promise of 256 assignable machines.

How many IP addresses are in a /31?

A /31 contains exactly two addresses. For an IPv4 point-to-point link, both can be endpoints under RFC 3021. This tool displays that assumption rather than subtracting two and reporting zero hosts.

Can I enter a dotted netmask instead of a prefix?

Yes, for IPv4. Enter a bare address and a contiguous mask such as 255.255.255.0 in the second field. For IPv6, use a numeric prefix length. A CIDR already containing a prefix may leave that field empty.

Does it support IPv6?

Yes, including compressed and embedded-IPv4 forms. The result gives the network, final address, masks and exact total. IPv6 has no broadcast address, and this tool does not turn the total into a deployment-specific usable-host count.

Still have a question?

Check the boundaries before using the result

Use the subnet calculator to review the prefix and counting convention together, then export the current result for your network notes.