About the IP Address Converter
This IP address converter translates an IPv4 address between every common notation: dotted decimal (192.168.1.1), a single 32-bit integer (3232235777), hexadecimal (0xC0A80101) and binary, both as one 32-bit string and split into four octets. It detects the input format automatically, so you can paste whatever your database, firewall log or packet capture shows.
Network engineers use it to read addresses stored as integers in MySQL (INET_ATON) or geo-IP databases, to work out subnet masks bit by bit, and to write firewall or ACL rules; developers use it to debug socket code and in-addr.arpa PTR records. Alongside the conversions you get the reverse DNS name, the IPv4-mapped IPv6 form, the historical address class and the address type — private, loopback, link-local, carrier-grade NAT, documentation, multicast or public — based on the IANA special-purpose address registry.
An IPv4 address is simply a 32-bit unsigned number, so each format is a different way to write the same value. Only IPv4 is supported here; leading zeros in dotted input are read as decimal.
How to use the ip address converter
- 1Paste an IPv4 address in dotted, integer, hex or binary form.
- 2Leave the input format on auto, or choose it if detection guesses wrong.
- 3Copy the notation you need from the results.
- 4Check the address type to see whether it is private or public.
Formula and method
An IPv4 address is a 32-bit unsigned number written as four 8-bit octets a.b.c.d. Multiplying each octet by its place value (16,777,216, 65,536, 256 and 1) and adding gives the integer form; dividing the integer by the same place values (or shifting right by 24, 16, 8 and 0 bits and masking with 255) recovers the octets.
Hexadecimal writes the same 32 bits as eight hex digits, two per octet, and binary as 32 bits, eight per octet. The reverse DNS name lists the octets backwards under in-addr.arpa, and the IPv4-mapped IPv6 address (RFC 4291) places the 32 bits after ::ffff:. The address type is matched against the IANA IPv4 Special-Purpose Address Registry; classes A–E follow the original first-octet ranges, which modern CIDR routing no longer uses.
- a, b, c, d
- The four octets, each 0–255
- 256
- Each octet holds 8 bits, so place values are powers of 2⁸
Worked examples
Home router address 192.168.1.1
192 × 16,777,216 + 168 × 65,536 + 1 × 256 + 1 = 3,232,235,777. In hex the octets are C0 A8 01 01. The address sits in the 192.168.0.0/16 private range, and its first octet (192) puts it in old class C.
Integer from a database back to dotted form
134,744,072 ÷ 16,777,216 = 8 remainder 526,344; 526,344 ÷ 65,536 = 8 remainder 2,056; 2,056 ÷ 256 = 8 remainder 8. So the stored integer is 8.8.8.8, Google’s public DNS resolver.
Hexadecimal loopback
The hex digits split into 7F 00 00 01 = 127.0.0.1, the loopback address that always refers to the local machine. As an integer it is 2,130,706,433.
Binary octets
00001010 = 10 and 11111111 = 255, giving 10.0.0.255 — a private address in 10.0.0.0/8. The integer is 10 × 16,777,216 + 255 = 167,772,415.
Frequently asked questions
How do I convert an IP address to a decimal number?+
Multiply the first octet by 16,777,216, the second by 65,536, the third by 256 and add the fourth. For 10.0.0.1 that is 167,772,160 + 1 = 167,772,161. MySQL’s INET_ATON() and Python’s int(ipaddress.ip_address("10.0.0.1")) do the same.
Why are IP addresses stored as integers?+
A 32-bit integer takes 4 bytes instead of up to 15 characters, sorts numerically, and makes range checks fast — "is this IP in 10.0.0.0/8?" becomes a simple BETWEEN query. Geo-IP databases and firewall tables commonly store addresses this way.
Which IP addresses are private?+
RFC 1918 reserves 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0–172.31.255.255) and 192.168.0.0/16 for private networks. They are not routed on the public internet. 100.64.0.0/10 is shared space for carrier-grade NAT, and 169.254.0.0/16 is link-local.
What are IP address classes A, B and C?+
Before CIDR (1993), the first octet set the network size: class A 0–127 (/8 networks), B 128–191 (/16), C 192–223 (/24), D 224–239 for multicast and E 240–255 reserved. Classes are obsolete for routing but still used informally.
What is an IPv4-mapped IPv6 address?+
It is the 128-bit IPv6 representation of an IPv4 address, written ::ffff: followed by the 32 IPv4 bits, e.g. ::ffff:c0a8:101 or ::ffff:192.168.1.1. Dual-stack sockets use it to represent IPv4 clients, as defined in RFC 4291.