Calculators & converters

IP to decimal converter

Convert an IP address to a decimal number, hex or binary – or turn a number back into an IP.

Try: · · ·

Why convert an IP address to a number?

Behind the familiar dotted form, an IPv4 address is just a 32-bit number. 192.168.1.1 is 3232235777 in decimal: 192 × 256³ + 168 × 256² + 1 × 256 + 1. Databases often store IP addresses as integers because they are smaller and easy to compare – for example to check whether an address falls inside a range.

IPv6 as a number

An IPv6 address is a 128-bit number, so its decimal form can be up to 39 digits long. The usual hexadecimal form is easier to read, and long runs of zeros are shortened with ::.

Hex, octal and binary forms

Network engineers use binary to see subnet boundaries, and hexadecimal appears in packet captures and IPv4-mapped IPv6 addresses such as ::ffff:c0a8:101. Many browsers and tools even accept the decimal or hex form directly, which is why phishing links sometimes hide an address like http://3232235777/.

Converting a number back to an IP address

To turn a decimal number into dotted form, divide by 16,777,216 (256³) for the first part, divide the remainder by 65,536 (256²) for the second, divide that remainder by 256 for the third, and what is left is the fourth part. For 134,744,072:

134,744,072 ÷ 16,777,216 = 8   remainder 134,744,072 − 134,217,728 = 526,344
    526,344 ÷ 65,536     = 8   remainder 526,344 − 524,288 = 2,056
      2,056 ÷ 256        = 8   remainder 8
→ 8.8.8.8

In hexadecimal each part becomes exactly two digits, which makes conversion easy: 192 = C0, 168 = A8, 1 = 01, so 192.168.1.1 is C0A80101. In binary each part is eight bits: 11000000.10101000.00000001.00000001.

More examples

IP addressDecimalHex
0.0.0.0000000000
8.8.8.8134,744,07208080808
10.0.0.1167,772,1610A000001
127.0.0.12,130,706,4337F000001
255.255.255.2554,294,967,295FFFFFFFF

IP converter – frequently asked questions

Why are there about 4.3 billion IPv4 addresses?

Because an IPv4 address is 32 bits long, and 232 = 4,294,967,296.

Why is a leading zero dangerous in an IP address?

Some software reads parts with a leading zero as octal, so 010.0.0.1 may be interpreted as 8.0.0.1. Avoid leading zeros in dotted addresses.

How big is an IPv6 address as a number?

IPv6 addresses are 128 bits, so the largest is about 3.4 × 1038 – far too big for normal 64-bit integers. Databases store them as 16-byte binary values.

Learn more in our guides