Free Converter

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.

Auto-detects format 10 output formats IPv4 + IPv6 Runs locally Always free
Network tool
Enable JavaScript to run lookups and interactive features on this page.

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.

IP address format converter — convert between dotted decimal, integer, hex, binary and IPv6 representations

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

FormatExample (192.168.1.1)Used InHow to Convert
Dotted Decimal192.168.1.1Standard human-readable format — routing tables, config files, UI displaysFour octets, each 0–255, separated by dots
32-bit Integer (Decimal)3232235777Database storage, C/Java InetAddress.getAddress(), socket programming, IP arithmetic(192×16777216)+(168×65536)+(1×256)+1
Hexadecimal0xC0A80101Firewall configs, C programming, Windows registry, packet headers, low-level debuggingEach octet → 2 hex digits: C0.A8.01.01
Dotted Hex0xC0.0xA8.0x01.0x01Some BSD/Unix tools, Cisco IOS debug outputSame as hex but with dots between octets
Binary11000000.10101000.00000001.00000001Subnet mask calculations, CCNA exam problems, understanding bitwise AND for network addressesEach octet → 8 binary digits (0 or 1)
Octal0300.0250.01.01Legacy 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.1Dual-stack sockets, IPv6 APIs receiving IPv4 connections, Java/Python socket programming::ffff: prefix + dotted-decimal IPv4
IPv6 Mapped (Hex)::ffff:c0a8:0101IPv6 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.168.1.1 → 32-bit integer:
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 MethodExampleProsCons
VARCHAR(45) dotted'192.168.1.1'Human-readable, no conversion neededString comparison doesn't work for range queries; 45 bytes/row
INT UNSIGNED (32-bit)3232235777Fast range queries (BETWEEN), 4 bytes, indexableNot human-readable; requires INET_ATON/INET_NTOA in MySQL
VARBINARY(16)Binary bytesWorks for both IPv4 and IPv6Complex to query and display
INET type (PostgreSQL)192.168.1.0/24Native CIDR support, built-in operatorsPostgreSQL-specific
# MySQL: convert between formats
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:

FormatExampleUsed In / Notes
Full expanded2001:0db8:0000:0000:0000:0000:0000:0001Unambiguous — all 32 hex digits shown. Used in some config files and documentation.
Compressed (::)2001:db8::1Standard human-readable form. :: replaces longest run of all-zero groups. Leading zeros in each group are suppressed.
Decimal integer42540488161975842760550356425300246529Python ipaddress module, cryptographic operations. 128-bit integers require BigInt in JavaScript.
Hex (no colons)20010db8000000000000000000000001Database storage, packet analysis, some API responses.
IPv4-mapped IPv6::ffff:192.168.1.1Dual-stack sockets. Python/Java/Go IPv6 servers represent incoming IPv4 connections in this format.
URL format[2001:db8::1]:8080IPv6 addresses in URLs must be enclosed in square brackets per RFC 2732. Port follows outside the bracket.

Frequently Asked Questions

The 32-bit decimal integer form is used in several important contexts: (1) Database storage — storing IPs as INT UNSIGNED in MySQL enables fast range queries using BETWEEN, which is essential for GeoIP lookups. (2) Network programming — C's inet_addr() and Python's ipaddress module work with integer addresses internally. (3) IP arithmetic — computing the next IP in a range or verifying subnet boundaries is straightforward with integer arithmetic. (4) Spreadsheets — Excel and Google Sheets don't have native IP comparison, but integer IPs can be compared with =BETWEEN() formulas.
0xC0A80101 is the hexadecimal representation of 192.168.1.1. Read it by splitting into 4 pairs of hex digits: C0=192, A8=168, 01=1, 01=1. Convert each hex pair: C0 in hex = 12×16+0 = 192, A8 = 10×16+8 = 168, 01 = 1, 01 = 1. The 0x prefix indicates hexadecimal notation.
Split the 32 binary digits into four 8-bit groups. Convert each group using positional values: 11000000 = 128+64 = 192, 10101000 = 128+32+8 = 168, 00000001 = 1, 00000001 = 1. Result: 192.168.1.1. Or use the shortcut: 11000000 binary = C0 hex = 192 decimal.
When a dual-stack server (one that supports both IPv4 and IPv6) receives a connection from an IPv4 client, modern operating systems represent the IPv4 address in IPv6 format as ::ffff:x.x.x.x. This is called an IPv4-mapped IPv6 address. In Python: socket.getpeername() on an IPv6-enabled server returns ('::ffff:192.168.1.1', port). You need to detect and strip the ::ffff: prefix to get the actual IPv4 address for GeoIP lookups.
For IPv4: INT UNSIGNED (4 bytes, values 0–4294967295) is most efficient. Use MySQL's INET_ATON('192.168.1.1') to convert on insert and INET_NTOA(ip_int) on select. For IPv6: VARBINARY(16) stores the raw 16-byte representation. PostgreSQL has a native INET type that supports both IPv4 and IPv6 with subnet operators. For applications that need range queries (GeoIP: 'which country is this IP?'), integer storage with a BETWEEN index is 10–100x faster than string comparison.
Yes — completely free, no signup required. All conversions run entirely in your browser using JavaScript. No IP addresses are transmitted to any server.

Related Tools

Advertisement