decoder.tools

IP Header & CIDR Decoder

Decode IP headers and expand CIDR notation into full subnet ranges.

INPUT
OUTPUT

The result appears here as you type.

Decoding runs in your browser. What you paste is not sent to a server.

CIDR notation writes an IP network as an address followed by a prefix length (192.168.1.0/24), and a CIDR decoder expands that into the network address, broadcast address, subnet mask and the range of usable host addresses.

Example

Input
10.20.30.0/22
Output
10.20.28.0 – 10.20.31.255
Network: 10.20.28.0
Broadcast: 10.20.31.255
Netmask: 255.255.252.0
Usable hosts: 1,022
Total addresses: 1,024

What is the IP Header & CIDR Decoder?

The prefix length says how many leading bits are the network portion. A /24 fixes the first 24 bits and leaves 8 for hosts: 256 addresses, of which 254 are usable once the network and broadcast addresses are reserved. Each step down doubles the block — a /23 is 512 addresses, a /16 is 65 536.

The two edge cases trip people up regularly. A /31 has no usable hosts under the classic rule but is explicitly allowed for point-to-point links (RFC 3021), and a /32 is a single host — the form you use in firewall rules and route entries.

The IPv4 header itself is 20 bytes before options: version and header length, DSCP/ECN, total length, identification and fragment fields, TTL, protocol number and header checksum, then source and destination addresses. TTL is the field worth reading in a capture — its distance below 64, 128 or 255 tells you roughly how many hops the packet has taken.

How to use the IP Header & CIDR Decoder

  1. Enter a CIDR block such as 10.0.0.0/16, or paste IPv4 header hex.
  2. Read the network and broadcast addresses, mask and usable host range.
  3. Use the host count to check a subnet plan before you commit to it.

When to use it

  • Sizing subnets for a VPC, VLAN or Kubernetes cluster plan.
  • Checking whether two CIDR blocks overlap before peering networks.
  • Turning a firewall rule's CIDR into the explicit address range it covers.

IP Header & CIDR Decoder at a glance

/24256 addresses, 254 usable, mask 255.255.255.0
/1665 536 addresses, mask 255.255.0.0
/31 and /32Point-to-point link · single host
IPv4 header20 bytes minimum; TTL indicates hop count

Frequently asked questions

How many hosts are in a /24?

254 usable. A /24 spans 256 addresses, but the first is the network address and the last is the broadcast address, neither of which can be assigned to a host.

What does the /number in an IP address mean?

The count of leading bits that identify the network. A larger number means a smaller network: /24 gives 256 addresses, /25 gives 128, /30 gives 4.

Can I use a /31 subnet?

Yes, on point-to-point links. RFC 3021 permits both addresses in a /31 to be used as hosts, which saves addresses on router-to-router links where broadcast is meaningless.

What does TTL tell me?

How many hops remain before the packet is discarded. Since common initial values are 64, 128 and 255, the gap between the observed TTL and the next value up is roughly the number of routers it has crossed.

Last reviewed · found a mistake? contact@decoder.tools · view as markdown