Home › Developer Tools › VLSM Calculator

VLSM Calculator

Give the major network and a list of subnets with the number of hosts each one needs. The calculator picks the smallest prefix for every subnet, allocates them largest-first without overlaps and shows the full address plan plus what is left over.

Last updated:

%

Extra hosts to plan for in every subnet

Enter your values to see the result.
Advertisement
Advertisement

How to use the VLSM Calculator

  1. Enter the major network you were given, such as 192.168.1.0/24.
  2. List the subnets, one per line, as a name and host count: Sales 60.
  3. Set options: growth allowance, largest-first sorting and /31 links.
  4. Press Calculate VLSM and check the allocation table and free space.
  5. Download the CSV or copy the results for your documentation.

VLSM step by step

  1. Size each subnet. Hosts + 2 (network and broadcast) rounded up to a power of two gives the block size; prefix = 32 − log2(size).
  2. Sort the subnets from largest to smallest.
  3. Allocate the first block at the start of the major network, the next block right after it, and so on.
  4. Write down the network, first and last usable host and broadcast for each block; whatever remains is free for later.

Example with 192.168.1.0/24: Sales 60 hosts → /26 = 192.168.1.0-63; Engineering 28 → /27 = .64-.95; HR 12 → /28 = .96-.111; Management 5 → /29 = .112-.119; two WAN links → /30 = .120-.123 and .124-.127. The upper half, 192.168.1.128/25, stays free.

Hosts to prefix reference

Hosts neededPrefixMaskBlock sizeUsable hosts
2/30255.255.255.25242
3-6/29255.255.255.24886
7-14/28255.255.255.2401614
15-30/27255.255.255.2243230
31-62/26255.255.255.1926462
63-126/25255.255.255.128128126
127-254/24255.255.255.0256254
255-510/23255.255.254.0512510
511-1,022/22255.255.252.01,0241,022
1,023-2,046/21255.255.248.02,0482,046

Planning tips

  • Count gateways, printers, access points and servers as hosts, not just user devices.
  • Keep the free space contiguous (largest-first does this) so a future large subnet still fits.
  • Group related subnets so they can be summarised into one route later.

Frequently asked questions

What is VLSM?

Variable Length Subnet Masking lets one network be divided into subnets of different sizes. Instead of giving every segment the same mask, each gets the smallest block that fits its hosts, which saves address space compared with fixed-length subnetting.

How do I find the prefix for a number of hosts?

Find the smallest n where 2^n − 2 is at least the number of hosts; the prefix is 32 − n. For 60 hosts, 2^6 − 2 = 62 is enough, so the subnet is a /26. For 28 hosts, 2^5 − 2 = 30, a /27.

Why allocate the largest subnet first?

Each block must start on a multiple of its own size. Allocating from largest to smallest means every next block starts on a correctly aligned address automatically, so there are no wasted gaps and no overlaps.

Why do 2 hosts need a /30?

A /30 has 4 addresses: the network address, two usable hosts and the broadcast address. On point-to-point links RFC 3021 allows a /31 with 2 usable addresses and no network or broadcast; enable that option if your equipment supports it.

What if my subnets do not fit?

The calculator places as many as it can and tells you which ones failed, how many addresses are needed in total and the shortest prefix that would hold all of them, for example a /23 instead of a /24.

Should I add room for growth?

Usually yes. A growth allowance of 10 to 25 percent avoids renumbering when a department grows, at the cost of using more address space. Private ranges like 10.0.0.0/8 make generous sizing easy.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Subnet CalculatorCalculate IPv4 network, broadcast, host range, masks and host count, and split subnets.Subnet Mask Cheat SheetInteractive /0 to /32 table of subnet masks, wildcards and host counts with details per prefix.IP Range to CIDRTurn a start and end IP into the shortest list of CIDR blocks, for IPv4 and IPv6.Wildcard Mask CalculatorConvert a subnet mask or CIDR to a wildcard mask for ACLs and OSPF, with range and binary.Email ValidatorCheck email lists and spot disposable addresses.Website Down CheckerCheck if a website is down for everyone.Deep Link GeneratorCreate links that open directly in apps.URL ParserBreak a URL into its parts and edit query string parameters with a live rebuild.User Agent ParserSee your user agent and parse any UA string into browser, OS, engine and device.HTTP Status CodesSearch every HTTP status code with plain-English meanings, causes, fixes and RFC references.Bulk URL OpenerOpen a list of URLs in new tabs at once or in batches, with cleanup, dedupe and delay.DNS LookupLook up A, AAAA, MX, TXT, NS, CNAME, SOA and CAA records with TTLs over secure DNS.API Request TesterSend GET, POST, PUT and DELETE requests with headers and a body, then inspect the response.WebSocket TesterConnect to a ws:// or wss:// server, send messages and watch a timestamped live log.WHOIS LookupLook up who registered a domain or IP: registrar, creation and expiry dates, name servers, status.Mailto Link GeneratorBuild encoded mailto: links with cc, bcc, subject and body, plus HTML code and a QR code.WhatsApp Link GeneratorCreate wa.me click-to-chat links with a pre-filled message, button HTML and a QR code.Basic Auth Header GeneratorCreate an Authorization: Basic header from a username and password, or decode one.Common Ports ListSearchable TCP/UDP port number list with service, protocol and description, filterable by range.DMARC CheckerLook up a domain's DMARC record, explain every tag, grade the policy and get fix suggestions.DMARC Record GeneratorCreate a DMARC TXT record with policy, reporting and alignment options, every tag explained.Email Header AnalyzerPaste raw email headers to trace every server hop, see delays and check SPF, DKIM and DMARC.IP Geolocation LookupFind the country, city, ISP, ASN and time zone of any IP address or domain, with a map.Reverse DNS LookupFind the PTR hostname of any IPv4 or IPv6 address, one at a time or hundreds in bulk.SPF Record CheckerLook up a domain's SPF record, count nested DNS lookups, find errors and test a sender IP.SPF Record GeneratorBuild a valid SPF TXT record from mail providers, IPs and includes, with a lookup-count check.CIDR to IP RangeConvert IPv4 or IPv6 CIDR blocks to first/last IP, mask and host count, and export IP lists.DNS Propagation CheckerCompare DNS answers and TTLs from Cloudflare, Google, Quad9, AdGuard and NextDNS side by side.Domain Availability CheckerCheck if domain names are available across .com, .io, .ai and more, with registrar and expiry.MAC Address LookupFind the vendor of a MAC address or OUI, check multicast and random bits, look up many at once.MX LookupFind a domain's mail servers: MX priority, host, IP addresses and the email provider.Uptime SLA CalculatorTurn 99.9% uptime into allowed downtime per day, month and year, or downtime into uptime %.Website Speed TestTest page speed with Lighthouse: performance score, Core Web Vitals and fixes, mobile or desktop.ASN LookupLook up an AS number or IP: network owner, country, registry, abuse contact and announced prefixes.Bandwidth CalculatorEstimate monthly website bandwidth (GB) and the Mbps you need from page views and page size.CNAME LookupFollow a hostname's full CNAME chain to its final IP addresses, with TTLs and CDN detection.CORS TesterSend GET, POST or OPTIONS from your browser to any API and see whether CORS allows it and why not.DKIM Record CheckerLook up a domain's DKIM key by selector (or auto-detect), check key type, bit length and tags.Link in Bio Page GeneratorCreate a link-in-bio page with avatar, bio, links and theme, then download it as one HTML file.NS LookupFind a domain's authoritative nameservers with their IPs, SOA record and DNS hosting provider.Social Share Link GeneratorMake share links and buttons for Facebook, X, LinkedIn, Reddit, Pinterest, WhatsApp and email.TXT Record LookupLook up a domain’s DNS TXT records and see which are SPF, DMARC, DKIM or verification tokens.YouTube Timestamp Link GeneratorMake YouTube links that start at a set time, embed start/end codes and lists of timestamps.DKIM Record GeneratorCreate a DKIM RSA key pair in your browser with the TXT record, selector host and private key PEM.DMARC Report AnalyzerRead DMARC aggregate XML reports (.xml, .gz, .zip): sources, SPF/DKIM alignment and pass rates.Domain Age CheckerSee how old a domain is, when it was registered and when it expires. Bulk check up to 50.Email Deliverability CheckerGrade a domain's MX, SPF, DMARC, DKIM, BIMI and MTA-STS records in one report with fixes.Email ObfuscatorHide an email address from spam bots with HTML entities, a JavaScript mailto link or reversed CSS text.Email PermutatorGenerate every common business email format from a first name, last name and company domain.HTTP Header ParserPaste raw HTTP headers to get a table explaining each one plus a security headers grade.IP Blacklist CheckerCheck an IPv4 address against 21 public spam blocklists (DNSBLs) and see listed or clean.IPv6 Subnet CalculatorIPv6 prefix to network, range, address count and /64s, and split it into child subnets.
See all 52 Network, DNS & Email Tools →