IPv4 address converter

Convert an IP address into decimal, binary, hexadecimal, or even an IPv6 representation of it.

Enable JavaScript to use the interactive tool. The guide below explains how it works.

IPv4 Address Converter: Comprehensive Network Identity Guide

What the tool does

The IPv4 Address Converter is a specialized utility designed to translate standard "dotted-quad" IP addresses into various mathematical and protocol formats. While we typically see IP addresses as four numbers separated by periods (e.g., 192.168.1.1), computers and networking hardware often treat these addresses as raw 32-bit integers or use specialized IPv6-mapped representations.

This tool performs instantaneous conversion between the human-readable IPv4 string and several critical technical formats: pure decimal integers, hexadecimal values, binary bit-strings, and two different IPv6 compatibility formats (standard and short). It validates the input in real-time to ensure it adheres to the 0-255 range per octet rule, providing immediate feedback if an address is malformed.

Why someone uses it

Understanding the different representations of an IP address is essential for network engineering, system administration, and software development involving network sockets.

1. Subnetting and Masking Calculations

When performing manual subnetting, it is often necessary to convert an IP address to binary to see exactly where the network and host portions of the address are split. This tool provides the raw binary string needed for bitwise AND operations with subnet masks.

2. Database and Storage Optimization

Storing IP addresses as strings (e.g., VARCHAR(15)) in a database is inefficient and makes range-based searching (like "find all IPs in this city") very slow. Engineers use this tool to see the integer value of an IP, allowing them to store it as a single 32-bit unsigned integer, which is significantly faster for indexing and sorting.

3. Log Analysis and Forensics

Security tools sometimes log IP addresses in hexadecimal or decimal format to save space or avoid parsing issues. When an analyst sees a decimal value like 3232235777, they use this tool to quickly translate it back to the familiar 192.168.1.1.

4. Transitioning to IPv6

As the world moves toward IPv6, many systems use "IPv4-mapped IPv6 addresses" to allow both protocols to coexist. This tool generates the ::ffff:c0a8:0101 style addresses automatically, helping developers bridge the gap between legacy and modern networking stacks.

Step-by-step instructions

  1. Open the Tool: Select "IPv4 address converter" from the IT-tool navigation.
  2. Input the Address: Type your IPv4 address into the main input field.
    • Standard format: X.X.X.X where X is between 0 and 255.
  3. Real-time Validation: If you enter an invalid address (like 256.0.0.1 or 1.2.3), the tool will display a "Set a correct ipv4 address" placeholder in the output fields.
  4. Examine the Converted Data:
    • Decimal: The 32-bit integer representation (useful for database storage).
    • Hexadecimal: The base-16 version of the integer.
    • Binary: The full 32-bit bit-string (broken down by octets).
    • Ipv6: The full IPv4-mapped IPv6 address.
    • Ipv6 (short): The compressed ::ffff: version of the IPv6 mapping.
  5. Copy the Results: Click any output field to copy its value for use in your configuration files, code, or documentation.

Examples

Example 1: Localhost Conversion

Example 2: Google's DNS

Example 3: Private Network Gateway

FAQs

Q: How is the decimal value calculated?

A: Each octet (the four parts of the IP) is treated as a base-256 digit. The formula is: (Octet1 * 256^3) + (Octet2 * 256^2) + (Octet3 * 256^1) + (Octet4 * 256^0).

Q: Why do the binary results look like one long string?

A: An IPv4 address is technically just a 32-bit number. The periods in the dotted-quad format are only there for human readability.

Q: What is an IPv4-mapped IPv6 address?

A: It is a special type of IPv6 address that represents an IPv4-only node. This allows IPv6 applications to communicate with IPv4 nodes. They always start with ::ffff:.

Q: Does this tool support CIDR notation (like /24)?

A: This specific tool is for individual address conversion. For ranges and CIDR calculations, please use the "IPv4 Subnet Calculator" or "IPv4 Range Expander" tools.

Q: Is there a "big endian" or "little endian" concern?

A: In networking, the standard is "Network Byte Order," which is Big Endian. This tool follows that standard, where the first octet (leftmost) is the most significant.

Common mistakes

1. Using leading zeros in octets

While some systems accept 192.168.001.001, many others interpret leading zeros as octal (base 8) notation. It's best practice to always use decimal without leading zeros (e.g., 192.168.1.1).

2. Forgetting that 255 is the maximum

Each octet is exactly 8 bits, meaning the largest value it can hold is 255 (2^8 - 1). Entering 192.168.1.256 is a common typo that will invalidate the conversion.

3. Confusing Decimal with Hexadecimal

In binary, 10 is two. In decimal, 10 is ten. In hexadecimal, 10 is sixteen. Always check which field you are copying from.

4. Thinking IPv6 is just an "extension" of IPv4

While this tool provides IPv6 mappings, a "real" native IPv6 address is 128 bits long and has nothing to do with your current IPv4 address. Mappings are only for compatibility.

Use cases

Related tools

All tools

Guides and articles