Ferramentas Guias
developer Gratuito Sem cadastro

Calculadora de IMC

Divida uma rede IPv4 em sub-redes iguais ou use VLSM para alocar sub-redes por requisito de hosts.

Carregando ferramenta…

Sobre esta ferramenta

Insira qualquer rede CIDR IPv4 (por exemplo, 192.168.0.0/16) e especifique o número de sub-redes necessárias ou os hosts necessários por sub-rede; a calculadora determina o comprimento de prefixo ideal e lista cada sub-rede resultante com seu endereço de rede, endereço de broadcast, intervalo de hosts utilizável e máscara de sub-rede. O modo VLSM (Máscara de Sub-rede de Comprimento Variável) permite nomear múltiplas sub-redes e especificar o requisito de hosts de cada uma — as sub-redes são alocadas do maior para o menor para máxima eficiência. Um diagrama em árvore ASCII visualiza como o espaço de endereços é dividido.

Como usar

  1. 1 Insira a rede base em notação CIDR (por exemplo, 10.0.0.0/8) no campo Rede.
  2. 2 Escolha o modo 'Sub-redes Iguais' e insira o número de sub-redes ou hosts por sub-rede — o outro valor é calculado automaticamente.
  3. 3 Ou mude para o modo 'VLSM', adicione cada sub-rede por nome e contagem de hosts necessários, depois clique em 'Calcular'.
  4. 4 Revise a tabela de sub-redes e o diagrama em árvore ASCII; copie qualquer valor clicando nele.

What this calculator does that a plain subnet lookup does not

A basic subnet tool tells you the mask, broadcast, and host range for a single network. This calculator goes a step further: it carves one base block into many subnets. You give it a starting network in CIDR form — say 192.168.0.0/16 — and it splits that space for you in one of two ways. In Equal Subnets mode every piece is the same size; in VLSM mode each piece is sized independently to fit the hosts it actually needs. Both modes produce a full table (network, first and last host, broadcast, mask, usable count) plus an ASCII allocation tree you can paste into documentation.

Equal subnets: splitting by count or by host requirement

In equal mode you choose one of two questions. "Divide into N subnets" borrows enough bits from the host portion to create at least N blocks: the tool computes bits = ceil(log2(N)) and adds them to the prefix. Asking for 4 subnets borrows 2 bits, so a /16 becomes four /18 networks. Alternatively, "Hosts per subnet" finds the smallest block whose usable count meets your figure, then reports how many such blocks fit in the base. Because subnet sizes are always powers of two, asking for 4 subnets and asking for 5 both borrow the same bits when 5 rounds up past a power-of-two boundary — the tool always rounds up so every request is satisfied.

A worked VLSM example

VLSM (Variable Length Subnet Masking) is where this tool earns its keep. Suppose you have 192.168.0.0/24 and three departments needing 50, 25, and 10 hosts. A naïve equal split into four /26 blocks (62 hosts each) wastes huge ranges on the small departments. The VLSM allocator instead sorts your requirements largest-first and packs them tightly:

DepartmentHosts neededAllocated blockUsable
LAN A50192.168.0.0/2662
LAN B25192.168.0.64/2730
LAN C10192.168.0.96/2814

Sorting largest-first is what keeps the blocks aligned: each subnet starts on a boundary that is a multiple of its own size, which is a hard rule of CIDR. The tool advances a cursor after every allocation and rounds it up to the next valid boundary, so you can never accidentally create overlapping or misaligned ranges. After placing all three, the space from 192.168.0.112 onward stays free for future growth — something the equal split would have squandered.

How the bit math works under the hood

Every address is treated as a single 32-bit integer. The mask for a /26 is 0xFFFFFFC0 (26 leading ones); ANDing an address with it yields the network, and the host count is 2^(32 − prefix) minus the two reserved addresses (network and broadcast). The allocator's "smallest block that fits" search starts at /30 and widens the prefix until the usable count clears your requirement, which is exactly how a network engineer sizes a subnet by hand — just instant and error-free.

Use cases

  • Office network design. Allocate right-sized subnets per floor, department, or VLAN without wasting a public or RFC 1918 block.
  • Studying for CCNA. VLSM problems are an exam staple; checking your hand-worked answer against the allocation table builds speed and confidence.
  • Cloud and lab planning. Carve a VPC CIDR into subnets for app, database, and management tiers before you provision anything.
  • Documentation. Copy the ASCII tree straight into a runbook or wiki so the next engineer sees the whole hierarchy at a glance.

Tips and common mistakes

  • Plan for the +2 overhead per subnet. Requesting "exactly 30 hosts" lands you in a /27 (30 usable) with zero spare. If the department might grow, ask for a few more.
  • Order does not matter in VLSM input — the tool sorts for you. You can list departments in any order; it always allocates largest-first to preserve alignment.
  • Watch for "Network space exhausted." If your requirements add up to more than the base block holds, the tool flags the subnet that no longer fits rather than silently overlapping.
  • The base can be any address in the block. Entering 192.168.0.37/24 is fine; the tool ANDs it down to the true 192.168.0.0 network first.
  • Equal mode rounds up. Asking for 3 subnets gives you 4 (two borrowed bits), because subnet counts are powers of two — the extra block is yours to keep in reserve.

Privacy

All of this is integer bit-math performed in your browser. The networks you enter are never transmitted or logged, and the calculator keeps working with no internet connection once the page has loaded.

Perguntas frequentes

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}