IP Address to Decimal Converter

IP Address to Decimal Converter

Emerging AI Skill PRO

Enter Calculation

Results

Decimal (Integer) Value
3,232,235,777
for IP 192.168.1.1
Octet 1 × 256³ 192 × 16,777,216
Octet 2 × 256² 168 × 65,536
Octet 3 × 256 1 × 256
Octet 4 × 1 1 × 1

Formula

Decimal=Octet 1×16777216+Octet 2×65536+Octet 3×256+Octet 4\text{Decimal} = \text{Octet 1} \times 16777216 + \text{Octet 2} \times 65536 + \text{Octet 3} \times 256 + \text{Octet 4}

Example

Decimal=192×16777216+168×65536+1×256+1=3,232,235,777\text{Decimal} = 192 \times 16777216 + 168 \times 65536 + 1 \times 256 + 1 = 3{,}232{,}235{,}777
Usage stats

Advertisement

Report an error on this page

What Is an IP to Decimal Converter?

An IPv4 address such as 192.168.1.1 is written as four numbers (octets) separated by dots, but underneath it is simply a single 32-bit number. This converter takes the four octets and combines them into one decimal integer between 0 and 4,294,967,295. This compact form is useful for databases, geolocation lookups, networking calculations, and sorting addresses numerically.

How to Use It

Enter each of the four octets — every value must be between 0 and 255. Press calculate and the tool returns the single decimal integer that represents the whole address, along with a breakdown of how each octet contributes.

The Formula Explained

Each octet occupies 8 bits, so the address is built by shifting each octet into its position:

$$\text{decimal} = a \times 256^3 + b \times 256^2 + c \times 256 + d$$

This is the same as a base-256 number where the leftmost octet is the most significant. \(256^3 = 16{,}777{,}216\), \(256^2 = 65{,}536\), and \(256^1 = 256\).

Worked Example

For 192.168.1.1: \(192 \times 16{,}777{,}216 = 3{,}221{,}225{,}472\); \(168 \times 65{,}536 = 11{,}010{,}048\); \(1 \times 256 = 256\); \(1 \times 1 = 1\). Adding them gives $$3{,}221{,}225{,}472 + 11{,}010{,}048 + 256 + 1 = \mathbf{3{,}232{,}235{,}777}$$

Advertisement

Common IP Addresses and Their Decimal Values

Each IPv4 address is a 32-bit number. The decimal (integer) form is the same number written in base 10. The table lists well-known addresses.

Address Decimal value Purpose
0.0.0.0 0 "This host" / unspecified address
127.0.0.1 2,130,706,433 Loopback (localhost)
10.0.0.0 167,772,160 Start of the private 10.0.0.0/8 block
172.16.0.0 2,886,729,728 Start of the private 172.16.0.0/12 block
192.168.0.0 3,232,235,520 Start of the private 192.168.0.0/16 block
192.168.1.1 3,232,235,777 Common default router address on home networks
8.8.8.8 134,744,072 Google Public DNS resolver
255.255.255.255 4,294,967,295 Limited broadcast address; the largest IPv4 value (232 − 1)

Private and loopback ranges

RFC 1918 reserves three private IPv4 blocks that are not routed on the public Internet:

Block Decimal range
10.0.0.0/8 (10.0.0.0 – 10.255.255.255) 167,772,160 – 184,549,375
172.16.0.0/12 (172.16.0.0 – 172.31.255.255) 2,886,729,728 – 2,887,778,303
192.168.0.0/16 (192.168.0.0 – 192.168.255.255) 3,232,235,520 – 3,232,301,055

The loopback block 127.0.0.0/8 (127.0.0.0 – 127.255.255.255, decimal 2,130,706,432 – 2,147,483,647) is reserved for the local host, as specified in RFC 1122. A range check on the decimal value is a simple way to test whether an address falls inside one of these blocks.

How to Convert an IP to Decimal by Hand

  1. Split the address a.b.c.d into its four octets: a, b, c, d.
  2. Validate that each octet is an integer from 0 to 255. Anything outside that range is not a valid IPv4 octet.
  3. Multiply each octet by its positional weight: a × 2563 (16,777,216), b × 2562 (65,536), c × 256, and d × 1. Equivalently, use bit shifts: a << 24, b << 16, c << 8, d.
  4. Sum the four products.

$$\text{Decimal} = a \times 16777216 + b \times 65536 + c \times 256 + d$$

Worked example: 192.168.1.1

\(192 \times 16777216 = 3{,}221{,}225{,}472\)
\(168 \times 65536 = 11{,}010{,}048\)
\(1 \times 256 = 256\)
\(1 \times 1 = 1\)

Sum: 3,221,225,472 + 11,010,048 + 256 + 1 = 3,232,235,777.

Horner shortcut

You can avoid large powers by nesting the multiplications:

$$\text{Decimal} = ((a \times 256 + b) \times 256 + c) \times 256 + d$$

For 192.168.1.1: 192 × 256 + 168 = 49,320; 49,320 × 256 + 1 = 12,625,921; 12,625,921 × 256 + 1 = 3,232,235,777.

Reversing the conversion

To turn an integer N back into dotted decimal, use integer division and modulo by 256:

  • d = N mod 256
  • c = ⌊N / 256⌋ mod 256
  • b = ⌊N / 65536⌋ mod 256
  • a = ⌊N / 16777216⌋

For N = 3,232,235,777: d = 1, c = 1, b = 168, a = 192, which gives 192.168.1.1.

Advertisement

Key Terms: Octet, Bit, and Byte Order

  • Octet: a group of 8 bits, with values from 0 to 255. An IPv4 address has four octets.
  • IPv4: version 4 of the Internet Protocol, which uses 32-bit addresses (about 4.29 billion possible values).
  • 32-bit unsigned integer: a number from 0 to 4,294,967,295. Every IPv4 address maps to exactly one such value. Values above 2,147,483,647 overflow a signed 32-bit integer and turn negative, so use an unsigned 32-bit type or a 64-bit type to store them.
  • Most significant octet: the first (leftmost) octet, a. It carries the largest weight, 2563 = 16,777,216.
  • Big-endian / network byte order: the convention of sending the most significant byte first, which the formula above follows. Little-endian systems (such as x86 CPUs) store the bytes of an integer in reverse order in memory. When you read raw address bytes into an integer on such a machine, convert byte order (for example with ntohl/htonl) or the result will be reversed.
  • Dotted-decimal notation: the human-readable form a.b.c.d, in which each octet is written in decimal and separated by dots.
  • CIDR / subnet: Classless Inter-Domain Routing writes a network as an address plus a prefix length, such as 192.168.0.0/16. The prefix gives the number of leading bits that identify the network. A /16 block contains 216 = 65,536 consecutive decimal values, and a /8 block contains 16,777,216.

FAQ

What is the maximum value? The largest IPv4 address 255.255.255.255 equals 4,294,967,295 (\(2^{32} - 1\)).

Does this work for IPv6? No — IPv6 uses 128 bits and a different format. This tool covers IPv4 only.

Is the octet order important? Yes. The first octet is the most significant; swapping octets changes the result entirely.

Last updated:

Most popular in Digital Life

View all Digital Life calculators