RevealTheme logo

Subnet Calculator

Enter any IPv4 address in CIDR notation and get the network address, broadcast address, subnet mask, usable host range, and host count, computed instantly in your browser.

network192.168.1.0
broadcast192.168.1.255
mask255.255.255.0
firstHost192.168.1.1
lastHost192.168.1.254
hosts254
total256

How to use this tool

  1. 1

    Type an IPv4 address with a prefix length into the box, for example 192.168.1.0/24. The field is pre-filled with that example to start.

  2. 2

    Read the results table as you type. The network and broadcast addresses, dotted-decimal subnet mask, first and last usable host, usable host count, and total address count appear immediately.

  3. 3

    Adjust the prefix length (the number after the slash) to widen or narrow the subnet and watch the host counts change.

  4. 4

    If you see an Invalid CIDR or Invalid IP message, fix the input. The prefix must be 0 to 32 and each of the four octets must be 0 to 255.

What is CIDR notation and how does this subnet calculator work?

CIDR (Classless Inter-Domain Routing) notation writes an IPv4 subnet as address/prefix, such as 192.168.1.0/24. The prefix is the number of leading bits that identify the network; the remaining bits address hosts. A /24 fixes 24 bits and leaves 8, giving 256 total addresses. This tool parses your input, converts the dotted-decimal address to a 32-bit number, builds the mask from the prefix, then derives the network address (address AND mask) and the broadcast address (network OR the inverted mask). It reports the subnet mask in dotted-decimal form, the first and last usable host, the usable host count, and the total address count. By the classic convention it subtracts two from the total for the network and broadcast addresses to get usable hosts, so a /24 shows 254 usable. The /31 and /32 prefixes are special-cased: a /31 (RFC 3021 point-to-point link) and a /32 (single host) report both addresses as usable rather than subtracting two. The tool is IPv4 only and does not parse IPv6, VLSM tables, or wildcard masks.

Common use cases

  • Sizing a subnet for an office VLAN by checking how many usable hosts a /26 or /25 provides before you assign it.

  • Finding the network and broadcast addresses you must exclude when configuring a static DHCP address pool.

  • Translating a CIDR prefix into the dotted-decimal subnet mask a router or firewall interface expects, for example /22 to 255.255.252.0.

  • Confirming the usable host range when writing an access-control list or firewall rule for a specific subnet.

  • Verifying that a /31 point-to-point link between two routers gives you exactly two usable addresses with no broadcast waste.

  • Teaching or studying subnetting for a networking course or a CCNA exam by experimenting with prefixes and seeing host math update live.

Frequently asked questions

Why does a /24 show 254 usable hosts instead of 256?
A /24 has 256 total addresses, but the calculator subtracts the network address and the broadcast address, which cannot be assigned to hosts, leaving 254 usable. The total count is shown separately so you can see both numbers.
How does it handle /31 and /32?
These are special-cased. A /31 is a two-address point-to-point link (RFC 3021) with no broadcast, and a /32 is a single host, so for both the tool counts every address as usable instead of subtracting two.
Does this support IPv6?
No. The calculator only parses IPv4. The address must be four dotted-decimal octets (each 0 to 255) and the prefix must be 0 to 32. IPv6 addresses are not recognized.
What counts as invalid input?
You will see an error if the prefix is missing, not a number, or outside 0 to 32 (Invalid CIDR), or if the address does not have exactly four octets or any octet is outside 0 to 255 (Invalid IP). The tool does not auto-correct or guess; fix the text and the table reappears.
Does it compute VLSM, wildcard masks, or supernets?
No. It evaluates one CIDR block at a time and returns its mask, range, and counts. It does not split a block into variable-length subnets, output Cisco-style wildcard masks, or summarize multiple blocks. For those, use a dedicated subnetting suite.
Is my input sent to a server?
No. All parsing and bitwise math run entirely in your browser with JavaScript. Nothing you type is uploaded, logged, or stored, so you can safely calculate for internal or production network ranges.

Related tools