IPv4 to binary, hex and decimal
Enter any IPv4 address and see it as binary (per octet and as one 32-bit string), hexadecimal, and the decimal 32-bit integer that the address represents internally. This is useful for studying subnetting, debugging firewall rules, and understanding how masks line up bit by bit.
How it works
An IPv4 address is four octets, each 0–255. The converter writes each octet as an 8-bit binary number and concatenates them into a 32-bit string, also showing the two-digit hex form per octet. The single decimal integer is computed as:
octet1 × 16,777,216 + octet2 × 65,536 + octet3 × 256 + octet4
(that is, octet1 × 2²⁴ + octet2 × 2¹⁶ + octet3 × 2⁸ + octet4).
Example
For 192.168.1.10:
| Format | Value |
|---|---|
| Per octet binary | 11000000.10101000.00000001.00001010 |
| 32-bit binary | 11000000101010000000000100001010 |
| Hexadecimal | C0A8010A |
| Decimal integer | 3,232,235,786 |
Everything runs in your browser; nothing is uploaded.
Why binary makes subnetting visible
When you look at a subnet mask like 255.255.255.0 in decimal, it tells you
almost nothing about which host bits it covers. Convert it to binary —
11111111.11111111.11111111.00000000 — and the split becomes literal: a
continuous run of 1s marks the network portion, and the trailing 0s mark the
host portion. Aligning an address’s binary with its mask makes it easy to see
which addresses share a network and which don’t, and to verify that a /24
boundary falls exactly where you expect.
Reading the hexadecimal output
Each octet converts to exactly two hex digits (00–FF). This notation is
common in low-level network and kernel code, packet captures (Wireshark displays
IP addresses in hex internally), and some firewall rulesets. For example:
192→C0168→A81→0110→0A
The full address 192.168.1.10 is C0A8010A, which is how it appears in
many C structs and in the raw bytes of an IP packet header.
The decimal integer and why tools use it
Storing IP addresses as 32-bit integers is far more compact than storing the dotted-decimal string. Databases, CDN configurations, and routing tables frequently use integer representation for range comparisons — checking whether an address falls inside a CIDR block is a simple integer comparison once both endpoints and the address are in integer form. Knowing what integer your IP maps to helps you interpret those queries and confirm that your CIDR arithmetic is correct.
Common addresses to try
| Address | Notes |
|---|---|
| 192.168.0.1 | Typical home router default gateway |
| 10.0.0.1 | Common private network gateway (RFC 1918) |
| 172.16.0.1 | Second RFC 1918 private block start |
| 255.255.255.0 | Standard /24 subnet mask in binary |
| 127.0.0.1 | Loopback (localhost) |
| 0.0.0.0 | Unspecified / any-address |