Saved

Utilix knowledge base

IPv4 Address Formats: Decimal, Binary & Hex

Published Jun 1, 2026

IPv4 Address Formats Explained

An IPv4 address is a 32-bit number. Humans usually write it as four decimal octets separated by dots — but the same value appears in binary, hexadecimal, and integer form throughout networking tools, databases, and APIs.

Understanding all four formats helps when reading packet captures, debugging configs, or working with systems that store IPs as numbers.

Dotted decimal (standard notation)

The everyday format — four numbers from 0 to 255:

192.168.1.1
10.0.0.1
255.255.255.0

Each octet is one byte (8 bits). Four octets × 8 bits = 32 bits total.

This is what you type into browser address bars (for public IPs), router configs, and firewall rules.

Binary representation

Each octet converts to 8 binary digits:

192.168.1.1

192 → 11000000
168 → 10101000
  1 → 00000001
  1 → 00000001

Full 32-bit: 11000000 10101000 00000001 00000001
Dotted:      11000000.10101000.00000001.00000001

Binary is essential for subnet math — the boundary between network and host bits is clearest in binary. When you apply a /24 mask, the first 24 bits are network bits and the last 8 are host bits.

Use the IP Address Converter to convert any format instantly.

Hexadecimal representation

Each octet as two hex digits (00–FF):

192.168.1.1  →  C0.A8.01.01
255.255.255.0 → FF.FF.FF.00
127.0.0.1    →  7F.00.00.01

Hex is compact and appears in:

  • Packet capture tools (Wireshark hex dumps)
  • Memory dumps and low-level debugging
  • Some router and switch CLI outputs
  • Color-adjacent protocols (though unrelated to IP routing)

Continuous form without dots: C0A80101 (same as C0.A8.01.01).

32-bit unsigned integer

The entire address as a single decimal number from 0 to 4 294 967 295:

192.168.1.1  →  3 232 235 777
127.0.0.1    →  2 130 706 433
10.0.0.1     →  167 772 161

How the conversion works

Each octet is multiplied by a power of 256 (right to left):

192.168.1.1
= 192 × 256³ + 168 × 256² + 1 × 256¹ + 1 × 256⁰
= 192 × 16 777 216 + 168 × 65 536 + 256 + 1
= 3 221 225 472 + 11 010 304 + 256 + 1
= 3 232 235 777

Where integer IPs appear

  • MySQL INET_ATON() / INET_NTOA() functions
  • PostgreSQL inet type internal storage
  • GeoIP databases (MaxMind and similar)
  • Analytics pipelines that sort or range-query IPs numerically
  • Programming languagesipaddress modules often expose .int() or packed binary

Comparing 192.168.1.100 vs 192.168.2.1 as strings is tricky; as integers (3232235620 vs 3232236033) a simple < comparison works.

Converting between formats

FromToMethod
DecimalBinaryConvert each octet to 8 bits
DecimalHexConvert each octet to 2 hex digits
DecimalIntegerSum of octet × 256^position
IntegerDecimalDivide by powers of 256
BinaryDecimalParse 32 bits, split into octets
HexDecimalParse hex pairs into octets

The IP Address Converter handles all directions automatically.

Relationship to subnet masks

Subnet masks use the same four formats:

/24 subnet mask:
  Decimal:  255.255.255.0
  Binary:   11111111.11111111.11111111.00000000
  Hex:      FF.FF.FF.00
  Integer:  4 294 967 040

The Subnet / CIDR Calculator shows mask and wildcard in dotted decimal; use the IP converter for binary and hex views.

Private vs public addresses

Format is identical — the value range determines whether an address is private (RFC 1918) or public:

RangeCIDRType
10.0.0.0 – 10.255.255.25510.0.0.0/8Private
172.16.0.0 – 172.31.255.255172.16.0.0/12Private
192.168.0.0 – 192.168.255.255192.168.0.0/16Private
All other valid unicastPublic (routable)

Common pitfalls

Leading zeros in octets. Some systems reject 192.168.001.001 (octal interpretation risk). Always use 192.168.1.1.

Signed vs unsigned integers. JavaScript and some languages treat large integers as signed — 3232235777 may appear negative. Use unsigned 32-bit operations.

String sorting. Sorting IPs alphabetically puts 192.168.1.100 before 192.168.1.20. Sort as integers or zero-pad octets.

Related tools and guides