An IP address converter changes an IPv4 address between its dotted-decimal form, such as 172.16.254.1, its single 32-bit number, its hexadecimal value and its binary form. Paste an address in any of these forms and you see all of them, along with the kind of address it is: private, loopback, link-local, multicast, documentation or ordinary public space. It is handy for networking, firewall rules, databases that store addresses as numbers, and for learning how addressing works. It runs in your browser.
How to use the IP address converter
- Type or paste an IPv4 address in any form.
- Press Convert.
- Read the dotted, whole-number, hex and binary forms, and the kind of address.
What an IPv4 address is
The Wikipedia article on IPv4 says that the protocol uses 32-bit addresses, which gives 4,294,967,296 (2³²) unique addresses. An address may be written in any notation that expresses a 32-bit integer value, and the usual one is dot-decimal, with the four octets written individually in decimal, without extra leading zeros, and separated by periods.[1] The calculator accepts that form, and the others as well. The largest value is 4,294,967,295, which is 255.255.255.255.
From dotted decimal to a number
An address is four bytes, and the whole number is those bytes read as one value: first octet × 256³ + second × 256² + third × 256 + fourth. The page gives the example 172.16.254.1, which is the 32-bit decimal number 2886794753, or 0xAC10FE01 in hex.[1] Check this: 172 × 16,777,216 + 16 × 65,536 + 254 × 256 + 1 = 2,886,794,753. The hex value is the four bytes AC, 10, FE and 01 written one after another. The calculator gives the binary form as four groups of eight bits, here 10101100.00010000.11111110.00000001.
From other forms back to dotted decimal
You can type the whole number, such as 2886794753, the hex value 0xAC10FE01, or the 32 binary digits, with or without dots or spaces between the bytes, and the calculator gives the dotted address 172.16.254.1 for each of them. A value that is over 4,294,967,295, or an octet that is over 255, is refused. Some old programs also accept short forms, such as 127.1 for 127.0.0.1. The page mentions that form, but the converter asks for the full address.[1]
Private and special addresses
The article has a table of special address blocks. The private networks are 10.0.0.0/8, with 16,777,216 addresses, 172.16.0.0/12, with 1,048,576, and 192.168.0.0/16, with 65,536. Together they are about 18 million addresses for use in local networks.[1] Other blocks are 127.0.0.0/8 for loopback, which is localhost, 169.254.0.0/16 for link-local addresses, 100.64.0.0/10 for carrier-grade NAT, 224.0.0.0/4 for multicast, 240.0.0.0/4 reserved for future use, 0.0.0.0/8 for the current network, and 255.255.255.255 for limited broadcast.[1] The page also lists the blocks for documentation: 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24, and 198.18.0.0/15 for benchmark testing.[1] The converter names the block that your address falls into, with its size.
How to read a CIDR block
In a block such as 172.16.0.0/12, the number after the slash is the length of the fixed prefix in bits. The remaining bits can take any value, so the block has 2 to the power of (32 − 12) addresses, which is 1,048,576. That is why the private block 172.16.0.0/12 runs from 172.16.0.0 to 172.31.255.255. The converter shows the size in the result, using the figures from the page's table. For an address that falls in more than one block, the smaller block is named, so 233.252.0.5 shows the multicast test network, not just multicast.
Public addresses
An address that does not fall in any of these blocks is shown as public. The converter does not know who holds it, whether it is routable today or where it is. For that you need a registry or a lookup service. The tool also does not handle IPv6, which has 128-bit addresses and its own notation.
Ranges as whole numbers
Storing addresses as whole numbers makes ranges easy to handle in a database. A block is simply a run of consecutive numbers. The block 192.168.1.0/24 runs from 3,232,235,776 to 3,232,236,031, which is 192.168.1.0 to 192.168.1.255, so a test of whether an address belongs to it is two comparisons. Sorting the numbers also sorts the addresses in the right order, which a sort of the dotted text does not do, because it puts 10.0.0.2 after 10.0.0.10. These figures are our own arithmetic.
Where you meet each form
Dotted decimal is what people read and type. The whole number is how many databases, log tools and some programming interfaces store the address. Hex shows up in packet dumps and in some configuration files, and the binary form shows the bits that a subnet mask works on. Seeing the four side by side is a quick way to read a value from any of these places.
Checking an address
Before you use an address in a rule, convert it and look at the kind. If a server that you expect to be reachable from the internet shows as private, it is behind a router and needs a forwarding rule. If an address from your logs shows as link-local, the machine probably failed to get one from a server. A loopback result means that the traffic never left the machine. These readings follow from what the blocks are for.
Common mistakes
- Leading zeros. Some tools read 010 as octal. Write 10.
- Octets over 255. Each octet is one byte.
- Mixing up the byte order. The first octet is the most significant.
- Treating public as in use. It only means not in a special block.
What next
Use this often? Add IP Address to your Home screen.
Frequently asked questions
What is an IP address converter?
A tool that changes an IPv4 address between dotted decimal, a 32-bit whole number, hexadecimal and binary.
How do I convert an IP address to a number?
Read the four octets as one number: a × 256³ + b × 256² + c × 256 + d. 172.16.254.1 is 2886794753.
What is 172.16.254.1 in hex?
0xAC10FE01, which is the four bytes AC, 10, FE and 01.
Which IP addresses are private?
10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16.
How many IPv4 addresses are there?
4,294,967,296, which is 2³².
Sources
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.