Technology calculators

IPv4 Calculator

Updated Sep 1, 2026 By Jehan Wadia
Rate Formulas

Subnet Inputs

Enter dotted-decimal, e.g. 192.168.1.10. You may include a prefix such as /24 and it will be applied automatically.
Network Class Filter
Filters the prefix, mask, hosts and subnet menus below to the selected class.
Subnets created inside the base block

Subnet Results — 192.168.1.0/24

Calculated IPv4 subnet properties for the entered address
PropertyValue

Subnet Size Visualizer

Network bits: 24 of 32 Host bits: 8 of 32

Step-by-Step Solution

Hosts vs. Subnets by Prefix Length

All Subnets in the Block

Enumeration of every subnet inside the selected address block
# Subnet Address Subnet Mask Host Range Broadcast Address Usable Hosts
Page 1 of 1

Introduction

This IPv4 subnet calculator does the network math for you. Type in an IP address like 192.168.1.0, pick a prefix such as /24, and press Calculate. You get the network address, broadcast address, subnet mask, wildcard mask, usable host range, and host count right away.

You can also paste an address with the prefix built in, like 10.0.0.0/16. The tool reads the /16 and sets the menus for you. Pick your subnet by prefix, by mask, by how many hosts you need, or by how many subnets you want, and all four menus stay in sync. If you prefer to work straight from prefix notation, the CIDR Calculator covers the same math from the block side.

Every answer comes with a step-by-step solution, so you can see how each number was found. A bar shows how many bits go to the network and how many go to hosts. A chart compares hosts and subnets for each prefix length. At the bottom, a table lists every subnet in your block, and the subnet that holds your IP is marked in green.

Use it for homework, for CCNA study, or for planning a real network. It works for Class A, B, and C addresses and handles special cases like /31 point-to-point links and /32 host routes. For splitting one block into subnets of different sizes, use the VLSM Calculator.

How to use our IPv4 Subnet Calculator

Type an IPv4 address and pick a subnet size. The calculator shows you the network address, broadcast address, subnet mask, wildcard mask, usable host range, host count, IP class, IP type, step-by-step math, and a list of every subnet in the block.

IPv4 Address: Enter an address like 192.168.1.10. You can add a prefix, such as 192.168.1.0/24, and the tool will set the prefix for you.

Network Class Filter: Choose Any, A, B, or C. This limits the prefix, mask, host, and subnet menus to that class range. Leave it on Any if you are not sure.

Subnet Prefix (CIDR): Pick the prefix length, like /24 or /30. A bigger number means a smaller subnet with fewer hosts.

Subnet Mask (dot-decimal): Pick the mask, like 255.255.255.0. This is the same choice as the prefix, just in dotted form. Changing one changes the others.

Usable Hosts per Subnet: Pick how many hosts you need in each subnet. The tool sets the matching prefix and mask.

Number of Subnets: Pick how many subnets you want inside the base block. The tool works out the prefix that splits the block that way.

Calculate: Click this to run the math and update all results, the bit chart, and the subnet table.

Clear: Click this to reset everything back to the default 192.168.1.0/24 example.

Rows per page and paging: Choose how many subnets show at once, then use Prev, Next, or the page box to move through the list. Click "Go to my subnet" to jump straight to the subnet that holds your address.

What Is an IPv4 Address?

An IPv4 address is a number that names a device on a network. It is written as four numbers split by dots, like 192.168.1.10. Each number is called an octet, and each one can be 0 to 255. Under the hood, the address is really 32 bits (32 ones and zeros).

What Is a Subnet?

A subnet is a smaller network cut out of a bigger one. Splitting a network into subnets keeps traffic tidy, makes it safer, and stops one big group of devices from slowing each other down.

Every IPv4 address has two parts:

  • Network part – says which network the device is on.
  • Host part – says which device it is on that network.

The subnet mask decides where the split happens. A mask like 255.255.255.0 means the first 24 bits are network bits and the last 8 bits are host bits.

CIDR Notation (the /24 Part)

CIDR is a short way to write the mask. Instead of 255.255.255.0, you write /24. The number after the slash is how many bits belong to the network. A bigger number means a smaller subnet with fewer hosts.

Key Addresses in Every Subnet

  • Network address – the first address in the subnet. It names the subnet and cannot be given to a device.
  • Broadcast address – the last address. It sends a message to every device in the subnet, so it is not given to a device either.
  • Usable host range – all the addresses in between. These go to computers, phones, printers, and routers.
  • Wildcard mask – the mask flipped upside down. Cisco routers use it in access lists and OSPF. It is built with a bitwise flip.

How Host Counts Work

Each host bit doubles the number of addresses. The math is simple:

  • Total addresses = 2(32 − prefix)
  • Usable hosts = total addresses − 2

You subtract 2 for the network and broadcast addresses. Two prefixes are special: a /31 gives 2 usable addresses for a link between two routers (RFC 3021), and a /32 is just one single address, often called a host route. The powers of two here grow fast, since each extra host bit doubles the count.

Common Prefix Sizes

PrefixSubnet MaskTotal AddressesUsable Hosts
/30255.255.255.25242
/29255.255.255.24886
/28255.255.255.2401614
/26255.255.255.1926462
/24255.255.255.0256254
/16255.255.0.065,53665,534
/8255.0.0.016,777,21616,777,214

IPv4 Address Classes

Old IPv4 rules sorted addresses into classes by the first octet. Classes are mostly replaced by CIDR today, but network exams and older gear still use the names.

  • Class A – first octet 1 to 126, default mask /8
  • Class B – first octet 128 to 191, default mask /16
  • Class C – first octet 192 to 223, default mask /24
  • Class D – 224 to 239, used for multicast
  • Class E – 240 to 255, saved for tests

Private vs. Public Addresses

Public addresses work on the open internet. Private addresses only work inside your own home or office network, and a router uses NAT to share one public address with them. RFC 1918 sets aside three private ranges:

  • 10.0.0.0 – 10.255.255.255 (10.0.0.0/8)
  • 172.16.0.0 – 172.31.255.255 (172.16.0.0/12)
  • 192.168.0.0 – 192.168.255.255 (192.168.0.0/16)

Other blocks have special jobs too. 127.0.0.0/8 is loopback (your own device), and 169.254.0.0/16 is link-local, which a device picks on its own when no DHCP server answers.

Why Subnetting Matters

Good subnet planning saves addresses and cuts down on broadcast traffic. Give each site, floor, or team the subnet size it needs. A small office link may only need a /30, while a busy office floor may need a /23. Pick a size that fits today's devices with a little room to grow.


Formulas used

IPv4 address to 32-bit integer
I = o_1 \times 16777216 + o_2 \times 65536 + o_3 \times 256 + o_4
Subnet mask from prefix length
m = 2^{32} - 2^{32-p}
Network address (IP AND mask)
N = \left\lfloor \frac{I}{2^{32-p}} \right\rfloor \times 2^{32-p}
Broadcast address
B = N + 2^{32-p} - 1
Wildcard mask
w = (2^{32} - 1) - m
Total addresses in subnet
H_{total} = 2^{32-p}
Usable hosts per subnet
H_{usable} = \begin{cases} 1 & p = 32 \\ 2 & p = 31 \\ 2^{32-p} - 2 & p \le 30 \end{cases}
Number of subnets in the base block
S = 2^{\,p - b} \quad (p \ge b)

Frequently asked questions

Why does the broadcast address say N/A?

You picked a /31 or /32 prefix. These have no broadcast address. A /31 has two addresses, and both are used for a router-to-router link. A /32 is one single address, often used as a host route.

Why does the Number of Subnets menu skip some numbers?

Subnets always split in half, so the count is always a power of two: 1, 2, 4, 8, 16, 32, and so on. A count like 3 or 10 is not possible, so it is not listed. Pick the next number up instead.

How do I pick a prefix for 50 devices?

Use the Usable Hosts per Subnet menu and pick the next size up. A /26 gives 62 usable hosts, which fits 50 with room to grow. A /27 gives only 30, so it is too small.

Why does my address say it is not assignable?

Your address is the network address or the broadcast address of that subnet. Neither one can go on a device. Pick any address inside the usable host range instead.

How do I tell if an address is private, public, or special?

Check the IP Type row. It labels the address as public, private, loopback, link-local, CGNAT, multicast, documentation, or reserved, and it names the RFC that defines that range.

Why did the mask change when I picked a host count?

The prefix, mask, host, and subnet menus all describe the same subnet size in four ways. Change one and the others update to match, so they never disagree.