Technology calculators

IPv4 Calculator

Updated Jul 28, 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 — 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 broader address lookups, try the IP Address Calculator, and 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. The Subnet Calculator is a good companion if you want a mask-first view of the same block.

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). If you want to practice converting octets by hand, the Binary Calculator and the Hex Calculator are handy side tools.

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, much like the XOR Calculator shows for other bit operations.

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 — the Exponent Calculator shows why 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.

Address planning is only half the job. Once the subnets are set, size the circuit with the Bandwidth Calculator, check how long large transfers will take with the Download Time Calculator or the Data Transfer Calculator, and set uptime targets with the SLA Calculator. For the servers behind those subnets, the RAID Calculator helps plan storage, the Chmod Calculator handles file permissions, and the CRC Calculator is useful when checking frame integrity.


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 do the results show a different address than the one I typed?

The tool masks your address to find the start of the subnet. If you enter 192.168.1.10/24, the Network Address row shows 192.168.1.0 because that is the first address of the subnet. Your typed address still appears in the IP Address row at the top.

What does the green row in the subnet table mean?

Green marks the one subnet that holds the IP address you entered. It also shows a Your subnet tag. Click Go to my subnet to jump straight to that page of the list.

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.

Can I enter a /0 prefix?

No. The menus run from /1 to /32. If you type /0 in the address box, the tool changes it to /1.

What is the base block shown under the subnet table?

It is the parent network the list is built from. The tool uses the class default: /8 for Class A, /16 for Class B, and /24 for Class C. Every subnet in the table fits inside that block.

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.

Why am I seeing a warning about the network class?

There are two causes:

  • Your address is a different class than the filter you picked.
  • The prefix you picked is outside the class range.

Set the filter to Any to use any prefix from /1 to /32.

How do I see the address and mask in binary?

Click Show binary next to a row. It opens all 32 bits in four groups of eight, with a copy button. Click again to hide it.

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.

Can I copy the results?

Yes. Click the Copy button beside any value, like the mask, network address, or host range. A short note tells you what was copied so you can paste it into a config, a report, or homework.

Does this calculator work for IPv6?

No. This tool is for IPv4 only, which uses 32 bits and four octets. IPv6 uses 128 bits written in hex groups, so it needs a different calculator.

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 does the subnet table show only part of the list?

Large blocks can hold thousands of subnets, so the table shows one page at a time. Change Rows per page, or use Prev, Next, or the page box to move through the list.

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.

Where can I check the math behind the answer?

Look at the Step-by-Step Solution box. It shows each step in order: the binary address, how the mask is built, the network address, the wildcard mask, the broadcast address, the total and usable host counts, the host range, and the subnet count.

Why does the chart use a log scale?

Host counts double with every extra host bit, from 1 up to millions. A log scale lets the tiny bars and the huge bars both show on the same chart. The red marker shows your selected prefix.

What does the bit bar above the steps show?

It shows how the 32 bits are split. The purple part is the network bits set by your prefix, and the green part is the host bits left for devices. More green means more hosts per subnet.