logic.codes

IPv4 Subnet Calculator (CIDR)

What are the network, broadcast, host range and mask for this CIDR block?

Single calculationv1.0.0Verified 2026-11-01Runs in your browser

Spec sheet

ipv4_cidr · v1.0.0
Method

Bitwise IPv4 subnetting

  1. 01mask = 2³² − 2^(32−prefix)
  2. 02network = ip AND mask; broadcast = network + 2^(32−prefix) − 1
  3. 03usable hosts = 2^(32−prefix) − 2 (all addresses for /31 and /32)
Limits — read before relying on it
  • IPv4 only.
Sources

Worked example

computed by the same formula

192.168.1.10/24

Inputs
IPv4 address / prefix
192.168.1.10/24
Result
Network address
192.168.1.0
Broadcast address
192.168.1.255
First usable host
192.168.1.1
Last usable host
192.168.1.254
Usable hosts
254
Subnet mask
255.255.255.0
Wildcard mask
0.0.0.255

Questions

How is the ipv4 subnet calculator calculated?

›

Bitwise IPv4 subnetting. mask = 2³² − 2^(32−prefix) · network = ip AND mask; broadcast = network + 2^(32−prefix) − 1 · usable hosts = 2^(32−prefix) − 2 (all addresses for /31 and /32)

Example: 192.168.1.10/24?

›

Network address: 192.168.1.0; broadcast address: 192.168.1.255.

What does this calculator not cover?

›

IPv4 only.

Where do the numbers come from?

›

Sources: RFC 4632 — Classless Inter-domain Routing (CIDR); RFC 3021 — 31-bit prefixes on point-to-point links. The formula is versioned (ipv4_cidr v1.0.0) and covered by automated tests.

Is my data stored?

›

No. The calculation runs in your browser and nothing is sent unless you choose to save a shareable link.

Also searched assubnet calculator · cidr calculator · ip subnet mask · how many hosts in a /24 · network and broadcast address

Related

More development calculators