Subnet Calculator

Enter an IPv4 or IPv6 CIDR to calculate the network address, broadcast address, prefix length, and host range. This tool mirrors the behavior of the HeffTools subnet API.

Supports IPv4 and IPv6 CIDR notation, for example: 10.0.0.0/16, 172.16.1.0/24, 2001:db8::/64.
Result
Raw JSON


      
        Backed by POST /api/v1/subnet/calc
      
    

What Is a Subnet and CIDR?

A subnet is a logical segment of an IP network. CIDR (Classless Inter-Domain Routing) notation specifies an IP address and its associated network prefix, written as address/prefix_length (for example, 192.168.1.0/24).

The prefix length indicates how many bits are used for the network portion. The remaining bits are available for host addresses inside that subnet.

Key Fields Explained

  • Network address – the first address in the subnet; identifies the network itself.
  • Broadcast address (IPv4) – the last address in the subnet; used to send to all hosts.
  • Prefix length – number of bits that define the network (for example, /24).
  • Number of addresses – total number of IP addresses in the subnet.
  • First usable – first host address typically assigned to devices.
  • Last usable – last host address typically assigned to devices.

For IPv6 subnets, broadcast addresses may not apply and some fields may be left blank.

Example CIDR Subnets

  • 192.168.1.0/24 – 256 addresses, typical home/office LAN segment.
  • 10.0.0.0/16 – 65,536 addresses, often used for private internal networks.
  • 172.16.0.0/20 – 4,096 addresses for mid-sized subnets.
  • 2001:db8::/64 – standard IPv6 subnet size for most networks.

API Usage

This subnet calculator uses the same JSON API you can call from scripts and infrastructure tooling:

POST /api/v1/subnet/calc
Content-Type: application/json

{
  "cidr": "192.168.1.0/24"
}

Example response:

{
  "broadcast_address":"192.168.1.255",
  "cidr":"192.168.1.0/24",
  "first_usable":"192.168.1.1",
  "last_usable":"192.168.1.254",
  "network_address":"192.168.1.0",
  "num_addresses":256,
  "prefix_length":24
}

Related Tools

Cron Expression Tester · Regex Tester · JSON / YAML / CSV Converter