IP Address Converter
Convert an IPv4 address between dotted decimal, its 32-bit integer value, binary and hexadecimal. Paste any notation and the rest are derived.
Your data never leaves your browser. This tool runs entirely on your device.
Read as dotted decimal.
- Dotted decimal
- 192.168.1.10the usual notation
- 32-bit integer
- 3232235786databases, ip2long()
- Binary
- 11000000.10101000.00000001.00001010
- Hexadecimal
- 0xC0A8010A
- Dotted hexadecimal
- C0.A8.01.0A
- IPv4-mapped IPv6
- ::ffff:c0a8:10adual-stack sockets
- Reverse DNS name
- 10.1.168.192.in-addr.arpa
- Address type
- Private · Class C192.168.0.0/16 · RFC 1918
An IP address is one 32-bit number
Dotted decimal is a display convention, not the address itself. 192.168.1.10 is a single 32-bit value split into four bytes and printed in decimal with dots between them; the same value is 3232235786 as an integer and 0xC0A8010A in hexadecimal.
Each octet contributes its own place value, exactly as digits do in ordinary decimal — just in base 256 rather than base 10.
(192 × 256³) + (168 × 256²) + (1 × 256) + 10 = 3,232,235,786
Where each notation turns up
The integer form is what databases store when a column is an INT rather than a string: MySQL's INET_ATON, PostgreSQL's casts and PHP's ip2long all produce it. Comparing integers makes range queries — "is this address inside this block" — a simple BETWEEN.
Hexadecimal shows up in packet dumps, kernel structures and files such as /proc/net/tcp, where the address is printed as raw bytes. Binary is where subnetting actually happens: masking, network and broadcast addresses are all bit operations, and they only look obvious once the address is written out in bits.
- Dotted decimal — configuration, documentation, anything a human reads.
- 32-bit integer — database columns, range comparisons, ip2long/INET_ATON.
- Hexadecimal — packet captures, /proc/net files, low-level debugging.
- Binary — working out masks, network addresses and subnet boundaries.
Watch the leading zeros
Writing an octet with a leading zero is ambiguous and genuinely dangerous. Historic inet_aton reads 010 as octal 8, while most modern languages read it as decimal 10 — so 192.168.010.1 can mean two different addresses depending on which library parses it. Several access-control bypasses have come from exactly that disagreement.
This converter rejects leading zeros rather than guessing. Write octets without padding, and never rely on a parser agreeing with the one on the other side of the wire.
Worked conversions
| Dotted decimal | 32-bit integer |
|---|---|
| 0.0.0.0 | 0 |
| 10.0.0.1 | 167772161 |
| 127.0.0.1 | 2130706433 |
| 172.16.0.1 | 2886729729 |
| 192.168.1.1 | 3232235777 |
| 192.168.1.10 | 3232235786 |
| 255.255.255.0 | 4294967040 |
| 255.255.255.255 | 4294967295 |
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 192.168.1.10 that gives 3,232,235,786 — the same value as MySQL's INET_ATON returns.
Why store an IP address as an integer?
It takes four bytes instead of up to fifteen, indexes efficiently, and turns "does this address fall in this range" into a numeric comparison rather than string parsing. The trade-off is that the raw column is unreadable.
What is the largest possible IPv4 address as a number?
4,294,967,295 — that is 2³² − 1, which is 255.255.255.255. It is also why IPv4 has roughly 4.3 billion addresses in total, before any reservations are subtracted.
What does ::ffff:c0a8:10a mean?
It is the IPv4-mapped IPv6 form of 192.168.1.10. A dual-stack socket reports IPv4 peers this way so that code handling IPv6 addresses can process them without a separate path.
Is the conversion the same for IPv6?
The principle is, but an IPv6 address is 128 bits, so its integer form exceeds what a JavaScript number or a 64-bit column can hold. This tool covers IPv4 only.
Related tools
- Subnet CalculatorEnter an address and a prefix to get the network, broadcast, mask, wildcard, host range and host count — and split the block into equal subnets.
- CIDR to Subnet MaskConvert a prefix length such as /24 into its subnet mask and back again, with the full reference table for every prefix from /0 to /32.
- What Is My IPYour public IP address as the rest of the internet sees it, plus the details your browser reveals to every site you visit.
- Base64 EncoderEncode any text to Base64, including emoji and non-Latin scripts. Switch to the URL-safe alphabet when the result has to travel in a URL.