Skip to content
snip tools

IP to binary converter

Convert an IPv4 address to binary, hex and 32-bit integer, and back.

Runs 100% in your browser

How to convert IPs to binary

  1. Paste an IPv4 address. Type a dotted-decimal IP. The binary, hex and integer forms appear instantly.
  2. Or paste an integer. Enter a 32-bit integer to convert back to dotted-decimal.

An IPv4 address is just 32 bits

The familiar dotted-decimal form — 192.168.1.1 — is only a human-friendly skin over a single 32-bit number. Each of the four parts is one octet: eight bits, so a value from 0 to 255, which is why an octet can never be 256 or higher. Seeing the underlying bits is the fastest way to understand subnetting, because the boundary between the network and host portions of an address is invisible in decimal but obvious in binary — it is simply where the mask's 1-bits stop. This tool shows the same address four ways (dotted decimal, dotted binary, hex and a plain integer) and converts in either direction, so you can paste an integer from a database and get the readable address back.

Worked example

Take 192.168.1.1 and convert each octet to 8 bits, then join them:

  • Binary: 11000000.10101000.00000001.00000001
  • Hex: C0.A8.01.01
  • Integer: 3232235777

The integer is those same 32 bits read as one big-endian number: 192 × 256³ + 168 × 256² + 1 × 256 + 1. Notice that the first octet, 192, is 11000000 — its top two bits are set, which is precisely what marks 192.168/16 as a private (RFC 1918) range when you look at the bits rather than the decimal.

Why the integer form matters

Storing an address as its 32-bit integer rather than a string is a standard trick in databases, log indexes and firewalls. A single integer column takes four bytes instead of up to fifteen characters, and — crucially — it makes range queries trivial: "is this address inside this CIDR block?" becomes a plain BETWEEN on two integers, which an ordinary numeric index can answer fast. That is also how a subnet's first and last addresses are computed under the hood: clear the host bits for the network number, set them for the broadcast. The conversion here is pure bit-shifting in your browser, so nothing you enter is sent anywhere. For the full network/broadcast/mask breakdown of a block, use the subnet calculator, or convert between other number bases with the number base converter.

Frequently asked questions

How do I convert an IP address to binary?
Each of the four octets in an IPv4 address is converted to its 8-bit binary representation, then joined with dots. 192.168.1.1 becomes 11000000.10101000.00000001.00000001 — paste any IPv4 address above to see it in binary instantly.
What is the integer form?
An IPv4 address is a 32-bit unsigned integer when read big-endian. 192.168.1.1 is 3,232,235,777. Many DBs and ACLs store IPs as ints.
Does the page send my IP anywhere?
No. Conversion is pure bit shifting in your browser.
Can I paste a 32-bit integer too?
Yes — type an unsigned 32-bit integer (0 – 4294967295) and the dotted-decimal form is shown.