Skip to content
🛠️ToolsShed

IP Address Converter

Convert between IPv4, IPv6, decimal, binary, and hex formats. Shows address class and type.

About this tool

An IP address converter is an essential tool for network administrators, developers, and IT professionals who need to understand and work with different IP address formats. IPv4 addresses (like 192.168.1.1) and IPv6 addresses (like 2001:db8::1) are the foundation of internet communication, but they can be represented in multiple formats—decimal, binary, and hexadecimal—each useful for different networking tasks and analysis. This tool eliminates the manual conversion process, providing instant results and helping you understand the structure of IP addresses across all these formats.

Using this converter is straightforward: simply enter an IP address in any format (IPv4, IPv6, decimal, binary, or hex), and the tool instantly displays the equivalent values in all other formats. The tool also identifies the address class for IPv4 (Class A, B, C, D, or E), determines whether the address is public or private, and classifies it by type (unicast, multicast, broadcast, or reserved). This is particularly useful when debugging network configurations, validating IP ranges, analyzing network traffic logs, or learning how IP addressing works under the hood.

This converter supports the full range of IPv4 and IPv6 addressing schemes without requiring any external API calls—all conversions happen instantly in your browser. Whether you're a student learning networking fundamentals, a systems administrator troubleshooting connectivity issues, or a developer integrating IP-based features into an application, this tool provides the detailed breakdown you need. The automatic classification of address types helps you quickly identify whether an IP is routable on the public internet or reserved for private networks.

Frequently Asked Questions

Code Implementation

import socket
import struct

def ip_to_int(ip: str) -> int:
    return struct.unpack("!I", socket.inet_aton(ip))[0]

def int_to_ip(n: int) -> str:
    return socket.inet_ntoa(struct.pack("!I", n))

def ip_to_hex(ip: str) -> str:
    return "0x{:08X}".format(ip_to_int(ip))

def ip_to_binary(ip: str) -> str:
    return ".".join(f"{int(o):08b}" for o in ip.split("."))

ip = "192.168.1.1"
print("Decimal:", ip)
print("Integer:", ip_to_int(ip))        # 3232235777
print("Hex:    ", ip_to_hex(ip))        # 0xC0A80101
print("Binary: ", ip_to_binary(ip))     # 11000000.10101000.00000001.00000001
print("Back:   ", int_to_ip(3232235777))

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.