🆕 Newly Added Calculators:

🌐 Subnet Calculator

Muhammad Yasir Yasin
By Muhammad Yasir Yasin · Updated 12 Nov 2026 Founder · 20 Year+ Telecom + IT Expert
Muhammad Yasir Yasin

Muhammad Yasir Yasin

Founder, metacalculator.org

Muhammad Yasir Yasin is a Telecom + IT expert from Pakistan with 20+ years of proven experience — the career documented on his LinkedIn. He has been in pure IT since 1998, and works as a crypto consultant & trader since 2016. He is the founder of metacalculator.org, seotools.metacalculator.org (SEO Tools) and metatrendonline.com (Digital Products Market Place): free tools built to give clear, checked answers, with no sign-ups and no paywalls.

Every calculator here is built from the published formula, tested by hand, and explained in plain words.

Subnet Calculator

Result

Subnetting splits an IP network into the network portion and the host portion using a bitmask. Give this calculator any IPv4 address with a CIDR prefix (like /24) and it derives the network address, broadcast address, subnet mask and the full usable host range.

Remember the rule behind the numbers: the all-zeros host address is the network itself and the all-ones address is the broadcast — neither is assignable to a device.

What a subnet is, and what this calculator works out

Every device on an IPv4 network needs an address that does two jobs at once. The first part of the address names the network the device belongs to, and the second part names the device itself inside that network. A subnet is simply a network carved to a defined size, and subnetting is the arithmetic that decides where one network ends and the next one begins.

This calculator does that arithmetic for you. Enter an IPv4 address, choose a CIDR prefix length from the list, click Calculate, and it returns five facts in one pass: the network address, the subnet mask in dotted decimal, the broadcast address, the number of usable hosts, and the usable host range. Those five facts are what you need to configure a router interface, set a static address without creating a conflict, plan address space for an office or a lab, or check an exam or interview answer before you trust it.

The inputs are deliberately narrow and honest about it. The address is a standard four-octet IPv4 address, and the prefix choices offered are /8, /16 and /24 through /30. That covers the sizes most home, small-office and teaching examples actually use, from a large private block down to a small segment with only two usable hosts.

CIDR notation, in plain words

CIDR, pronounced cider and short for Classless Inter-Domain Routing, writes a network as an address followed by a slash and a number, such as 192.168.1.0/24. The number is the prefix length: it counts how many of the 32 bits in an IPv4 address belong to the network part. The remaining bits belong to hosts.

In 192.168.1.0/24, the first 24 bits — the first three octets, 192.168.1 — name the network, and the last 8 bits name hosts inside it. In a /26, the first 26 bits name the network and only 6 bits remain for hosts, so the network is smaller. The rule that follows is the whole subject in one sentence: a larger prefix number means a smaller network with fewer hosts, and a smaller prefix number means a larger network with more hosts. Nothing else about the address changes that relationship.

The same prefix can also be written as a subnet mask. A /24 is 255.255.255.0, a /26 is 255.255.255.192, and a /8 is 255.0.0.0. The mask is the prefix translated into the dotted form that older configuration screens, and many current ones, still ask for, which is why this calculator shows both forms side by side.

The formula behind every row

Three linked calculations produce the results, following the standard subnet arithmetic set out in RFC 950 and tabulated in RFC 1878.

First, the total number of addresses in a subnet is 2 raised to the power of the host bits: 2^(32 − prefix). A /24 has 8 host bits, so it contains 2^8 = 256 addresses in total. A /26 has 6 host bits, so it contains 64 addresses.

Second, the usable host count subtracts two from that total:

Usable hosts = 2^(32 − prefix) − 2

The two addresses removed are not wasted by accident. The first address in the block, with all host bits set to zero, is the network address itself and cannot be given to a device. The last address, with all host bits set to one, is the broadcast address, used to reach every device on that subnet at once and likewise unavailable to any single host. That is why a /24 offers 254 usable hosts rather than 256, and a /30 — often used for a point-to-point link between two routers — offers exactly 2 usable hosts, one for each end of the link.

Third, the network and broadcast boundaries are found by masking. The entered address is combined with the mask so that every host bit is forced to zero; the result is the network address. Setting every host bit to one instead gives the broadcast address. The usable range then runs from one above the network address to one below the broadcast address.

Worked example — the calculator defaults

Start with the page defaults, an address of 192.168.1.0 and a prefix of /24:

  • Network address: 192.168.1.0/24
  • Subnet mask: 255.255.255.0
  • Broadcast address: 192.168.1.255
  • Usable hosts: 254
  • Usable range: 192.168.1.1 – 192.168.1.254

Read that range as a practical instruction. A printer, a server or a workstation on this network can take any address from 192.168.1.1 through 192.168.1.254, with the router itself most often holding 192.168.1.1 by convention. No device should be given 192.168.1.0, because that names the network, and no device should be given 192.168.1.255, because that is the broadcast address for the whole subnet.

Worked example — the same address at /26

Keep the address at 192.168.1.0 and change only the prefix to /26:

  • Network address: 192.168.1.0/26
  • Subnet mask: 255.255.255.192
  • Broadcast address: 192.168.1.63
  • Usable hosts: 62
  • Usable range: 192.168.1.1 – 192.168.1.62

The block now ends at .63 instead of .255, because only the last 6 bits vary. Everything from .64 onwards belongs to a different /26 network. This is the clearest illustration on the page of why prefix length, not the starting address alone, defines a subnet: the same first address describes a network of 254 usable hosts at /24 and a network of 62 usable hosts at /26.

Why a host address still returns its network

Enter 192.168.1.37 with a /24 prefix and the calculator still reports a network address of 192.168.1.0/24, with the same mask, broadcast and usable range as the default example. That is correct behaviour, not a rounding error. The value .37 is a host address inside the network, and masking forces its host bits to zero to reveal the network it belongs to.

This matters in real troubleshooting. A device reporting its own address as 192.168.1.37/24 is telling you it sits on the 192.168.1.0/24 network, expects a broadcast address of 192.168.1.255, and should be able to reach every other address in the .1 to .254 range directly, without a router. If two devices show addresses that mask down to different network addresses, they are on different subnets even if they are plugged into the same switch, and traffic between them must be routed.

CIDR quick reference table

PrefixTotal addressesUsable hostsTypical reading
/816,777,21616,777,214A very large private block
/1665,53665,534A large site or campus block
/24256254The standard small LAN
/25128126Half of a /24
/266462A quarter of a /24
/273230A small segment
/281614A very small segment
/2986A handful of devices
/3042A point-to-point link

Notice the pattern in the usable column. Every step of one in the prefix halves the network. A /24 gives 254 usable hosts, a /25 gives 126, a /26 gives 62, and so on down to the /30 with 2. If you need room for about 50 devices, a /26 with 62 usable hosts fits with a little spare capacity; a /27 with 30 does not, however neat it might look on paper. Sizing from the table first, and confirming with the calculator, prevents the most common planning error of all: choosing a subnet that is one step too small for the number of devices that will actually join it.

A large example — 10.0.0.0/8

Choose the address 10.0.0.0 with the /8 option and the scale changes completely:

  • Subnet mask: 255.0.0.0
  • Broadcast address: 10.255.255.255
  • Usable hosts: 16,777,214

Only the first octet names the network here, and the remaining 24 bits are all host bits. Blocks of this size are not used as a single flat LAN in practice; they are address space that an organisation then subdivides into many smaller subnets internally. The calculator result is still useful, because it states the full extent of the block you have been allocated before you start carving it up.

Splitting one network into four — a worked subnetting example

The most common subnetting task is division: taking one block and splitting it into equal smaller networks. Start with 192.168.1.0/24, which holds 256 addresses, and split it into four equal subnets. Four is 2^2, so the split borrows two host bits for the network part and moves the prefix from /24 to /26. Each new network holds 64 addresses, with 62 usable hosts.

The four networks are:

SubnetNetwork addressBroadcast addressUsable rangeUsable hosts
1192.168.1.0/26192.168.1.63192.168.1.1 – 192.168.1.6262
2192.168.1.64/26192.168.1.127192.168.1.65 – 192.168.1.12662
3192.168.1.128/26192.168.1.191192.168.1.129 – 192.168.1.19062
4192.168.1.192/26192.168.1.255192.168.1.193 – 192.168.1.25462

Check the boundaries as you read down. Each network starts exactly where the previous broadcast ended, plus one. There are no gaps and no overlaps, and the last broadcast, 192.168.1.255, is the same broadcast the original /24 had. A split that does not end on that address, or whose blocks overlap, has gone wrong somewhere. You can confirm any one of the four rows by entering its network address in this calculator at /26 — the first row is the worked /26 example above, returning a mask of 255.255.255.192, a broadcast of 192.168.1.63 and 62 usable hosts.

A practical reason to split this way is separation: one /26 for office workstations, one for printers and shared devices, one for guest access and one kept spare. Each group gets its own broadcast domain and its own range to manage, while the total still fits neatly inside the original block.

Private address ranges (RFC 1918)

Most addresses entered into this calculator will be private addresses. RFC 1918 reserves three blocks that anyone may use inside their own networks, and which are never routed on the public internet:

  • 10.0.0.0/8 — a single large block, often subdivided by big organisations.
  • 172.16.0.0/12 — a middle-sized block covering 172.16.0.0 through 172.31.255.255.
  • 192.168.0.0/16 — the block almost every home router uses, typically as a single 192.168.0.0/24 or 192.168.1.0/24 network.

If an address falls inside one of these ranges, it is a local address. Two different homes can both use 192.168.1.10 without any conflict, because each network is private and a router translates between the private inside and the public outside. When you are documenting a network, noting that an address is RFC 1918 private space, and which of the three blocks it came from, saves a great deal of later confusion.

Who this calculator suits — and its limits

It suits network administrators checking a configuration, students working through subnetting exercises, home users setting static addresses, and anyone reading a network diagram who needs to know the real extent of a block written as, for example, 192.168.1.0/26.

The limits should be stated plainly. This is an IPv4 tool; IPv6 subnetting uses a much larger address space and different conventions and is not covered here. The prefix list is a selection, not the full range: it offers /8, /16 and /24 to /30, so intermediate sizes such as /17 to /23 and /9 to /15 cannot be selected, even though the underlying arithmetic is the same. Very small prefixes used for point-to-point links and single hosts, /31 and /32, are also not offered in the list. For the sizes that are offered, every figure follows the standard formula and the worked examples above can be checked by hand from the CIDR table.

Common mistakes

  • Counting the network and broadcast addresses as usable. They are part of the total but can never be assigned to a device; that is the minus 2 in the formula.
  • Reading a larger prefix as a larger network. The opposite is true: /30 is far smaller than /24.
  • Entering a host address and expecting it to be echoed back as the network. Enter 192.168.1.37/24 and the network is correctly reported as 192.168.1.0/24.
  • Using an invalid octet. Any value above 255 is rejected, and the calculator asks for a valid four-octet IPv4 address instead of guessing.
  • Forgetting that split blocks must align. Subnets start on their own size boundary — /26 networks start at .0, .64, .128 and .192, never at an arbitrary address such as .10.
  • Treating a private address as a public one. An address in 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16 is local by design.

Key terms

  • CIDR prefix — the number after the slash, counting the network bits in the address.
  • Subnet mask — the prefix written in dotted decimal, such as 255.255.255.0 for /24.
  • Network address — the first address of a block, with all host bits zero; it names the subnet and is not assigned to a device.
  • Broadcast address — the last address of a block, with all host bits one; traffic sent to it reaches every host on the subnet.
  • Usable hosts — total addresses minus 2, the count of addresses that can actually be given to devices.
  • RFC 1918 private space — the reserved 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 blocks for internal networks.

Related calculators

---

Frequently asked questions

What does 192.168.1.0/24 mean?

The address 192.168.1.0 is the network address and /24 means the first 24 bits name the network, leaving 8 bits for hosts. This calculator gives a subnet mask of 255.255.255.0, a broadcast address of 192.168.1.255, 254 usable hosts and a usable range of 192.168.1.1 – 192.168.1.254.

How many usable hosts are in a /26 subnet?

A /26 subnet has 62 usable hosts. It contains 64 addresses in total, and subtracting the network address and the broadcast address leaves 62. For 192.168.1.0/26 the mask is 255.255.255.192, the broadcast is 192.168.1.63 and the usable range is 192.168.1.1 – 192.168.1.62.

Why is 2 subtracted from the host count?

Two addresses in every subnet are reserved and cannot be given to a device. The first address, with all host bits zero, is the network address, and the last address, with all host bits one, is the broadcast address. That is why the formula is usable hosts = 2^(32 − prefix) − 2, so a /24 gives 256 − 2 = 254 usable hosts.

What happens if I enter a host address such as 192.168.1.37?

The calculator masks off the host bits and reports the network that address belongs to. At /24, entering 192.168.1.37 still returns a network address of 192.168.1.0/24, a mask of 255.255.255.0, a broadcast of 192.168.1.255 and the usable range 192.168.1.1 – 192.168.1.254.

How do I split 192.168.1.0/24 into four equal subnets?

Use /26 for each subnet. Borrowing two bits moves the prefix from /24 to /26 and creates four networks of 64 addresses each: 192.168.1.0/26, 192.168.1.64/26, 192.168.1.128/26 and 192.168.1.192/26. Each one has 62 usable hosts, and the four together cover the original /24 with no gaps or overlaps.

Which IP address ranges are private?

RFC 1918 reserves three private blocks that are never routed on the public internet: 10.0.0.0/8, 172.16.0.0/12 covering 172.16.0.0 to 172.31.255.255, and 192.168.0.0/16. Most home and office networks use addresses from these ranges, and the same private address can safely be reused inside many different private networks.

Which prefix sizes does this calculator offer?

The prefix list offers /8, /16 and /24 through /30. That includes the large 10.0.0.0/8 block with 16,777,214 usable hosts, the standard /24 LAN with 254 usable hosts, and the /30 point-to-point size with 2 usable hosts. Intermediate prefixes such as /17 to /23 and the very small /31 and /32 sizes are not in the list.