Skip to content
Plaintools

Subnet calculator

Enter an IPv4 address and CIDR prefix length (or standard subnet mask) to calculate network boundaries, broadcast addresses, usable host ranges, and wildcard masks. Includes bit breakdown and quick prefix reference. All math runs entirely in this browser tab without network requests.

Runs locally in your browser · No network requests

Presets:

Supports standard IPv4 or CIDR format like 10.0.0.1/24

/

/24 (255.255.255.0)

Quick Prefix Slider:/24 (255.255.255.0)
/0 (Internet)/8 (Class A)/16 (Class B)/24 (Class C)/32 (Host)

Calculation Results

Network Address

192.168.1.0

/24

Subnet Mask

255.255.255.0

Wildcard: 0.0.0.255

Usable Hosts

254

Total: 256

Broadcast Address

192.168.1.255

Scope: Private

Network & Addressing Specification

Usable Host Range
192.168.1.1 – 192.168.1.254
First Usable Host
192.168.1.1
Last Usable Host
192.168.1.254
CIDR Notation
192.168.1.0/24
IP Classification
Class C · Private (RFC 1918)
Hex Representation
IP: 0xc0a80132 · Mask: 0xffffff00

Binary Bit Breakdown

IP Address:11000000.10101000.00000001.00110010
Subnet Mask:11111111.11111111.11111111.00000000
Network ID:11000000.10101000.00000001.00000000
Broadcast:11000000.10101000.00000001.11111111

Subnet mask has 24 network bits and 8 host bits.

Common IPv4 CIDR Reference Table

CIDRSubnet MaskUsable HostsCommon UsageAction
/8255.0.0.016,777,214Class A (/8)
/16255.255.0.065,534Class B (/16)
/20255.255.240.04,094Large Office (/20)
/22255.255.252.01,022Medium Office (/22)
/24255.255.255.0254Class C / Standard LAN (/24)
/25255.255.255.128126Half Subnet (/25)
/26255.255.255.19262Quarter Subnet (/26)
/27255.255.255.2243032-IP Block (/27)
/28255.255.255.2401416-IP Block (/28)
/29255.255.255.2486Small Subnet (/29)
/30255.255.255.2522Legacy Point-to-Point (/30)
/31255.255.255.2542Modern Point-to-Point (/31)
/32255.255.255.2551Host Route (/32)

Example

Standard Class C LAN (/24)

192.168.1.50/24 produces network address 192.168.1.0, netmask 255.255.255.0, broadcast 192.168.1.255, usable host range 192.168.1.1 through 192.168.1.254, and 254 usable hosts.

Related: JWT decoder, Hash generator, Timestamp converter, CIDR calculator

FAQ

Does this subnet calculator send my IP addresses to a server?
No. All IP parsing and subnet bitwise arithmetic execute locally in JavaScript inside your browser. No IP addresses, subnets, or network topologies are ever transmitted or logged.
What is CIDR notation?
Classless Inter-Domain Routing (CIDR) notation expresses an IP address and its associated routing prefix length using a forward slash followed by the count of leading 1 bits in the subnet mask (e.g. /24 equals 255.255.255.0).
How are usable host addresses determined?
For standard subnets (/0 to /30), the first address is the Network Address and the last address is the Broadcast Address, leaving 2^(32 - prefix) - 2 usable host addresses. For point-to-point links (/31 under RFC 3021), both addresses are usable hosts. For /32 host routes, 1 host is addressable.
What is a wildcard mask?
A wildcard mask is the bitwise inverse of a subnet mask (255.255.255.255 - subnet mask). It is commonly used in Cisco IOS Access Control Lists (ACLs) and Open Shortest Path First (OSPF) network configurations.
How do I calculate an IPv4 subnet without this page?
Convert the 4 octets to a 32-bit integer: ipInt = (o1 << 24) | (o2 << 16) | (o3 << 8) | o4. For prefix n (0..32), maskInt = n === 0 ? 0 : (0xffffffff << (32 - n)) >>> 0. Wildcard mask = (~maskInt) >>> 0. Network address = (ipInt & maskInt) >>> 0. Broadcast address = (networkInt | wildcardInt) >>> 0. Total hosts = 2^(32 - n). Usable hosts = n === 32 ? 1 : n === 31 ? 2 : Math.max(0, totalHosts - 2). First usable = networkInt + 1; last usable = broadcastInt - 1. Format each 32-bit int as octets: (int >>> 24) & 255, (int >>> 16) & 255, (int >>> 8) & 255, int & 255.