Calculadora de Sub-rede IPv4

Dado prefixo /N, retorna hosts úteis, máscara e número de sub-redes.
Created by
Renato Passos, Eng. de Software
Reviewed by
Renato Passos, Eng. de Software

Last updated: Apr 18, 2026

Hosts úteis
254
Sub-redes
1
Wildcard bits
8

Formula

hosts = 2^(32-N) - 2;  subnets = 2^(N-orig)

About this calculator

The IPv4 Subnet Calculator is a tool that, given a prefix /N, calculates the subnet mask, the number of usable hosts, and the number of possible subnets. The prefix /N indicates how many bits are used for the network portion, and the calculator applies standard IPv4 formulas. For example, for a /24 prefix, the mask is 255.255.255.0, with 254 usable hosts and 1 subnet (if the original network is /24).

This calculator is useful for network administrators, IT students, and professionals who need to plan IP addressing for a network. By entering the desired prefix, you quickly obtain essential information to scale the network without manual errors. It is especially useful in scenarios such as creating VLANs, subnets for departments, or optimizing IP allocation.

Important precautions: the usable hosts formula (2^(32-N) - 2) excludes the network and broadcast addresses. To calculate the number of subnets, you need to know the original prefix of the network (N_orig). If not provided, the calculator assumes the original network is /N, resulting in 1 subnet. Always verify that the prefix /N is within the valid range (0 to 32).

Frequently asked questions

Why is the number of usable hosts 2^(32-N) - 2 instead of 2^(32-N)?

Because the first address is reserved for the network address and the last for the broadcast. They cannot be assigned to hosts.

How do I calculate the number of subnets if I don't know the original prefix?

You need to know the original prefix of the network. If unknown, the calculator assumes the original network has the same prefix, resulting in 1 subnet.

What is the subnet mask for a /27 prefix?

The mask is 255.255.255.224, since 27 network bits correspond to 224 in the last octet.

Does this calculator work for IPv6?

No, it is specific to IPv4. IPv6 uses different prefixes and notation.

Can I use this calculator for /31 networks?

Yes, but note that a /31 prefix has 0 usable hosts (2^(32-31)-2 = 0). It is used for point-to-point links.

Other Tecnologia e Computacao calculators