FernTool

Subnet calculator (IPv4 & IPv6)

Free subnet calculator, subnet mask calculator and CIDR / netmask calculator for IPv4 and IPv6. Enter a prefix such as 192.168.1.0/24 or 2001:db8::/48 to get the network address, subnet mask, wildcard, broadcast, usable host range and address count. Results update as you type.


Try: 192.168.1.0/24 · 10.0.0.0/8 · 172.16.0.0/12 · 2001:db8::/48 · /56 · /64

Result

CIDR
192.168.1.0/24
Network
192.168.1.0
Netmask
255.255.255.0
Netmask (binary)
11111111.11111111.11111111.00000000
Wildcard
0.0.0.255
Broadcast
192.168.1.255
First usable
192.168.1.1
Last usable
192.168.1.254
Total addresses
256
Usable hosts
254
Type
private (RFC 1918)

Split into 4 × /26

Each network has 64 addresses (62 usable devices), mask 255.255.255.192.

NetworkUsable devicesBroadcast
192.168.1.0/26192.168.1.1 – 192.168.1.62192.168.1.63
192.168.1.64/26192.168.1.65 – 192.168.1.126192.168.1.127
192.168.1.128/26192.168.1.129 – 192.168.1.190192.168.1.191
192.168.1.192/26192.168.1.193 – 192.168.1.254192.168.1.255

Subnet size by number of devices

Don’t know the CIDR? Type how many devices (hosts) need an address and get the smallest subnet that fits.


How many subnets do you need?

Need separate networks for staff, guests, cameras or each floor? Type how many, pick the block you have, and get the subnet size and mask.

VLANs: 4 VLANs from a /24 · 10 VLANs · 10 VLANs of 25 devices (needs a /23)

Is this IP in this subnet?

Got an address and a network? Check whether the IP sits inside it — and whether it is a usable host, the network address or the broadcast.

Try: 192.168.1.50 in 192.168.1.0/24 · .255 (broadcast) · 192.168.2.10 (outside) · 2001:db8::5 in /64

Split a network into smaller subnets

Need separate networks for staff, guests and cameras? Enter the big network (e.g. 192.168.10.0/24), pick a size under Split into and press Calculate. You get every smaller network with its usable range and broadcast address. Example: 192.168.10.0/24 split into four /26 networks (62 devices each).

Common subnet masks (/24 to /28)

These are the sizes people look up most often. Click a prefix to calculate it, or open the full subnet mask cheat sheet for every CIDR from /8 to /32 with wildcard masks.

CIDRSubnet maskUsable hostsTypical use
/24255.255.255.0254Home / office LAN
/25255.255.255.128126Half of a /24
/26255.255.255.19262Small office / VLAN
/27255.255.255.22430Small VLAN
/28255.255.255.24014Point-to-multipoint

How many hosts per subnet? (devices to mask)

Pick the first row whose usable count is at least the number of devices you need. Every IPv4 subnet loses two addresses (network and broadcast), which is why a /24 holds 254 devices, not 256.

Devices (up to)CIDRSubnet maskSubnets in a /24
2/30255.255.255.25264
6/29255.255.255.24832
14/28255.255.255.24016
30/27255.255.255.2248
62/26255.255.255.1924
126/25255.255.255.1282
254/24255.255.255.01
510/23255.255.254.0—
1,022/22255.255.252.0—
2,046/21255.255.248.0—
4,094/20255.255.240.0—

How many subnets from a /24? (networks to mask)

Each time you double the number of networks, the prefix grows by one and each network halves. Pick the first row with enough networks, then check the devices column is big enough.

Networks (up to)CIDRSubnet maskDevices each
2/25255.255.255.128126
4/26255.255.255.19262
8/27255.255.255.22430
16/28255.255.255.24014
32/29255.255.255.2486
64/30255.255.255.2522

How subnetting works

An IPv4 address is 32 bits, and an IPv6 address is 128 bits. A subnet splits those bits in two: the first n bits (the prefix) identify the network, and the remaining bits identify individual hosts on it. The prefix length after the slash in CIDR notation tells you where the split is. In 192.168.1.0/24, the first 24 bits (192.168.1) are the network, and the last 8 bits give 28 = 256 addresses. For IPv4 the first address is the network address and the last is the broadcast address, so a /24 has 254 usable hosts. Each extra prefix bit halves the subnet, and each bit less doubles it.

IPv4 CIDR cheat sheet (selected prefixes)

PrefixNetmaskAddressesUsable hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/20255.255.240.04,0964,094
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422
/32255.255.255.25511

Need every row including wildcards and block sizes? Use the subnet mask cheat sheet.

Private ranges and special blocks

The calculator tells you what kind of block you entered. Private ranges (RFC 1918) are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. They are used inside homes and offices and never routed on the internet. 100.64.0.0/10 is reserved for carrier-grade NAT; if your router’s WAN address is in it, you are behind CGNAT. In IPv6, fc00::/7 is unique local (private), fe80::/10 is link-local and 2000::/3 is global unicast. Read more in public vs private IP addresses.

IPv6 subnet calculator examples

IPv6 subnetting is simpler than IPv4 because addresses are plentiful. Every LAN gets a /64 (required for SLAAC). Your ISP typically delegates a /56 (256 LANs) or a /48 (65,536 LANs). There is no broadcast address in IPv6. Try these documentation prefixes:

Need the full list of /64 networks inside a /48 or /56? Use the dedicated IPv6 subnet calculator. New to IPv6? Start with what IPv6 is or check whether your connection has it with the IPv6 test.

Worked IPv4 example

Say you need four networks of up to 60 devices each, carved out of 192.168.10.0/24. 60 hosts plus network and broadcast needs at least 62 addresses, so a /26 (64 addresses, 62 usable) fits. The four /26 networks are 192.168.10.0/26, .64/26, .128/26 and .192/26. Enter 192.168.10.64/26 above and you’ll see hosts .65 to .126 with broadcast .127.

Frequently asked questions

How do I check if an IP address is in a subnet?

Type the IP and the network (for example 192.168.1.50 and 192.168.1.0/24) into “Is this IP in this subnet?”. You get a yes or no, and whether the address is a usable host, the network address or the broadcast. IPv6 works the same way.

What subnet mask do I need for 10 VLANs?

Treat each VLAN as its own network. 10 VLANs from a /24 need 4 extra bits, so you get 16 × /28 (mask 255.255.255.240, 14 devices each) with 6 spare. If each VLAN needs about 25 devices, start from a /23 and use /27s. Type your numbers into “How many subnets do you need?”.

What subnet mask do I need for 50 hosts?

Use a /26 (255.255.255.192). It has 64 addresses and 62 usable for devices, the smallest size that fits 50. For 100 devices use a /25 (126 usable), for 200 use a /24 (254 usable), and for 500 use a /23 (510 usable). Type your number into “Subnet size by number of devices” to get the answer straight away.

How do I work out how many subnets I need?

Count the networks you need (for example staff, guests, cameras and servers is 4), then find the smallest power of 2 that covers it: 2, 4, 8, 16 and so on. Each doubling adds one bit to the prefix. 4 networks from a /24 needs 2 extra bits, so you get 4 × /26 with 62 devices each. 6 networks needs 3 bits (8 × /27, 30 devices each). Type your numbers into “How many subnets do you need?” to get the answer straight away.

Can I fit 10 subnets of 20 devices in a /24?

Yes. 10 networks need 4 extra bits (16 × /28), but a /28 only has 14 usable addresses, so it is too small for 20 devices. Each 20-device network needs a /27 (30 usable), and a /24 holds 8 of those. So 10 × 20 devices does not fit in a /24 with equal sizes; use a /23 (16 × /27) or make some networks smaller.

How many subnets can I get from a /24?

It depends on the size: 2 × /25 (126 devices each), 4 × /26 (62), 8 × /27 (30), 16 × /28 (14), 32 × /29 (6) or 64 × /30 (2). The formula is 2 to the power of the extra prefix bits, so going from /24 to /27 (3 extra bits) gives 2³ = 8 subnets.

How many hosts are in a /24?

A /24 IPv4 subnet has 256 addresses. Two are reserved for the network and broadcast addresses, leaving 254 usable hosts. A /25 has 126 usable, a /26 has 62, a /27 has 30, a /28 has 14, a /29 has 6 and a /30 has 2.

What is a subnet mask calculator?

A subnet mask calculator (or CIDR / netmask calculator) turns a prefix like 192.168.1.0/24 into the network address, subnet mask (255.255.255.0), wildcard, broadcast and usable host range. FernTool does that for IPv4 and IPv6 as you type.

What is CIDR notation?

CIDR notation writes a network as an address followed by a slash and the prefix length, e.g. 192.168.1.0/24. The prefix length is the number of leading bits that identify the network; the remaining bits identify hosts.

How do I split a /24 into smaller subnets?

Pick a size under “Split into” and press Calculate. A /24 (256 addresses) splits into 2 × /25, 4 × /26, 8 × /27, 16 × /28, 32 × /29 or 64 × /30. Each extra bit doubles the number of networks and halves their size, e.g. 192.168.10.0/24 into /26 gives .0, .64, .128 and .192.

What is a subnet mask?

A subnet mask is the prefix length written as an address: /24 is 255.255.255.0, /16 is 255.255.0.0. A wildcard mask is its inverse (0.0.0.255) and is used in router ACLs.

How do I calculate an IPv6 subnet?

Enter an IPv6 prefix such as 2001:db8::/48, /56 or /64. The calculator shows the network, first and last address, total addresses and how many /64 LANs fit inside. Every LAN should be a /64; ISPs usually delegate a /56 or /48 to a site.

Why do /31 and /32 have no broadcast address?

RFC 3021 allows /31 for point-to-point links, where both addresses are usable hosts. A /32 is a single host route. Neither reserves network or broadcast addresses.

What IPv6 subnet size should I use?

Use /64 for every LAN segment: SLAAC address auto-configuration requires it. ISPs typically delegate a /48 or /56 to a site, which contains 65,536 or 256 /64 subnets respectively.

Related: full subnet mask cheat sheet · what is CIDR notation? · IPv6 subnet calculator · public vs private IP · what is CGNAT · IP lookup.

More network tools

API: GET /api/subnet?cidr=10.0.0.0/22 · MCP tool subnet_calc. Calculations run in your browser and on our server; nothing is stored.