Network Calculator

subnets, CIDR, and bits without the math

Printable reference sheets Subnet cheat sheet, port lists, and more — designed for letter paper.

Converting between decimal, hexadecimal, and binary

Networking lives in three number bases at once. Humans read IP addresses in decimal, masks and subnet boundaries make sense only in binary, and MAC addresses, IPv6, and many protocol fields are written in hexadecimal. Being able to move a value between the three quickly is a core skill — and the conversions are mechanical once you see how the bases line up.

Hexadecimal is the convenient middle ground because one hex digit maps to exactly four binary bits. The decimal value 255 is 0xFF in hex and 11111111 in binary — eight 1-bits, which is why 255 is the maximum value of a single octet and why a full mask octet reads as FF. Each hex digit (0–F) covers a nibble: F is 1111, A is 1010, 8 is 1000. Splitting a byte into two hex digits and expanding each to four bits is faster than converting the whole byte at once.

This matters concretely when you're reading a subnet mask in binary to find a boundary, or decoding a hex-dumped packet, or expanding an IPv6 group. A mask octet of 192 is 0xC0 is 11000000 — the two leading 1-bits that turn a /24 into a /26. Seeing that 192 = 11000000 immediately tells you it contributes two network bits to the octet, which is the whole game when you're subnetting in your head.

The converter is fully three-way and live: type into any of the decimal, hex, or binary fields and the other two update as you go, without jumping your cursor. It accepts the natural prefixes — 0x for hex, 0b for binary — and ignores underscores, spaces, and commas so you can paste a grouped value. Values are treated as unsigned non-negative integers, which is what every networking field you'll convert actually is.

Worked example

You see the mask octet 192 and want to know how many network bits it sets.

  1. 192 in decimal → 0xC0 in hex
  2. 0xC0 → 1100 0000 in binary (C = 1100, 0 = 0000)
  3. Count the leading 1-bits: two

→ 192 = 0xC0 = 11000000, two leading 1-bits — the extra two network bits that make a /24 into a /26.