Skip to main content
IP Range CalculatorPRO
IPv4 Subnetting & RangeInstant Client-Side Tool

Network and Host ID Calculator

Separate prefix and host portions.

Network and Host ID Calculator: inputs and results

Enter an IP address, CIDR prefix, or range. Then check its first and last address below.

Quick presets:

Calculated Boundaries & ParametersReady

Network Address192.168.1.0
Broadcast Address192.168.1.255
First Usable Host192.168.1.1
Last Usable Host192.168.1.254
Subnet Mask255.255.255.0
Wildcard Mask0.0.0.255
Total Addresses256
Usable Host Range254

How Network and Host ID Calculator Works?

This tool works by splitting the 32 address bits at the prefix boundary: the left part is the network ID and the right part is the host ID.

  1. Enter address and prefix

    Type 10.45.200.17/20.

  2. Extract the network ID

    address AND mask gives 10.45.192.0.

  3. Extract the host ID

    address AND wildcard gives 0.0.8.17.

  4. Convert the host ID to a number

    The host ID 0.0.8.17 equals 8 × 256 + 17 = host number 2,065 inside the subnet.

Network and Host ID Calculator Formula

The formula is Network ID = IP AND Mask, and Host ID = IP AND Wildcard. Adding both values back together returns the original address.

Network ID

NID = IP AND Mask

Left p bits.

Host ID

HID = IP AND (NOT Mask)

Right 32 − p bits.

Rebuild rule

IP = NID + HID

The 2 parts never overlap, so plain addition works.

Host number

n = int(HID)

The position of the host inside the subnet, starting at 0.

Worked example: 10.45.200.17/20

Mask       = 255.255.240.0     Wildcard = 0.0.15.255
200        = 1100 1000 → network part 1100 = 192, host part 1000 = 8
Network ID = 10.45.192.0
Host ID    = 0.0.8.17
Host no.   = 8 × 256 + 17 = 2,065

Network and Host ID Calculator Conversion Table

The table splits 10.45.200.17 into its network ID and host ID at 12 prefix lengths.

PrefixNetwork IDHost IDHost Number
/810.0.0.00.45.200.173,000,337
/1210.32.0.00.13.200.17903,185
/1610.45.0.00.0.200.1751,217
/1810.45.192.00.0.8.172,065
/2010.45.192.00.0.8.172,065
/2110.45.200.00.0.0.1717
/2210.45.200.00.0.0.1717
/2310.45.200.00.0.0.1717
/2410.45.200.00.0.0.1717
/2610.45.200.00.0.0.1717
/2810.45.200.160.0.0.11
/3010.45.200.160.0.0.11

What is Network and Host ID Calculator?

The Network and Host ID Calculator is a tool that separates an IPv4 address into the network ID, which names the subnet, and the host ID, which names the device inside that subnet.

Every IPv4 address carries both IDs. The prefix length decides where the split falls. At /24, the address 10.45.200.17 has the network ID 10.45.200.0 and host ID 17. At /16, the same address has the network ID 10.45.0.0 and host ID 51,217.

The host ID shows the position of a device inside its subnet. That position helps with addressing conventions, such as reserving host IDs 1 to 10 for gateways and network appliances.

What are the uses of Network and Host ID Calculator?

There are 4 main uses of the Network and Host ID Calculator, including addressing conventions, subnet teaching, and inventory mapping.

  • Applying addressing conventions

    Policies such as "gateways use host ID 1" are checked by reading the host ID of each gateway.

  • Teaching the address structure

    Students see the same address produce different network and host IDs as the prefix changes.

  • Mapping devices to subnets

    Inventory tools use the network ID to place each device in its subnet record.

  • Translating between subnets

    Renumbering projects keep the host ID and replace the network ID, so 10.1.1.25 moves to 10.2.1.25.