IP Address Converter
Any IPv4 address in decimal, hex, binary and octal at once.
- Free, no signup
- Calculated in your browser
- Updated November 12, 2026
Your IPv4: Not detected
Your IPv6: Not detected
IPv4 Conversion Results
IPv6 Conversion Results
Convert IP Addresses
Convert between IPv4 dotted notation, decimal, binary, hex, and IPv6 formats.
IP risk check
Is an IP address safe?
Any IP checked against VPN, proxy, Tor and datacenter ranges and public blocklists: a 0–100 risk score with every reason shown. Free, no signup.
This IP converter turns any IPv4 address into its decimal (integer), hexadecimal, binary and octal forms, plus its IPv4-mapped IPv6 address, all at once. It also works backwards: paste a decimal number such as 3232235777, a hex value such as 0xc0a80101 or 32 bits of binary, and it gives you the dotted address.
IPv6 addresses get their expanded, compressed, decimal and binary forms too. The conversion runs in your browser. Looking for where an IP address is located rather than how it is written? Use the IP lookup instead.
IP converter table: common addresses in every format
An IPv4 address is one 32-bit number (RFC 791). Dotted decimal is just the most readable way to write it. The same three addresses in every format:
| Format | 1.1.1.1 | 8.8.8.8 | 192.168.0.1 |
|---|---|---|---|
| Decimal (integer) | 16843009 | 134744072 | 3232235521 |
| Hexadecimal | 0x01010101 | 0x08080808 | 0xC0A80001 |
| Binary | 00000001.00000001. 00000001.00000001 | 00001000.00001000. 00001000.00001000 | 11000000.10101000. 00000000.00000001 |
| Octal (per octet) | 01.01.01.01 | 010.010.010.010 | 0300.0250.00.01 |
| IPv4-mapped IPv6 | ::ffff:1.1.1.1 | ::ffff:8.8.8.8 | ::ffff:192.168.0.1 |
How to convert an IP address to binary
Convert each of the four octets to an 8-bit binary number, padding with zeros on the left. Worked example for 192.168.1.1:
- Split it into octets: 192, 168, 1, 1.
- Write each as a sum of the bit values 128, 64, 32, 16, 8, 4, 2, 1. 192 = 128 + 64, so
11000000. 168 = 128 + 32 + 8, so10101000. 1 is00000001. - Join them:
11000000.10101000.00000001.00000001.
For 8.8.8.8, each octet is 8 = 00001000, so the address is 00001000.00001000.00001000.00001000. Binary is the form to use when you work out subnets: a /24 mask is 24 ones followed by 8 zeros, and the subnet calculator shows the network and host bits side by side.
IP to decimal (integer) and back
Multiply each octet by its place value and add: first octet × 16,777,216 (256³), second × 65,536 (256²), third × 256, plus the fourth.
- 192.168.1.1 = 192 × 16,777,216 + 168 × 65,536 + 1 × 256 + 1 = 3232235777
- 8.8.8.8 = 8 × 16,777,216 + 8 × 65,536 + 8 × 256 + 8 = 134744072
To go back from decimal to IP, divide by 16,777,216 and keep the whole number as the first octet, then repeat with the remainder and 65,536, then 256. 3232235777 ÷ 16,777,216 = 192 remainder 11,010,305; ÷ 65,536 = 168 remainder 257; ÷ 256 = 1 remainder 1. Result: 192.168.1.1.
Convert an IP address to an integer in code
Databases store IPv4 addresses as integers because a range check becomes two number comparisons. Each line returns 3232235777:
Python import ipaddress; int(ipaddress.ip_address("192.168.1.1"))
MySQL SELECT INET_ATON('192.168.1.1');
PostgreSQL SELECT '192.168.1.1'::inet - '0.0.0.0'::inet;
JavaScript "192.168.1.1".split(".").reduce((n, o) => n * 256 + Number(o), 0)
Back again: str(ipaddress.ip_address(3232235777)) in Python and INET_NTOA(3232235777) in MySQL (MySQL manual). PostgreSQL’s inet - inet returns the difference as a bigint (Network Address Functions and Operators). In JavaScript, avoid the bitwise shortcut (a << 24) | …: it turns addresses from 128.0.0.0 up into negative numbers, or end it with >>> 0.
IP to hex and hex to IP
Each octet becomes two hex digits. For 192.168.1.1: 192 = C0, 168 = A8, 1 = 01, 1 = 01, giving 0xC0A80101. For 8.8.8.8 every octet is 08, so 0x08080808.
Hex to IP is the reverse: split the eight digits into pairs and convert each pair to decimal. 0x7F000001 splits into 7F, 00, 00, 01, which is 127.0.0.1. The tool accepts hex input with a lowercase 0x prefix, the way it prints its own result, so a hex value it shows can be pasted straight back. You meet it in packet captures and some firewall exports.
Octal, and why IPs show up as strange numbers in links
The classic C function inet_aton() accepts each part of an address in decimal, octal (with a leading 0) or hex (with a leading 0x), and even accepts fewer than four parts, as its Linux manual page documents. Browsers kept that parsing too (the WHATWG URL Standard still reads decimal, octal and hex hosts), so http://3232235777/, http://0xC0A80101/ and http://0300.0250.01.01/ can all reach 192.168.1.1.
Phishing links use these forms to hide a raw IP address from people and from simple filters. For the decimal or hex form, paste only the number (without http:// and the slash) into the converter to see the real address. The converter reads dotted parts as decimal, so octal input gives a wrong answer (010.010.010.010 comes back as 10.10.10.10); decode octal parts by hand as shown below. Then check the address with the IP reputation checker.
A leading zero matters: 010 is 8 in octal, not 10. That is why the octal form of 8.8.8.8 is 010.010.010.010, and why 0300 is 192 (3 × 64) and 0250 is 168 (2 × 64 + 5 × 8).
IPv4 to IPv6, and when IPv6 can’t become IPv4
Every IPv4 address has an IPv4-mapped IPv6 form: ::ffff: followed by the IPv4 address, defined in RFC 4291, section 2.5.5.2. 192.168.1.1 becomes ::ffff:192.168.1.1, which in pure hex is ::ffff:c0a8:101. Dual-stack servers often log IPv4 clients in this form.
Going the other way only works for addresses that carry an IPv4 address inside them. One kind is the mapped address above: take the last 32 bits, c0a8:0101, and read the four bytes as C0.A8.01.01 = 192.168.1.1.
The other is a NAT64 address such as 64:ff9b::808:808, which is 8.8.8.8 under the well-known prefix 64:ff9b::/96 from RFC 6052. An ordinary IPv6 address like 2606:4700:4700::1111 has no IPv4 equivalent: it is a 128-bit number, and IPv4 has only 32 bits. The converter shows the IPv4-mapped form of any IPv4 address; to read an IPv4 address out of a mapped IPv6 one, use the byte steps above.
IPv6 representations
For an IPv6 address the tool shows the expanded form, the compressed form of RFC 5952, the 128-bit value in decimal and binary, and the reverse-DNS (PTR) name: 2001:db8::1 expands to 2001:0db8:0000:0000:0000:0000:0000:0001. The compression rules step by step are on the IPv6 expander and compressor.
Special and reserved addresses
A few addresses come up in conversions all the time: 127.0.0.1 (2130706433, 0x7F000001) is loopback; 0.0.0.0 (0) means “any” or “unspecified”; 255.255.255.255 (4294967295, the largest 32-bit value) is the limited broadcast address. The private ranges 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16 come from RFC 1918: as integers, 192.168.0.0/16 runs from 3232235520 to 3232301055.
Frequently Asked Questions
How do I convert an IP address to binary?
Convert each octet to an 8-bit binary number and keep the dots. 192.168.1.1 becomes 11000000.10101000.00000001.00000001. Type the address into the converter above and the binary row shows the result for any IPv4 address. Each octet always takes 8 bits, so the full address is 32 bits.
What is 8.8.8.8 in decimal?
134744072. That is 8 × 16,777,216 + 8 × 65,536 + 8 × 256 + 8. In hex it is 0x08080808, in binary 00001000.00001000.00001000.00001000, and in octal 010.010.010.010. Paste 134744072 into the converter and it returns 8.8.8.8.
How do I convert hex to an IP address?
Split the eight hex digits into four pairs and convert each pair to decimal. 0xC0A80101 is C0, A8, 01, 01, which is 192.168.1.1. The converter accepts hex input with a lowercase 0x prefix and shows the dotted address. By hand: C0 is 12 × 16 = 192.
Can every IPv6 address be converted to IPv4?
No. Only IPv6 addresses that embed an IPv4 address, such as IPv4-mapped (::ffff:a.b.c.d) and NAT64 (64:ff9b::/96) addresses, contain one to extract. Any other IPv6 address is a 128-bit number with no 32-bit equivalent. For a NAT64 address, the last two groups are the IPv4 address in hex: 808:808 is 08.08.08.08, or 8.8.8.8.
Why would an IP address be written as a number?
Databases store IPs as integers because ranges are quick to search. Attackers use the same trick in phishing links, writing http://3232235777/ instead of an address people would recognise. If you get a link like that, paste the number without http:// into the converter to see the address, then check the address with the IP reputation checker.
Can IP addresses have letters?
IPv4 addresses in normal form never do; they are four numbers from 0 to 255. IPv6 addresses do, because they are written in hexadecimal, which uses the letters a to f. An IPv4 address written in hex, like 0xC0A80101, also contains letters.
Can I convert an IP address to a hostname, domain or MAC address?
Not with a format converter, because none of them is another way of writing the number. A hostname comes from the address’s PTR record: the reverse DNS lookup finds it, if the owner set one. A MAC address is only visible on your own local network, where arp -a lists the MAC behind each IP your device has talked to recently.
Does converting an IP address tell me where it is?
No. A conversion only changes how the number is written; 3232235777 and 192.168.1.1 are the same address and carry no location. To see an address’s country, city, network owner and VPN or proxy flags, use the IP lookup.
Related Tools
IPv6 Expander / Compressor
Expand compressed IPv6 addresses to full form or compress expanded ones to shorthand notation.
Open toolSubnet Calculator
Calculate network address, broadcast, host range, and more from any IP and CIDR. Essential for firewall and network security planning.
Open toolASN Lookup
Look up an Autonomous System Number: the organization behind it, whether it is a hosting or ISP network, its IP ranges and abuse contact.
Open tool