
Convert IP addresses between multiple formats including Hex, Binary, Decimal, Octal, and IPv6
ADVERTISEMENT

Founder & CEO, Toolraxy
Faiq Ur Rahman is a web designer, digital product developer, and founder of Toolraxy, a growing platform of web-based calculators and utility tools. He specializes in building structured, user-friendly tools focused on health, finance, productivity, and everyday problem-solving.
User Ratings:
ADVERTISEMENT
Welcome to our free IP address converter tool. Designed for network engineers, developers, and students, this tool simplifies the process of converting IPv4 addresses to hexadecimal, binary, and decimal formats, as well as converting IPv6 addresses to binary. Whether you’re debugging network configurations, learning about IP addressing, or working on subnetting problems, our converter delivers fast and accurate results.
Select the conversion type – Click one of the tabs: Hex to IP, IP to Hex, Binary to IP, IP to Binary, Decimal to IP, IP to Decimal, or IPv6 to Binary.
Enter the value – Type or paste the IP address or number in the input field (e.g., 192.168.1.1, C0A80101,
11000000101010000000000100000001).
Adjust formatting options – Check or uncheck options like uppercase hex, prefix (0x or 0b), spaces between octets, padding, or comma formatting.
Click the Convert button – Press the primary button (e.g., “Convert to IP Address”, “Convert to Hexadecimal”) to perform the conversion.
View the result – The converted value appears in the “Conversion Result” box, along with details like conversion time and validity.
Copy or clear – Use the “Copy to Clipboard” button to copy the result, or “Clear Result” to reset.
Swap direction (where applicable) – Click “Swap Conversion” to quickly reverse the conversion (e.g., from IP to Hex to Hex to IP).
The converter uses standard bitwise and arithmetic operations to transform IP addresses between different number systems. Below are the core formulas and validation rules derived directly from the JavaScript code.
decimal = (octet1 << 24) + (octet2 << 16) + (octet3 << 8) + octet4
Example: 192.168.1.1 → (192×256³) + (168×256²) + (1×256) + 1 = 3232235777
octet1 = (decimal >> 24) & 255
octet2 = (decimal >> 16) & 255
octet3 = (decimal >> 8) & 255
octet4 = decimal & 255
The decimal value is converted to hexadecimal using toString(16), then padded to 8 characters. Options allow uppercase, 0x prefix, and dot separation between octets.
The hexadecimal string (optionally with 0x prefix or dots) is parsed to a decimal integer with parseInt(hex, 16), then converted back to an IP using the decimal‑to‑IP method.
Each octet is converted to binary with toString(2) and padded to 8 bits. Options include spaces between octets, 0b prefix, and leading‑zero padding.
The 32‑bit binary string (ignoring spaces and 0b prefix) is split into four 8‑bit chunks, each parsed with parseInt(chunk, 2) to obtain the octets.
The IPv6 address is first expanded (if compressed with ::), then each 16‑bit hexadecimal group is converted to a 16‑bit binary string using parseInt(segment, 16).toString(2).padStart(16, '0'). The binary groups are concatenated, with optional spaces.
If input is invalid, the result box shows an error message and the status changes to “Invalid”.
IP to Decimal
Convert each octet using powers of 256:
(192 × 256³) + (168 × 256²) + (1 × 256) + 1
Result: 3,232,235,777
Decimal to Hexadecimal
Convert the decimal value 3232235777 to hexadecimal and format it into 8 digits.
Result: C0A80101
With prefix: 0xC0A80101
IP to Binary
Convert each octet of the IP address to binary:
192 → 11000000
168 → 10101000
1 → 00000001
1 → 00000001
Result: 11000000 10101000 00000001 00000001
Decimal Back to IP
Use bit shifting to convert the decimal value back into IP format:
(3232235777 >> 24) & 255 = 192
(3232235777 >> 16) & 255 = 168
(3232235777 >> 8) & 255 = 1
3232235777 & 255 = 1
Result: 192.168.1.1
Practical Use
This type of conversion is useful for:
Verifying network configurations
Programming networking tools
Studying for networking certifications like CompTIA Network+
An Internet Protocol (IP) address is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication. Two versions are in use: IPv4 (32‑bit) and IPv6 (128‑bit). IPv4 addresses are typically written in dotted‑decimal format (e.g., 192.168.1.1), while IPv6 uses colon‑separated hexadecimal groups (e.g., 2001:0db8::1).
Conversions are essential in many technical fields:
inet_aton in C).An IPv4 address consists of four 8‑bit octets, giving a total of 2³² (about 4.3 billion) possible addresses. Each octet ranges from 0 to 255. The dotted‑decimal notation is human‑friendly, but computers process IPs as 32‑bit binary numbers. For example:
IPv6 addresses are 128 bits long, written as eight groups of four hexadecimal digits. Leading zeros can be omitted, and one contiguous block of zeros can be replaced with “::” (once per address). Converting IPv6 to binary is useful for understanding the massive address space and for network prefix calculations. Example:
:0000:8a2e:0370:7334
Network engineers use binary to calculate subnet IDs and broadcast addresses.
Software developers convert IPs to integers for database storage (e.g., INET_ATON() in MySQL).
Security analysts may need to interpret hexadecimal IPs in packet captures.
Students practice conversions to master IP addressing for certifications.
IPv4 only: The tool converts IPv6 only to binary, not to decimal or hexadecimal. (This matches the implemented code.)
Out‑of‑range octets: If an octet exceeds 255, the IP is considered invalid.
Hexadecimal input: Must be 8 characters (after removing prefix/dots) or a shorter valid hex number; otherwise an error is raised.
Binary input: Must be exactly 32 bits (spaces ignored).
IPv6 compression: The tool correctly expands “::” but does not validate every possible IPv6 edge case (e.g., multiple “::” are not allowed).
Setting up a Docker network: A developer needs to define a custom IP range in a Docker Compose file. The documentation specifies that the subnet must be provided in CIDR notation, but the developer wants to double‑check the decimal equivalents. Using this IP converter, they quickly verify that 192.168.1.0/24 corresponds to a decimal range of 3232235776 to 3232236031, ensuring the configuration is correct before deployment.
High accuracy with built‑in validation
Customizable output (prefixes, spacing, padding)
Supports both IPv4 and IPv6 (binary for IPv6)
Simple tabbed interface
One‑click copy to clipboard
Swap conversion direction instantly
Shows conversion time and validity stats
Completely free, no registration required
Great learning tool for networking students
Select the “IP to Binary” tab, enter a valid IPv4 address (e.g., 192.168.1.1), adjust options like spaces or padding, and click “Convert to Binary”. The binary representation will appear instantly.
127.0.0.1 (localhost) in decimal is 2130706433. You can verify this using the “IP to Decimal” tab.
Yes, the tool includes an “IPv6 to Binary” tab. Enter a valid IPv6 address (full or compressed) and get the 128‑bit binary output.
When converting IP to hex, checking “Include 0x prefix” adds “0x” before the hexadecimal result (e.g., 0xC0A80101). This is common in programming languages to denote hexadecimal numbers.
The converter uses precise bitwise operations and parsing functions. As long as the input is valid, the output is 100% accurate. Invalid inputs trigger clear error messages.
The maximum IPv4 address, 255.255.255.255, corresponds to the decimal value 4294967295. The tool accepts any decimal number in the range 0–4294967295.
Hexadecimal representation is often used in low‑level networking, firmware, or when configuring hardware devices. It’s also a compact way to write IPs in some programming contexts.
No, octal conversion is not implemented. The tool focuses on hexadecimal, binary, decimal, and IPv6 binary conversions.
ADVERTISEMENT