IP Address Format Converter
Convert any IP address between all formats instantly — dotted decimal (192.168.1.1), 32-bit decimal integer (3232235777), hexadecimal (0xC0A80101), binary, octal, and IPv6 mapped representations. Auto-detects input format. Essential for database storage, network programming, subnet calculations, and packet analysis.
Hero, guides, and sidebar links below work without JavaScript. The interactive checker needs JavaScript enabled in your browser.
What Is an IP Address Format Converter?
IP addresses can be represented in multiple formats — all equivalent, all referring to the same address. An IP format converter translates between these representations, which are encountered in different programming languages, operating systems, network tools, and documentation. The most common IPv4 formats are dotted-decimal (192.168.1.1), 32-bit decimal integer (3232235777), hexadecimal (0xC0A80101), and binary (four 8-bit octets). IPv6 adds additional representations including full expanded form, compressed form with ::, and decimal/hex variants.
The same IP address can be written in many equivalent ways — each format is used in different contexts across networking, programming, and security tools
All IPv4 Address Formats — Complete Reference
| Format | Example (192.168.1.1) | Used In | How to Convert |
|---|---|---|---|
| Dotted Decimal | 192.168.1.1 | Standard human-readable format — routing tables, config files, UI displays | Four octets, each 0–255, separated by dots |
| 32-bit Integer (Decimal) | 3232235777 | Database storage, C/Java InetAddress.getAddress(), socket programming, IP arithmetic | (192×16777216)+(168×65536)+(1×256)+1 |
| Hexadecimal | 0xC0A80101 | Firewall configs, C programming, Windows registry, packet headers, low-level debugging | Each octet → 2 hex digits: C0.A8.01.01 |
| Dotted Hex | 0xC0.0xA8.0x01.0x01 | Some BSD/Unix tools, Cisco IOS debug output | Same as hex but with dots between octets |
| Binary | 11000000.10101000.00000001.00000001 | Subnet mask calculations, CCNA exam problems, understanding bitwise AND for network addresses | Each octet → 8 binary digits (0 or 1) |
| Octal | 0300.0250.01.01 | Legacy Unix systems, some older tools. Rarely used today. | Each octet → octal. Avoided due to ambiguity with leading zeros. |
| IPv6 Mapped (Full) | ::ffff:192.168.1.1 | Dual-stack sockets, IPv6 APIs receiving IPv4 connections, Java/Python socket programming | ::ffff: prefix + dotted-decimal IPv4 |
| IPv6 Mapped (Hex) | ::ffff:c0a8:0101 | IPv6 routing tables, low-level IPv6 socket debugging | ::ffff: + hex octets without dots |
Why Different Formats Exist
The dotted-decimal format (192.168.1.1) is purely for human readability — computers store and process IPv4 addresses as 32-bit unsigned integers. The format you encounter depends on the layer you're working at:
- Networking layer: Dotted decimal (192.168.1.1) — router configs, network diagrams, firewall rules
- Database layer: 32-bit integer (3232235777) — efficient storage, fast range queries (
SELECT * WHERE ip_int BETWEEN 3232235520 AND 3232235775) - C/Systems programming: 32-bit integer via
inet_aton()/inet_ntoa(), hex in struct packing - Python:
int(ipaddress.ip_address('192.168.1.1'))→ 3232235777 - JavaScript: Manual bit shifting —
(192<<24|168<<16|1<<8|1)>>>0 - Subnet calculations: Binary — understanding which bits are network vs host requires binary thinking
- Packet capture (Wireshark): Hex — raw packet bytes are displayed in hexadecimal
How the Decimal Integer Conversion Works
192 × 256³ = 192 × 16,777,216 = 3,221,225,472
168 × 256² = 168 × 65,536 = 11,010,048
1 × 256¹ = 1 × 256 = 256
1 × 256⁰ = 1 × 1 = 1
Sum = 3,232,235,777
# Reverse (integer → dotted decimal):
3232235777 ÷ 16,777,216 = 192 remainder 11,010,305
11,010,305 ÷ 65,536 = 168 remainder 257
257 ÷ 256 = 1 remainder 1
1 = 1
→ 192.168.1.1 ✓
# Python one-liners:
import ipaddress
int(ipaddress.ip_address('192.168.1.1')) # → 3232235777
str(ipaddress.ip_address(3232235777)) # → '192.168.1.1'
hex(int(ipaddress.ip_address('192.168.1.1'))) # → '0xc0a80101'
IP Formats in Database Storage
Storing IP addresses in databases has two main approaches — each with trade-offs:
| Storage Method | Example | Pros | Cons |
|---|---|---|---|
| VARCHAR(45) dotted | '192.168.1.1' | Human-readable, no conversion needed | String comparison doesn't work for range queries; 45 bytes/row |
| INT UNSIGNED (32-bit) | 3232235777 | Fast range queries (BETWEEN), 4 bytes, indexable | Not human-readable; requires INET_ATON/INET_NTOA in MySQL |
| VARBINARY(16) | Binary bytes | Works for both IPv4 and IPv6 | Complex to query and display |
| INET type (PostgreSQL) | 192.168.1.0/24 | Native CIDR support, built-in operators | PostgreSQL-specific |
SELECT INET_ATON('192.168.1.1'); -- → 3232235777
SELECT INET_NTOA(3232235777); -- → '192.168.1.1'
SELECT HEX(INET_ATON('192.168.1.1')); -- → 'C0A80101'
# PostgreSQL: range query with inet type
SELECT * FROM logs WHERE ip_addr <<= '192.168.1.0/24';
# Python: fast subnet range check using integer comparison
import ipaddress
net = ipaddress.ip_network('192.168.1.0/24')
ip = ipaddress.ip_address('192.168.1.100')
ip in net # True — much faster than string comparison
IPv6 Address Representations
IPv6 addresses have even more representation formats due to the larger address space and the addition of compression rules:
| Format | Example | Used In / Notes |
|---|---|---|
| Full expanded | 2001:0db8:0000:0000:0000:0000:0000:0001 | Unambiguous — all 32 hex digits shown. Used in some config files and documentation. |
| Compressed (::) | 2001:db8::1 | Standard human-readable form. :: replaces longest run of all-zero groups. Leading zeros in each group are suppressed. |
| Decimal integer | 42540488161975842760550356425300246529 | Python ipaddress module, cryptographic operations. 128-bit integers require BigInt in JavaScript. |
| Hex (no colons) | 20010db8000000000000000000000001 | Database storage, packet analysis, some API responses. |
| IPv4-mapped IPv6 | ::ffff:192.168.1.1 | Dual-stack sockets. Python/Java/Go IPv6 servers represent incoming IPv4 connections in this format. |
| URL format | [2001:db8::1]:8080 | IPv6 addresses in URLs must be enclosed in square brackets per RFC 2732. Port follows outside the bracket. |