router

IP Subnet Calculator

Enter an IPv4 address and CIDR prefix to calculate all subnet details

edit_calendar Last updated: Jul 22, 2026 | verified Reviewed by Calkulator Team | timer 2 min read
Developer illustration
Developer

Calculate subnet mask, host range, and broadcast address

Enter an IP address and CIDR notation to see the network address, broadcast address, usable host range, and total host count. A /24 subnet gives 254 usable hosts, while /28 gives only 14.

tips_and_updates Use /30 subnets for point-to-point links — they provide exactly 2 usable host addresses.
IPv4 Address
CIDR Prefix Length
/
0 (no mask) to 32 (single host)
Common Subnets
/8 → 16,777,214 hosts
/16 → 65,534 hosts
/24 → 254 hosts
/30 → 2 hosts (point-to-point)
/32 → 1 host (single IP)
Subnet Details
CIDR Notation
Network Address
Broadcast Address
Subnet Mask
Wildcard Mask
First Usable Host
Last Usable Host
Total Usable Hosts
IP Class
Private IP?
insights
Live Result Illustration
Visual summary — updates instantly as you enter values above
LIVE
Tool Output Updates in real-time // Input Hello, World! ───────────────── Encoding: UTF-8 Length: 13 bytes // Output SGVsbG8sIFdvcmxkIQ== ───────────────────── Format: Base64 Length: 20 chars Do not paste sensitive credentials, tokens, or private keys into any online tool — use local tools for security-critical work.
tips_and_updates

Real-Life Guide to Using the IP Subnet Calculator

CIDR, host range, subnet mask. Use the examples and checks below to turn the number into a practical decision.

When this calculator is useful

Reach for this when you are handed a block like 192.168.10.0/26 and need to know the usable host range before configuring a router, VLAN, or firewall rule, or when you are splitting an office network into smaller segments.

For most people, the best way to use the IP Subnet Calculator is to try the real case first, then change one input at a time. That makes the trade-off visible. For example, with a loan calculator you can change tenure while keeping the same rate; with an investment calculator you can change return assumption while keeping the same monthly contribution; with a health, education or measurement calculator you can check how much one input changes the final category.

The result should answer a practical question: Can I afford this? How much should I save? Is this score enough? Is this measurement within range? What is the safer or cheaper option? If the output does not answer the decision clearly, adjust the inputs until the scenario matches your real situation.

lightbulb Real-Life Example
Splitting an office /24 into VLANs: A small ISP has been handed 10.20.0.0/24 and needs to carve out a 30-host subnet for a new branch office.
1Entering 10.20.0.0/24 with a required 30 hosts, the calculator shows /27 fits (32 addresses, 30 usable), giving network 10.20.0.0, usable range 10.20.0.1–10.20.0.30, and broadcast 10.20.0.31 — the next branch would start at 10.20.0.32/27.
2Now change one input, such as rate, time, quantity, unit or score, and compare the new result with the first one.
Sizing a subnet to the nearest power of two that covers your host count avoids wasting addresses while leaving room to grow.

Practical Advice

Use the IP Subnet Calculator as a planning tool, not just a number generator. Write down the inputs you used, because the final answer is meaningful only when you remember the assumptions behind it.

If the decision affects money, health, tax, safety, academics or legal compliance, keep a second check ready. That second check may be a bank quote, payslip, official rule, prescription, site measurement, mark sheet or invoice.

Common Mistakes

  • Forgetting that the first address in a subnet is the network address and the last is the broadcast address — neither can be assigned to a device, so a /24 gives 254 usable hosts, not 256.
  • Confusing a subnet mask (255.255.255.0) with a wildcard mask (0.0.0.255) when configuring Cisco ACLs, which inverts the entire rule.
  • Assuming /31 and /32 subnets follow the normal network/broadcast rule — RFC 3021 makes /31 usable for exactly two point-to-point addresses with no broadcast address at all.
  • Picking a CIDR size based on current headcount only, e.g. using /28 (14 hosts) for a 12-person team with no room for printers, phones, or a guest VLAN.
  • Mixing up the CIDR prefix from a public IP allocation (given by an ISP) with an internal RFC 1918 range, then trying to route the private block on the public internet.

How to Interpret Results

The output splits your input into network address, broadcast address, first/last usable host, and total usable hosts — use the first/last usable range directly as the DHCP pool or static assignment range, and never assign the network or broadcast address to a device.

A good interpretation looks at both the main result and the supporting values. If a page shows totals, ratios, categories, schedules or warnings, read those together instead of focusing only on the biggest number.

quiz

IP Subnet Calculator FAQs

Useful answers for interpreting the output, avoiding mistakes and using the result responsibly.

What exactly does this subnet calculator compute?
Given an IP address and a CIDR prefix (like /24) or a dotted subnet mask (like 255.255.255.0), it computes the network address, broadcast address, usable host range, total usable hosts, and the subnet mask in both dotted and CIDR notation. It works for both IPv4 classful and classless (CIDR) addressing.
How is the number of usable hosts calculated?
Usable hosts equal 2^(32 - prefix length) minus 2, because the first address in the range is reserved as the network address and the last as the broadcast address. A /24 has 2^8 = 256 total addresses, so 254 are usable; a /30 has 4 total addresses and only 2 usable, commonly used for router-to-router links.
Why does my /24 network show 254 hosts instead of 256?
Every subnet reserves its lowest address as the network identifier and its highest as the broadcast address for that segment, and neither can be assigned to a host interface. This is standard for any prefix from /1 through /30 — only /31 (point-to-point) and /32 (single host) are exceptions.
What is the difference between a subnet mask and CIDR notation?
They express the same information differently: a subnet mask like 255.255.255.192 and a CIDR prefix like /26 both mean 26 network bits and 6 host bits. CIDR notation is more compact and is what you will see in most modern router configs and cloud VPC settings (like AWS or Azure).
Can I use this to check if two devices are on the same subnet?
Yes — compute the network address for both IPs using the same mask; if the resulting network addresses match, the devices can communicate directly without a router. If they differ, traffic between them must be routed through a gateway even if the IPs look numerically close.
Does this handle IPv6 subnetting too?
This calculator is built for IPv4 CIDR and dotted-mask input. IPv6 subnetting uses the same prefix-length logic but with 128-bit addresses and typically /64 subnets for LANs, which would need a dedicated IPv6 tool.
Why do I need a /31 subnet, and how does it behave differently?
A /31 has exactly two addresses and, per RFC 3021, both are usable as host addresses on a point-to-point WAN link (like between two routers) with no network or broadcast address consumed. This saves address space compared to using a /30, which would waste 2 of its 4 addresses.
How do I choose the right subnet size for a new office network?
Count current devices, add realistic growth (printers, phones, guest Wi-Fi, IoT), then pick the smallest CIDR block whose usable-host count comfortably exceeds that number — the calculator lets you test a few prefix lengths against the same base address until the range fits.

IP Subnetting Explained

A subnet divides a large IP network into smaller segments. The CIDR (Classless Inter-Domain Routing) prefix /n tells you how many bits are fixed for the network portion. The remaining bits identify individual hosts. A /24 network has 2⁸ = 256 addresses, minus 2 (network + broadcast) = 254 usable hosts.

The wildcard mask (inverse of subnet mask) is used in Cisco ACLs and OSPF routing configurations. Private IP ranges (RFC 1918) — 10.x.x.x, 172.16–31.x.x, 192.168.x.x — are not routable on the public internet and are used for internal networks.

lightbulb Example
192.168.1.50 /24:
1Network: 192.168.1.0
2Mask: 255.255.255.0
3Hosts: .1 → .254
✓ 254 usable hosts, Private IP

quizFrequently Asked Questions

What is a subnet mask and why is it used?
A subnet mask divides an IP address into a network portion and a host portion. For example, 255.255.255.0 (/24) means the first 24 bits identify the network, leaving 8 bits for hosts (254 usable addresses). Subnetting allows a large network to be split into smaller segments for security, traffic management, and efficient IP allocation.
What is CIDR notation?
CIDR (Classless Inter-Domain Routing) notation like /24 denotes the number of bits in the network prefix. /24 = 255.255.255.0 (256 addresses, 254 usable), /16 = 255.255.0.0 (65,536 addresses), /32 = a single host. CIDR replaced the older Class A/B/C system and allows more flexible, efficient IP allocation across networks of any size.
What is the difference between a gateway, broadcast, and network address?
The network address is the first address in a subnet (not assignable to hosts). The broadcast address is the last address (packets sent to it reach all hosts on the subnet). The gateway (usually the second address) is the router connecting the subnet to other networks. All three are reserved and cannot be assigned to individual devices.
keyboard_arrow_up