---
title: "IPv4 Subnet Calculator - CIDR and Host Range | CanDoYa"
description: "IPv4 subnet calculator for network, broadcast, masks, usable host range, and capacity. Enter any IP with CIDR or subnet mask; results stay private."
url: https://candoya.com/tools/ipv4-subnet-calculator/
locale: en
type: browser-tool
---

# IPv4 Subnet Calculator

Category: Developer

## What is an IPv4 subnet calculator?

An IPv4 subnet calculator turns an IP address and CIDR prefix into the network address, broadcast address, subnet and wildcard masks, usable host range, and address capacity. Enter a host such as 192.168.1.10 with /24, and the calculator finds the boundaries of its subnet instantly in your browser.

IPv4 addresses contain 32 bits. A CIDR prefix says how many leading bits belong to the network, while the remaining bits identify addresses inside that block. This calculator accepts a prefix such as **/26** or its contiguous mask **255.255.255.192**. It uses unsigned 32-bit arithmetic locally, so no address or network plan is uploaded.

## How to use it

1. **Enter an IPv4 address** - Type a host address such as 10.20.30.40. You can also paste CIDR notation such as 10.20.30.40/20.
2. **Choose the subnet size** - Enter a prefix from 0 to 32, paste a dotted subnet mask, or choose a common prefix button.
3. **Read the network boundaries** - Check the network, first and last usable host, broadcast, masks, scope, and address counts.
4. **Copy the report** - Use Copy all results to place the complete subnet summary on your clipboard.

## Who it's for

- **Network engineers** checking VLAN boundaries before assigning gateways and DHCP pools.
- **System administrators** confirming network and broadcast addresses in interface or firewall configuration.
- **Students and certification candidates** checking manual CIDR and subnetting exercises.
- **Developers** validating private network ranges used by containers, virtual machines, and test environments.

## Expert note

For ordinary prefixes through /30, usable hosts equal 2^(32-prefix) minus the network and broadcast addresses. This calculator treats /31 as two point-to-point endpoints under RFC 3021 and /32 as one host route instead of incorrectly reporting zero hosts.

## Frequently asked questions

### Is my IP address or network plan uploaded?

No. The IPv4 parsing, bit masks, range boundaries, and host counts are calculated in your browser. The values you enter are not sent to a subnetting API or saved by this tool, which makes it suitable for checking internal address plans.

### Is this IPv4 subnet calculator free?

Yes. The calculator is free to use without an account, payment, download, or calculation limit. It uses built-in browser arithmetic rather than a paid service, so you can calculate as many IPv4 subnets as you need.

### What is the largest subnet this calculator supports?

It supports every IPv4 prefix from /0 through /32. A /0 contains all 4,294,967,296 IPv4 addresses, while a /32 contains one address. JavaScript represents every count in that range exactly, so no rounding is needed.

### How many usable hosts are in a /24 subnet?

A /24 subnet contains 256 total addresses because eight bits remain for addresses. Under the usual broadcast-network convention, one address identifies the network and one is the broadcast address, leaving 254 usable host addresses.

### How do I convert a subnet mask to CIDR?

Count the consecutive 1 bits in the subnet mask. For example, 255.255.255.0 contains 24 leading 1 bits, so it is /24. You can paste a contiguous dotted mask into this calculator and it will resolve the prefix automatically.

### Why does a /31 subnet show two usable hosts?

RFC 3021 allows both addresses in a /31 block to be endpoints on a point-to-point link. There is no need to reserve separate network and broadcast addresses on that link, so both addresses are usable.

### What is a wildcard mask?

A wildcard mask is the bitwise inverse of the subnet mask. A /24 mask of 255.255.255.0 therefore has a wildcard mask of 0.0.0.255. Wildcard masks commonly appear in access-control and routing configuration.

## Related tools

- [CIDR Range Calculator](https://candoya.com/tools/cidr-range-calculator/)
- [Number Base Converter](https://candoya.com/tools/number-base-converter/)
- [URL Parser](https://candoya.com/tools/url-parser/)
- [Cron Expression Builder](https://candoya.com/tools/cron-expression-builder/)
- [Data Storage Converter](https://candoya.com/tools/data-storage-converter/)

---

*Markdown edition of <https://candoya.com/tools/ipv4-subnet-calculator/>, published for AI agents and other automated readers. Index of key pages: <https://candoya.com/llms.txt>.*
