Skip to content
gohacks.dev
DevOps

IP Address Converter

Convert an IPv4 address between dotted, 32-bit integer, hex and binary forms, see its IPv4-mapped IPv6 and reverse DNS names, and whether it is private.

Free · No sign-up · Your inputs stay in your browser

Input

Convert an IPv4 address between formats

Output

192.168.1.1

Dotted192.168.1.1
Integer3232235777
Hex0xC0A80101
Binary11000000.10101000.00000001.00000001
IPv4-mapped IPv6::ffff:192.168.1.1
Reverse DNS1.1.168.192.in-addr.arpa
TypePrivate (RFC 1918)

MySQL's INET_ATON() and INET_NTOA() convert between the dotted form and an unsigned integer, and an INT UNSIGNED column holds one in 4 bytes instead of up to 15 as text. For mixed v4 and v6, INET6_ATON() into VARBINARY(16), or PostgreSQL's inet type.

Runs in this browser. Nothing you paste is sent to a server.

Storing IPs as integers

An IPv4 address is a 32-bit number, so it fits in an INT UNSIGNED column in four bytes. MySQL's INET_ATON() and INET_NTOA() convert, and range checks become integer comparisons that use an index. For mixed IPv4 and IPv6, MySQL's INET6_ATON() into VARBINARY(16) or PostgreSQL's inet type handle both.

Private and special ranges

10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 are private (RFC 1918), 100.64.0.0/10 is carrier-grade NAT, and 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are reserved for documentation, which is why examples use them.

Share

Frequently asked questions

What is 192.168.1.1 as an integer?
3232235777: 192 x 256^3 + 168 x 256^2 + 1 x 256 + 1.
What is an IPv4-mapped IPv6 address?
::ffff: followed by the IPv4 address. A dual-stack server listening on IPv6 sees IPv4 clients this way, so logs may show ::ffff:203.0.113.5.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools