IP addressing

IPv4 Subnet Calculator

Calculate an IPv4 subnet, inspect every important value, and generate deployment-ready configuration.

Calculated locally

Learn IPv4 subnetting fundamentals

Review CIDR boundaries, broadcast and usable ranges, and worked examples before applying subnet plans.

Read IPv4 Subnetting Explained

Calculate a subnet

Enter an IPv4 address with a CIDR prefix.

Action
Network
Usable hosts
Prefix
Suggested gateway

Subnet details

Click any dashed value to copy it.

Engineer Insights

Operational context based on this prefix and address class.

Configuration generator

Generate common Cisco IOS XE or Juniper Junos snippets.

How to use the IPv4 subnet calculator

Enter an IPv4 address with a CIDR prefix to inspect the subnet, address range, and copy-ready examples for real deployments.

Start with a network address and prefix

Use the format 192.168.50.18/27 or 10.0.0.1/24. The calculator reports the network and broadcast addresses, subnet mask, wildcard mask, and the first and last usable host.

  • Use the gateway preference to choose the first or last usable address.
  • Review the engineer insights for practical routing and design context.
  • Copy Cisco or Juniper snippets for quick configuration work.

What CIDR notation means

Classless Inter-Domain Routing replaced the older class-based model and lets you size subnets precisely.

CIDR is prefix-based

The slash value after the IPv4 address tells you how many bits are used for the network portion. A /24 reserves 24 bits for the network and leaves 8 bits for hosts.

Why it matters

Prefix notation makes it easier to describe subnets, route summaries, and address planning without converting between classful ranges and custom masks.

How subnet masks work

Subnet masks identify which bits belong to the network and which bits can be assigned to hosts.

Mask bits and host bits

A /27 has 5 host bits, so it supports 32 addresses total and 30 usable addresses in the traditional model. Smaller prefixes create fewer host addresses and are often used for point-to-point links.

Network address, broadcast address, and usable hosts

The first address in the subnet is the network address, the last is the broadcast address, and the addresses in between are the usable hosts. For /31 and /32, special rules apply.

Subnet mask versus wildcard mask

Wildcard masks are commonly used in routing and access-control policies.

Subnet mask

A subnet mask identifies the network portion of an address. It is used for addressing, L3 interface configuration, and host routing.

Wildcard mask

A wildcard mask is the inverse of the subnet mask for many routing and ACL operations. In a wildcard mask, 0 bits match the exact value and 1 bits act as wildcards.

Common CIDR prefix reference

Use this table as a quick reference when planning address space or validating subnet sizes.

CIDRMaskTotal addressesTraditional usable hosts
/16255.255.0.065,53665,534
/17255.255.128.032,76832,766
/18255.255.192.016,38416,382
/19255.255.224.08,1928,190
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/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 (special case)
/32255.255.255.25511 (host route)

/31 is commonly used for point-to-point links and usually allows two addresses. /32 identifies a single host route and has no ordinary host range.

Practical subnetting examples

These examples show how prefix length changes the available address space.

Example 1: /24

192.168.10.0/24 gives you a standard 256-address block with 254 usable hosts in the traditional model.

Example 2: /27

192.168.10.0/27 gives you 32 total addresses and 30 usable hosts, which is common for small user VLANs.

Example 3: /30

192.168.10.0/30 gives you four addresses with only two usable hosts, which is a common point-to-point design.

Example 4: /31

On many modern routing platforms, /31 prefixes are used for dedicated point-to-point links and may be treated as a two-address segment.

Cisco and Juniper configuration examples

These snippets reflect the same subnetting concepts the calculator reports.

Cisco IOS XE

interface Vlan50
 description USER-VLAN
 ip address 192.168.50.1 255.255.255.224
 no shutdown

Juniper Junos

set interfaces irb unit 50 family inet address 192.168.50.1/27

Frequently asked subnetting questions

Answers to the questions that come up most often in network design and troubleshooting.

What is the difference between a network address and a host address?

The network address identifies the subnet itself, while host addresses are the addresses you assign to devices inside that subnet.

Why do some prefixes have fewer usable hosts?

Smaller prefixes reserve more bits for network and broadcast roles, leaving fewer bits for end devices.

When should I use a /31 or /32?

/31 is commonly used for point-to-point links, while /32 is used for host routes or single-address assignments.

What is the difference between a subnet mask and a wildcard mask?

The subnet mask identifies the network portion of an address, while the wildcard mask is used in routing and ACL logic to match or ignore bits.

Copied