Includes your inputs and results for this calculation, plus any additional calculations you've compared.
Share & Print
The link includes your inputs and results, so anyone who opens it sees this exact calculation.
How This Calculator Works
A subnet mask splits an IPv4 address into a network portion and a host portion, determining
which addresses belong to the same local network. Enter an IP address and its CIDR prefix
length (the “/24” in an address like 192.168.1.0/24), and this calculator finds the network
address, broadcast address, subnet mask, and the range of addresses actually usable by devices.
The Formula
Subnet mask: the prefix length’s worth of leading 1 bits, followed by 0 bits (e.g. /24 →
11111111.11111111.11111111.00000000 = 255.255.255.0).
Network address: the IP address with a bitwise AND against the subnet mask — this zeroes
out the host bits, leaving just the network.
Broadcast address: the network address with every host bit set to 1 — the highest address
in the subnet.
Usable hosts: every address in the subnet except the network and broadcast addresses,
since those are reserved — 232−Prefix Length−2 for ordinary subnets.
Two special cases carve out different rules: a /31 (RFC 3021) is used for point-to-point
links and treats both addresses as usable hosts, since there’s no need for a broadcast address
between exactly two devices. A /32 is a single-host route — the one address is both the
network and its own only usable host.
Worked Example
192.168.1.0/24 (a /24 prefix):
Subnet mask: 255.255.255.0 (24 bits of 1s, then 8 bits of 0s).
Network address: 192.168.1.0.
Broadcast address: 192.168.1.255.
Usable host range: 192.168.1.1 through 192.168.1.254 —
232−24−2=28−2=254 usable addresses.
Cómo funciona esta calculadora
Una máscara de subred divide una dirección IPv4 en una porción de red y una porción de host,
determinando qué direcciones pertenecen a la misma red local. Ingresa una dirección IP y su
longitud de prefijo CIDR (el “/24” en una dirección como 192.168.1.0/24), y esta calculadora
encuentra la dirección de red, la dirección de difusión, la máscara de subred y el rango de
direcciones realmente utilizables por los dispositivos.
La fórmula
Máscara de subred: la cantidad de bits 1 iniciales correspondiente a la longitud del
prefijo, seguida de bits 0 (por ejemplo, /24 →
11111111.11111111.11111111.00000000 = 255.255.255.0).
Dirección de red: la dirección IP con un AND bit a bit contra la máscara de subred — esto
pone en cero los bits de host, dejando solo la red.
Dirección de difusión: la dirección de red con cada bit de host establecido en 1 — la
dirección más alta de la subred.
Hosts utilizables: cada dirección de la subred excepto las direcciones de red y de difusión,
ya que están reservadas — 232−Longitud de prefijo−2 para subredes
ordinarias.
Dos casos especiales establecen reglas distintas: un /31 (RFC 3021) se usa para enlaces punto
a punto y trata ambas direcciones como hosts utilizables, ya que no hay necesidad de una dirección
de difusión entre exactamente dos dispositivos. Un /32 es una ruta de host único — la única
dirección es tanto la red como su propio y único host utilizable.
Ejemplo resuelto
192.168.1.0/24 (un prefijo /24):
Máscara de subred: 255.255.255.0 (24 bits de 1, luego 8 bits de 0).
Dirección de red: 192.168.1.0.
Dirección de difusión: 192.168.1.255.
Rango de hosts utilizables: 192.168.1.1 a 192.168.1.254 —
232−24−2=28−2=254 direcciones utilizables.
The number after the slash is how many leading bits of the 32-bit IP address are the network portion — a /24 means the first 24 bits identify the network, leaving the remaining 8 bits (256 addresses) for hosts on that network.
Why are 2 addresses subtracted from most subnets?
The lowest address in a subnet is reserved as the network address (identifying the subnet itself) and the highest is reserved as the broadcast address (for sending to every device on the subnet at once) — neither can be assigned to an individual device, which is why usable hosts is 2 less than the total address count.
Why don't /31 and /32 follow the same 2-address rule?
A /31 (RFC 3021) is specifically used for point-to-point links between exactly two devices, where reserving a broadcast address would waste half the available addresses — both addresses are treated as usable hosts instead. A /32 identifies exactly one address (a single host route), so that one address is both the network and its own usable host.
We use cookies for analytics and ads to help support this free site. You can accept all, or decline and we'll only use what's needed for the site to work.