IPv4 Subnet Calculator

Runs in browser New Internet & Network

Enter a network as 192.168.10.0/24, with a dotted netmask or with a wildcard mask, and see its network and broadcast addresses, usable host range, binary mask, neighbouring blocks and a table of every prefix it divides into. Three planning modes split it into equal subnets, place subnets for a list of host counts largest first (VLSM), or find the single route that summarizes a list of networks and say whether it adds addresses. Everything is calculated in your browser.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

How does IPv4 subnetting work?

A prefix length such as /26 splits the 32 bits of an IPv4 address into a network part and a host part: the block holds 2^(32 − 26) = 64 addresses, the first is the network address, the last the broadcast address, and the 62 between them are hosts (RFC 950, RFC 4632). Subnetting borrows host bits to make 2^n equal smaller blocks, VLSM gives each subnet only the size it needs, and summarization goes the other way, replacing adjacent blocks with one shorter prefix. A /31 is the exception: on a point-to-point link both of its addresses are hosts (RFC 3021).

How to use IPv4 Subnet Calculator

  1. Type the network in the IPv4 network field, for example 10.20.0.0/22 or 10.20.0.0 255.255.252.0.
  2. Choose the calculation: network details, an equal split, a VLSM plan or a route summary.
  3. For a split, enter /26 or the number of subnets you need; for VLSM, list one subnet per line with a name and its host count; for a summary, list the networks one per line.
  4. Read the result as it updates, and download the subnet table or the netmask table as CSV for your documentation.

IPv4 Subnet Calculator features

  • Accepts a network as 192.168.10.0/24, as an address and a dotted netmask, or as an address and a Cisco-style wildcard mask, and moves a host address to the network it belongs to
  • Network and broadcast addresses, first and last usable host, total and usable addresses, netmask, wildcard mask and the network address in binary with the network/host boundary marked
  • A table of every prefix the network divides into, from its own length down to /32, with the netmask, how many subnets of that size fit and how many hosts each holds
  • Equal split by prefix (/26) or by a number of subnets, rounded up to the next power of two with a note, listing up to 256 subnets with their usable range and broadcast address
  • VLSM planning from a list of names and host counts: blocks sized to the hosts, placed largest first, with spare addresses per subnet and the free blocks left at the end
  • Route summarization: the smallest single route that covers a list of networks, and whether it is exact or would also cover addresses none of them holds
  • The address type (private, shared CGNAT space, documentation, public…), with a table of the special ranges inside when a large block holds several types, the historical class, the reverse DNS zone and the previous and next block of the same size

Inputs and outputs

Inputs

  • IPv4 network: an address with /prefix, with a dotted netmask, or with a wildcard mask (0.0.0.255 is read as /24); leading zeros such as 010 are refused because they can mean octal.
  • Calculation: network details and netmask table, split into equal subnets, plan subnets by host count (VLSM), or summarize networks into one route.
  • New prefix or number of subnets (split), hosts needed per subnet (VLSM, one "name count" per line, up to 256), networks to summarize (one per line, up to 256).

Outputs

  • At a glance: usable hosts, total addresses, netmask and broadcast, or the subnet count and size, or the plan totals.
  • Result: every address and mask of the network, the plan totals and free blocks, or the summary route with its covered and extra addresses.
  • Subnets table (split, VLSM, summary) and the netmask table (details), both downloadable as CSV, and for a block that holds several address types, the table of the ranges inside it.

IPv4 Subnet Calculator example

Planning four office subnets inside 192.168.10.0/24 with VLSM

Input:

IPv4 network: 192.168.10.0/24 · Calculation: Plan subnets by host count (VLSM) · Hosts: Sales 50, Engineering 28, Guests 12, WAN link 2

Output:

Sales 192.168.10.0/26 (62 usable, 12 spare) · Engineering 192.168.10.64/27 (30 usable) · Guests 192.168.10.96/28 (14 usable) · WAN link 192.168.10.112/30 (2 usable)
Subnets placed 4 / 4 · Addresses allocated 116 · Share of the network used 45.31% · Free blocks after the plan: 192.168.10.116/30, 192.168.10.120/29, 192.168.10.128/25

How to read the IPv4 Subnet Calculator results

Usable hosts is what you can assign to devices: two fewer than the total for any prefix up to /30, both addresses on a /31, one on a /32. Plan for growth: a subnet filled to its last address leaves no room for a new printer.

Spare addresses in the VLSM table are the hosts a subnet can still take before it needs a larger block. Free blocks after the plan are the aligned blocks still available in the network for later subnets.

An exact summary can replace its networks in a routing table without changing where traffic goes. A summary with extra addresses is wider than your networks: traffic for those addresses would be drawn to you as well.

Address type tells you where the block can be used: private and shared space only inside networks, documentation ranges only in examples, public space only when it is assigned to you.

When to use IPv4 Subnet Calculator

  • Carving an office or branch network into VLANs for staff, guests, voice and management, each sized to its devices.
  • Writing firewall rules and ACLs: checking the exact first and last address of a block and its wildcard mask.
  • Preparing for networking exams and interviews by checking subnetting answers and the binary behind them.
  • Reducing a routing table or a BGP announcement by finding which networks summarize cleanly into one route.

Troubleshooting

  • "Add a prefix length or a netmask": an address alone does not say how large the network is; add /24 or 255.255.255.0.
  • "The netmask must be contiguous": a netmask is ones followed by zeros, such as 255.255.240.0. A value like 255.0.255.0 is not a mask; a wildcard such as 0.0.15.255 is accepted and read as its inverse.
  • A subnet marked "Does not fit": the subnets need more addresses than the network has. Use a shorter prefix (a larger network) or lower the host counts.
  • The split refuses a prefix: the new prefix must be longer than the network's own, because splitting makes smaller blocks. To join networks, use the route summary.

Frequently asked questions about IPv4 Subnet Calculator

What is the difference between a netmask and a wildcard mask?

They are the same boundary written the other way round. A netmask has ones for the network bits (255.255.255.192 for a /26); a wildcard mask has ones for the host bits (0.0.0.63), which is how Cisco ACLs and OSPF network statements match a range. The calculator accepts either after the address and shows both.

How does the VLSM plan decide where each subnet goes?

Each line becomes the smallest block that holds its hosts plus a network and a broadcast address: 50 hosts need 52 addresses, so a /26 of 64. The blocks are then placed from the start of the network, largest first, so every block begins on a boundary of its own size and no space is lost between them. Anything that no longer fits is marked, and the free blocks left over are listed.

Why does asking for 6 subnets give me 8?

Equal subnets come from borrowing host bits, and n borrowed bits always make 2^n subnets. Six subnets need three bits, which make eight; the page says when it rounds up. If the subnets need different sizes, use the VLSM mode instead of an equal split.

When is a summary route safe to advertise?

When it is exact: the listed networks fill the summary completely, as 172.16.0.0/24 to 172.16.3.0/24 fill 172.16.0.0/22. If the page reports extra addresses, the summary also attracts traffic for addresses none of your networks hold; advertise it only if that space is yours and unused, otherwise keep the specific routes.

Why did my address turn into a different network address?

A prefix describes a whole block, so 192.168.10.77/26 means the /26 that contains .77, which is 192.168.10.64/26. The page moves the address to the network it belongs to and says so; the address you typed is one of that block's hosts.

Can I use a /31 on a point-to-point link?

Yes. RFC 3021 allows a /31 on point-to-point links, where both addresses are hosts and there is no network or broadcast address, which saves half the addresses of a /30. The calculator shows a /31 that way; its VLSM mode still gives two-host links a /30, because not every device accepts /31.

Technical notes

A prefix length p keeps the first p bits of the address as the network and leaves 32 − p host bits, so the block holds 2^(32 − p) addresses. The network address has every host bit 0 and the broadcast address every host bit 1; the hosts are the addresses between them, 2^(32 − p) − 2 of them (RFC 950 subnetting, RFC 4632 CIDR notation). A /31 is the exception of RFC 3021: on a point-to-point link both of its addresses are hosts.

Equal splitting borrows n host bits, which always makes 2^n subnets of the new prefix p + n. VLSM gives each subnet the smallest power of two that holds its hosts plus two, and places the blocks largest first from the start of the network, which keeps each block aligned to its own size without gaps. The summary route is the longest prefix shared by the lowest and highest address of the list; it is exact only when the listed networks, merged, are exactly that block.

All arithmetic is done on 32-bit values with BigInt in @engines/ip-calc on top of @engines/ip, which also classifies the special-purpose ranges of the IANA registry (RFC 6890): private (RFC 1918), shared address space (RFC 6598), loopback, link-local, documentation (RFC 5737), benchmarking, multicast and reserved space.

Limitations and methodology

IPv4 only. IPv6 prefixes have their own calculator, and arbitrary start–end ranges, overlaps and merges are the IP Range Calculator's job.

Equal splits list the first 256 subnets (the counts cover all of them), and VLSM plans and summaries take up to 256 lines.

VLSM gives two-host links a /30 because some devices do not accept /31; it does not reserve addresses for gateways or growth unless you add them to the host counts.

It calculates addresses only: it cannot tell whether a block is in use on your network, routed on the Internet or assigned to you.

Security and privacy

Everything is calculated in your browser; the networks and host counts you type are not sent anywhere and nothing is stored.

References