Skip to content
OddsockLocal
Local
Source text

The preview shows up here.

ReadyRuns in this browser. Nothing is uploaded.

How to use

  1. Enter an IPv4 address, a slash, and a prefix from 0 to 32.
  2. Read the network and the dotted mask.
  3. Read broadcast, first host and last host. On /31 and /32 the broadcast is null.
  4. Read the host count. For prefixes shorter than 31 it is the block size minus two.

What is Subnet calculator?

Give the calculator an address and a prefix. It aligns the address down to the network, then reports the mask, the broadcast, the first and last host, and how many hosts that leaves. 192.0.2.139/26 is the network 192.0.2.128/26, mask 255.255.255.192, broadcast 192.0.2.191, first host 192.0.2.129, last host 192.0.2.190, 62 hosts. The .139 you typed is just a member of that block.

Read more

Prefix length changes the host rule. A /31 has two hosts and no broadcast address set aside: 192.0.2.1/31 reports hosts 2, first 192.0.2.0, last 192.0.2.1, broadcast null. A /32 is a single host, count 1. A /0 on 255.255.255.255 reports 4294967294 hosts, the whole IPv4 space minus network and broadcast. Those edge prefixes are where casual “subtract two” arithmetic goes wrong.

The input has to be address/prefix. IPv6 belongs on the IPv6 calculator. Splitting one block into several equal blocks belongs on the splitter.

Use cases

  • An address in a ticket is 192.0.2.139/26 and you need the network base and the broadcast before writing a firewall rule.
  • A /31 point-to-point link should show two usable addresses and a null broadcast, not a negative host count.
  • You want the dotted mask 255.255.255.192 next to the prefix /26.
  • A /32 host route should report one host, so a template that always subtracts two is caught.

An address that is not the network base

192.0.2.139/26

network 192.0.2.128/26, mask 255.255.255.192, broadcast 192.0.2.191, first host 192.0.2.129, last host 192.0.2.190, hosts 62.

Why use Oddsock

The address you type is masked down. 192.0.2.139 is not the network; 192.0.2.128/26 is.

Related tools

Using this tool

A /26 starts every 64 addresses. 128 is the multiple at or below 139, so the network is 192.0.2.128/26. 139 is only a host inside it.