Tool guideConversion & Calculation Tools

Subnet Mask Converter – Complete Guide to CIDR, Wildcard Masks and VLSM Splitting

How masks, prefixes and wildcards relate, how the NetTools.tech converter calculates network, broadcast and host ranges (with RFC 3021 /31), and how its equal and VLSM network splitter allocates aligned blocks.

By NetTools.tech · · 8 min read

Someone hands you 255.255.240.0 and asks for the CIDR prefix; an ACL needs the wildcard mask for /27; a new site gets 10.20.0.0/16 and you have to carve it into VLANs of very different sizes without overlaps or misaligned blocks. Doing this by hand is how a /23 ends up starting at an odd third octet.

The Subnet Mask Converter converts between subnet masks, CIDR prefixes, hex and binary masks and wildcard masks, calculates network, broadcast and host ranges for an address, and includes a network splitter for equal subnets or VLSM allocation per VLAN. It runs in your browser.

What is the Subnet Mask Converter?

In simple terms

Type a mask, a prefix or an address with either, and you get every other way of writing the mask plus the network it defines. A second panel divides a large network into smaller ones — either equal pieces or one block per VLAN, sized to fit.

Technical background

An IPv4 subnet mask is 32 bits: leading 1-bits mark the network part, the remaining 0-bits the host part. The number of 1-bits is the CIDR prefix (/24 = 255.255.255.0). A valid mask is contiguous — its inverse is always 2ᵏ − 1. The wildcard mask is that inverse (0.0.0.255).

For a network with prefix p there are 2³²⁻ᵖ addresses. In a classic subnet the first (all host bits 0) is the network address and the last (all host bits 1) the broadcast address, leaving 2³²⁻ᵖ − 2 usable hosts. RFC 3021 allows /31 on point-to-point links with both addresses usable; /32 is a single host route.

Splitting a network borrows host bits: each extra prefix bit doubles the number of subnets and halves their size. A subnet must start at a multiple of its own size. VLSM (variable-length subnet masking) assigns each segment the smallest block that fits; allocating largest first keeps every block aligned without gaps.

Why use the Subnet Mask Converter?

  • Translate between notations used by different vendors: prefix, dotted mask, hex mask (0xFFFFFF00) and wildcard.
  • Get ranges right: network, broadcast, first and last host for any address and mask.
  • Plan VLANs with VLSM that is guaranteed aligned and non-overlapping, with the remaining free space listed as CIDR blocks.
  • Size equal splits by subnet count, hosts per subnet or new prefix, for IPv4 and IPv6.
  • Catch errors such as non-contiguous masks or dotted masks with IPv6.

Who should use it?

Network engineers designing addressing plans, system administrators configuring hosts and firewalls, people writing Cisco ACLs or OSPF statements, and students learning subnetting. For a single-network view including IPv6 detail, the Subnet Calculator is the companion tool; for one address in other notations, the IP Address Converter.

How the Subnet Mask Converter works

All calculations are integer arithmetic in your browser (BigInt for splitting, so IPv6 works too).

Conversion input is parsed like this:

  1. A prefix on its own: /24 or 24 (0–32).
  2. A hex mask: 0x with up to 8 hex digits, which must be contiguous.
  3. A dotted value: first tried as a mask; if it is not a valid mask but its inverse is, it is treated as a wildcard and the note says so ("0.0.0.255 is a wildcard (inverse) mask … it corresponds to /24"). Otherwise it is rejected as non-contiguous.
  4. An address with a mask part: 192.168.1.10/24, 192.168.1.10 255.255.255.0 or 10.1.2.3/255.255.0.0. The address must be valid IPv4; the network is calculated from it.
  5. An IPv6 address with a prefix length (2001:db8::/48). Dotted masks with IPv6 are refused, and an IPv6 address without a prefix asks you to add one.

A bare IPv4 address with no mask is rejected with a hint to add a prefix or mask. Usable hosts follow the RFC 3021 rule: total − 2 up to /30, all addresses for /31 and /32.

Splitting reads the Network to split in CIDR notation; if host bits are set they are cleared, with a note ("Host bits cleared: the network is …").

  • Number of subnets rounds the count up to a power of two and adds that many prefix bits.
  • Hosts per subnet picks the largest prefix (smallest block) with at least that many usable hosts. IPv4 only.
  • New prefix splits into blocks of the given prefix, which must be between the parent prefix and /32 (or /128).
  • VLANs of different sizes (VLSM, IPv4 only) reads one line per VLAN — a name and a host count separated by a space, comma, semicolon, colon, equals sign or tab; lines starting with # are ignored; at most 512 lines. Each request gets the smallest block holding its hosts (2 hosts → /31, 1 host → /32). Blocks are allocated largest first (equal sizes in input order) from the start of the network and then reported in your input order. The remaining space is listed as aligned CIDR blocks.

Equal splits list at most 4,096 subnets; the rest follow the same pattern and the tool says so. Counts, host numbers and prefixes must be whole numbers of up to 12 digits.

How to use the NetTools.tech Subnet Mask Converter

  1. Open the Subnet Mask Converter.
  2. In Mask, prefix or address with one, enter for example 192.168.1.10/24, 255.255.255.192, /27, 0xFFFFFF00, 0.0.0.255 or 2001:db8::/48. The Try: chips load examples, and the ?q= URL parameter pre-fills the field.
  3. Read Mask & network. Open IPv4 prefix reference (/0 – /32) for a full table of masks, wildcards, addresses and usable hosts.
  4. In Split a network, enter the Network to split (default 10.0.0.0/16).
  5. Choose How to split: Number of subnets (field Subnets needed), Hosts per subnet (Usable hosts per subnet), New prefix (New prefix length) or VLANs of different sizes (one VLAN per line).
  6. Review the statistics, the subnet table and, for VLSM, the free space.
  7. Each panel has its own CSV, JSON, Copy all and Print buttons.

Understanding the results

ResultMeaningWhat to look for
CIDR prefix / Subnet maskThe mask in both common forms/20 = 255.255.240.0
Wildcard maskInverse mask for ACLs and OSPF0.0.15.255 for /20
Mask (hex) / Mask (binary)0xFFFFF000 / dotted bitsContiguous 1-bits from the left
Total addresses / Usable hostsBlock size and assignable hosts, with the rule used/31 = 2, /32 = 1
Network / Network addressCIDR and first address of the blockYour address with host bits cleared
Broadcast addressLast address (— for /31 and /32)Not assignable to hosts
First / Last usable host, RangeAssignable range and full blockUse for DHCP scopes
Address typePrivate, documentation, public…Classification only
New prefix / Subnets / Borrowed bitsEqual-split resultSpare subnets for growth are listed
VLSM tableHosts needed, subnet, first/last host, broadcast, usable, spare per VLANSpare = usable − requested
Addresses used / Utilization / Free blocksVLSM totalsUtilization above 90% is highlighted

Example: a mask conversion and a VLAN plan

Enter 10.20.30.40 255.255.240.0:

text
CIDR prefix         /20
Subnet mask         255.255.240.0
Wildcard mask       0.0.15.255
Mask (hex)          0xFFFFF000
Total addresses     4,096
Usable hosts        4,094
Network             10.20.16.0/20
Broadcast address   10.20.31.255
First usable host   10.20.16.1
Last usable host    10.20.31.254
Address type        Private (RFC 1918)

Now split 10.0.0.0/16 with Number of subnets = 100: new prefix /23, 128 subnets, 510 usable hosts each, 7 borrowed bits, and "28 spare subnets for growth". The first two are 10.0.0.0/23 and 10.0.2.0/23.

With the default VLSM list (VLAN10 Servers 60, VLAN20 Users 500, VLAN30 VoIP 120, VLAN40 Printers 25, VLAN99 Management 10, P2P link 2):

VLANHosts neededSubnetUsableSpare
VLAN10 Servers6010.0.2.128/26622
VLAN20 Users50010.0.0.0/2351010
VLAN30 VoIP12010.0.2.0/251266
VLAN40 Printers2510.0.2.192/27305
VLAN99 Management1010.0.2.224/28144
P2P link210.0.2.240/3120

Addresses used: 754 of 65,536 (1.15%). The free space starts with 10.0.2.242/31, 10.0.2.244/30, 10.0.2.248/29, 10.0.3.0/24 and continues up to 10.0.128.0/17.

Common use cases

  • Converting masks between vendor notations when migrating firewall or router configs.
  • Writing ACL and OSPF statements that need wildcard masks.
  • Planning VLAN addressing for a new site or floor.
  • Splitting an IPv6 /48 into /64 LANs by prefix.
  • Checking DHCP scope boundaries and broadcast addresses.
  • Studying for networking exams with instant feedback.

Troubleshooting

"is not a valid mask: the 1-bits must be contiguous"

Masks like 255.0.255.0 are invalid. If you entered a host address, add a prefix or mask (192.168.1.10/24).

"IPv6 networks use a prefix length only"

Write the IPv6 network as 2001:db8::/48; dotted masks do not exist in IPv6.

"cannot be split into N subnets"

The requested count needs more prefix bits than remain. Use a larger parent network or fewer subnets.

"Not enough space" in VLSM

The rounded-up blocks need more addresses than the parent has. Each request grows to a power of two plus network and broadcast, so 129 hosts already take a /24.

The network address differs from what I typed

Host bits were set, so the tool cleared them and noted the real network. 10.1.2.3/16 becomes 10.1.0.0/16.

Common mistakes

  • Forgetting network and broadcast when counting hosts (except /31 and /32).
  • Starting subnets at unaligned addresses, such as a /23 at 10.0.1.0. The splitter only produces aligned blocks.
  • Allocating VLSM smallest first by hand, which leaves unusable gaps; the tool allocates largest first.
  • Confusing mask and wildcard in ACLs.
  • Giving /31 to devices that do not support RFC 3021. Request 3 hosts for a /30 instead.

Limitations

  • The converter does not check whether a network is in use, routed or overlapping with anything in your environment.
  • Hosts-per-subnet and VLSM splits are IPv4 only; IPv6 splits are by count or prefix.
  • Equal splits show at most 4,096 rows; VLSM lists at most 256 free blocks and accepts at most 512 VLANs.
  • VLSM allocates from the start of the parent network; it does not reserve gaps or honor existing allocations.
  • Address type is a classification by IANA special-purpose ranges, not a lookup.

Security & privacy

All calculations run in your browser, and your networks and VLAN names are not sent to a server. The page may send an anonymous usage counter (tool name and view or run, no inputs) unless your browser uses Global Privacy Control or Do Not Track. Internal addressing plans can be sensitive; exports are created locally, so store them as you would other network documentation, and note that the ?q= parameter puts the input into the URL.

Summary

The Subnet Mask Converter turns any mask notation — prefix, dotted, hex or wildcard — into all the others and calculates the network for an address, applying RFC 3021 for /31 and /32. Its splitter produces aligned equal subnets for IPv4 and IPv6 and largest-first VLSM plans for IPv4 with the free space listed. It does arithmetic only; it cannot see what is already deployed.

Frequently asked questions

Why does a /24 have 254 usable hosts, not 256?

In a classic IPv4 subnet the first address identifies the network and the last is the broadcast address, so 256 − 2 = 254 remain for hosts. /31 point-to-point links (RFC 3021) and /32 single hosts are exceptions, where all addresses are usable.

How do I split a /16 into 100 networks?

You need 7 extra prefix bits, because 2⁷ = 128 is the first power of two that is at least 100. Each subnet is then a /23 with 510 usable hosts, and 28 of the 128 blocks stay free for later.

What is a wildcard mask?

It is the bitwise inverse of a subnet mask, for example 0.0.0.255 for /24. Cisco ACLs and OSPF network statements use it; the converter recognizes a dotted value as a wildcard when it is not a valid mask but its inverse is.

Does IPv6 use subnet masks?

No. IPv6 networks are written with a prefix length only, such as 2001:db8::/48, there is no broadcast address, and LAN subnets are normally /64. The converter accepts IPv6 prefixes and refuses dotted masks with them.

What does VLSM do differently from an equal split?

Variable-length subnet masking gives each subnet only the size it needs instead of one size for all. The tool sizes each VLAN to the smallest block that holds its hosts and allocates the largest blocks first, so every block stays aligned to its own size.

What is a non-contiguous mask?

A mask whose 1-bits are not all on the left, such as 255.0.255.0. Such masks are not valid for subnetting, and the converter rejects them with an explanation.

Why is my VLAN with 2 hosts given a /31?

The splitter treats /31 as usable for two hosts according to RFC 3021, which is the common practice for point-to-point router links. If a device on that segment does not support /31, request 3 hosts to get a /30.