Skip to content
epitometool

Subnet / CIDR calculator

Dev quality-of-life

IPv4 CIDR math — netmask, network, broadcast, host range and binary view.

Updated

CIDR address

Subnet details

Address
192.168.1.0
Prefix
/24
Netmask
255.255.255.0
Wildcard mask
0.0.0.255
Network address
192.168.1.0
Broadcast address
192.168.1.255
Host min
192.168.1.1
Host max
192.168.1.254
Total hosts
256
Usable hosts
254
Address class
C
Type
Private (RFC 1918)

Binary breakdown

Address
11000000.10101000.00000001.00000000
Netmask
11111111.11111111.11111111.00000000

Quick start

How to calculate an IPv4 subnet

Enter a CIDR like 192.168.1.0/24, get netmask, network, broadcast, host range and binary view.

  1. Step 1
    Enter CIDR

    Type an IPv4 address with an optional /n prefix. Examples: 10.0.0.0/8, 192.168.1.0/24, 172.16.4.32/27.

  2. Step 2
    Pick a prefix

    Use the /8 to /32 preset buttons to try different prefixes instantly. The math updates as you type.

  3. Step 3
    Read the output

    Netmask, network and broadcast addresses, usable host range, RFC-1918 / loopback / link-local flags and a binary breakdown of address and mask.

In-depth guide

Subnet / CIDR calculator — IPv4 network math

Enter a CIDR address like 192.168.1.0/24 and see the netmask, wildcard mask, network address, broadcast, usable host range and binary breakdown. Every computation runs locally.

What CIDR notation means

A CIDR block x.x.x.x/n describes a contiguous range of IPv4 addresses by saying "the first n bits are the network, the remaining 32-n bits are hosts".

So 192.168.1.0/24 is the 256-address range from 192.168.1.0 to 192.168.1.255, with the first three octets (24 bits) fixed and the last octet (8 bits) free for hosts.

The number of addresses in a /n block is 2^(32-n). A /24 has 256, a /16 has 65,536, a /30 has 4.

Network, broadcast and the two reserved addresses

In a normal subnet two addresses are reserved:

  • Network address — all host bits set to 0. Identifies the subnet itself. Cannot be assigned to a host.
  • Broadcast address — all host bits set to 1. Sending a packet to this address delivers it to every host on the subnet. Cannot be assigned to a single host.

This is why a /24 has 256 total addresses but only 254 usable hosts.

Two exceptions exist:

  • /31 — RFC 3021 permits both addresses to be used on point-to-point links, since there's no broadcast.
  • /32 — a single host, no reservations.

Private, loopback and link-local ranges

Not every IPv4 address can be used on the public internet. The tool flags well-known reserved ranges in the output:

  • Private (RFC 1918)10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. Intended for internal networks behind NAT.
  • Loopback127.0.0.0/8. Packets never leave the device.
  • Link-local (RFC 3927)169.254.0.0/16. Self-assigned by the OS when DHCP is unavailable; only valid on the same Ethernet segment.

Common use cases for the calculator

  • Sizing a VPC subnet on AWS / Azure / GCP. Pick the smallest prefix that leaves room for growth. For a team subnet of 30 hosts, /27 (30 usable) is tight; /26 (62) leaves headroom.
  • Reviewing a firewall rule. Paste the CIDR to verify exactly which range it covers before approving.
  • Configuring a router / DHCP scope. Read off the host-min / host-max bounds to set a valid DHCP pool that excludes the network and broadcast addresses.
  • Teaching networking fundamentals. The binary view makes the relationship between address, mask, network and broadcast immediately visible.

Common pitfalls

  • Check whitespace, casing, escaping, and line endings before using the result in production.
  • Generated or transformed strings can be syntactically valid while still being semantically wrong for your system.
  • Avoid pasting secrets unless you are comfortable handling them in the current browser session.

Frequently asked questions

What is CIDR notation?

CIDR (Classless Inter-Domain Routing) writes an IPv4 address and its network prefix as 'x.x.x.x/n', where n is the number of leading bits that belong to the network. For example, 192.168.1.0/24 means the first 24 bits identify the network and the last 8 bits identify hosts within it.

What's the difference between total and usable hosts?

In a normal subnet, two addresses are reserved: the network address (all host bits 0) and the broadcast address (all host bits 1). So a /24 has 256 total addresses but only 254 usable for hosts. Exceptions: /31 reserves none (point-to-point links per RFC 3021), /32 represents a single host (no reservation).

How do I read the binary output?

The 32-bit IPv4 address is shown grouped by octet (each octet being 8 bits, separated by dots). Compare the address against the netmask line — every bit where the mask is '1' is fixed (the network), every bit where the mask is '0' is the host portion.

Which ranges are private (RFC 1918)?

10.0.0.0/8 (16,777,216 addresses), 172.16.0.0/12 (1,048,576 addresses) and 192.168.0.0/16 (65,536 addresses). These are reserved for private internal networks and are not routable on the public internet.

What about 127.x.x.x and 169.254.x.x?

127.0.0.0/8 is the loopback range — packets are delivered locally and never leave the device. 169.254.0.0/16 is link-local (RFC 3927) — automatically assigned by the OS when DHCP fails, and only valid on the same Ethernet segment.

What are address classes A, B, C, D, E?

Classful networking is mostly obsolete (replaced by CIDR in 1993), but the labels persist. Class A is 0.0.0.0–127.255.255.255 (default mask /8). Class B is 128–191 (/16). Class C is 192–223 (/24). Class D is 224–239 (multicast). Class E is 240–255 (reserved / experimental).

Does this tool support IPv6?

Not yet. IPv6 addresses are 128 bits and need BigInt math for clean handling. We may add a separate IPv6 tool — for now this tool is strictly IPv4 / CIDR /0 through /32.

Is any data sent to a server?

No. All the bit math runs in your browser. The CIDR you enter never leaves your device.

Keep exploring

More tools you'll like

Hand-picked utilities that pair well with the one you're on — all free, client-side, and zero-signup.