Hoglet

Subnet calculator

IPv4 or IPv6, with /prefix or a mask: 192.168.1.10/24, 10.0.0.1 255.255.0.0, 2001:db8::/48
Try
/24
254 usable hosts 192.168.1.1 – 192.168.1.254 Private (RFC 1918) · Class C (historic)
Network 192.168.1.0/24
Broadcast 192.168.1.255
First host 192.168.1.1
Last host 192.168.1.254
Usable hosts 254
Addresses 256
Netmask 255.255.255.0
Wildcard mask 0.0.0.255
Address as a number 3232235786 · 0xC0A8010A
Type Private (RFC 1918)

The bits

11000000101010000000000100001010

Network: the first 24 bitsHosts: the other 8

How it’s worked out

network = address AND mask = 192.168.1.10 AND 255.255.255.0 = 192.168.1.0

broadcast = network OR wildcard = 192.168.1.0 OR 0.0.0.255 = 192.168.1.255

usable hosts = 2^8 − 2 = 256 − 2 = 254

Split into smaller networks

/26: 4 networks
  1. 192.168.1.0/26192.168.1.0 – 192.168.1.63
  2. 192.168.1.64/26192.168.1.64 – 192.168.1.127
  3. 192.168.1.128/26192.168.1.128 – 192.168.1.191
  4. 192.168.1.192/26192.168.1.192 – 192.168.1.255
192.168.1.0/24 · 254 hosts

Subnet Calculator (CIDR) for IPv4 and IPv6

Network, broadcast, range and host count from an address and mask.

Type an address with its prefix (192.168.1.10/24), with a mask (192.168.1.10 255.255.255.0), with a wildcard mask as access lists write it (0.0.0.255), or an IPv6 address (2001:db8::1/64). The prefix says how many of the address’s bits name the network; the rest number the devices on it. How it’s worked out: the mask is the prefix’s bits set to one. The network is the address AND the mask; the broadcast address is the network OR the wildcard (the mask turned over). An IPv4 network has 2^(32 − prefix) addresses, of which the first (the network) and the last (broadcast) can’t be given to a device, so there are two fewer hosts, except on a /31, a link between two routers (RFC 3021), and a /32, one address. IPv6 has no broadcast: every address in the range can be used, and a network has 2^(128 − prefix) of them, counted exactly however large. What the address is for (private, shared, documentation and so on) comes from the IANA special-purpose address registries. The classes A to E are the old pre-1993 scheme, still asked about in courses. ↑ and ↓ in the field, [ and ] elsewhere, or the slider make the prefix longer or shorter. Nothing is sent anywhere: your network’s layout stays on this device.

How to use Subnet calculator

  1. Type an IPv4 or IPv6 address with its prefix or mask, such as 192.168.1.10/24.
  2. Change the prefix with the slider, or ↑ and ↓ in the field, to make the network larger or smaller.
  3. Press Copy all to copy the network, broadcast, host range and masks.

Subnet calculator: common questions

Is it safe to put my network’s IP addresses into a subnet calculator?

With this subnet calculator it is: every figure is worked out in your browser, on your device, and nothing is sent anywhere, so your network’s layout stays private. It works offline too.

How many usable hosts are in a /31 or /32 subnet?

An IPv4 network has 2^(32 − prefix) addresses and two fewer usable hosts. A /31 is the exception: a link between two routers where both addresses are usable (RFC 3021). A /32 is a single address.

Does the subnet calculator work for IPv6?

Yes. Type an IPv6 address with its prefix, such as 2001:db8::1/64. IPv6 has no broadcast, so every address in the range is usable, and the subnet calculator counts the 2^(128 − prefix) addresses exactly, however large.

Everything stays on your device. Nothing is uploaded. Works offline once your first visit has stored the app.