IP Address Converter

Convert between decimal, binary, and hexadecimal IP address formats.

How to use:

Enter an IP address in either decimal or binary format, and the calculator will convert it to all formats. You can enter in one format and it will automatically convert to the others.

Published: December 2025 | Author: TriVolt Editorial Team | Last Updated: February 2026

Understanding IP Address Formats

IP addresses can be represented in multiple number systems: decimal (most common), binary (fundamental format), and hexadecimal (compact representation). Understanding these different formats is essential for network engineers, system administrators, and anyone working with IP networking. Each format has specific use cases and advantages.

IPv4 addresses are 32-bit numbers, typically written in dotted decimal notation (e.g., 192.168.1.1), where each octet represents 8 bits. The same address can be expressed in binary (showing the actual bit pattern) or hexadecimal (a more compact representation). Converting between these formats helps in subnetting, troubleshooting, and understanding network addressing at a deeper level.

IP Address Structure

An IPv4 address consists of 32 bits, divided into four 8-bit octets:

  • Decimal Format: Each octet ranges from 0-255 (e.g., 192.168.1.1)
  • Binary Format: Each octet is 8 binary digits (e.g., 11000000.10101000.00000001.00000001)
  • Hexadecimal Format: Each octet is 2 hex digits (e.g., C0.A8.01.01)

The total address space is 2³² = 4,294,967,296 possible addresses, though many are reserved for special purposes.

Number System Conversions

Decimal to Binary

Each decimal octet (0-255) converts to an 8-bit binary number. For example, 192 in decimal equals 11000000 in binary. The conversion uses repeated division by 2, reading remainders from bottom to top.

Binary to Decimal

Each binary octet converts to decimal by summing powers of 2. For example, 11000000 = 1×2⁷ + 1×2⁶ + 0×2⁵ + ... + 0×2⁰ = 128 + 64 = 192.

Hexadecimal Representation

Hexadecimal uses base-16, where each digit represents 4 bits. Two hex digits represent one octet. For example, 192 (decimal) = C0 (hex), since C=12 and 0=0, giving 12×16 + 0 = 192.

Practical Applications

Subnetting and Network Design

Binary representation is essential for understanding subnet masks and calculating subnets. The binary format clearly shows which bits are network bits and which are host bits.

Troubleshooting

Converting IP addresses helps identify patterns, verify subnet calculations, and debug network configuration issues. Binary format reveals the underlying structure.

Access Control Lists

Network devices often use binary or hexadecimal representations in ACLs and routing tables. Understanding these formats is necessary for configuring network security.

Documentation and Analysis

Different formats serve different documentation needs. Decimal is human-readable, binary shows structure, and hexadecimal is compact for technical documentation.

Real-World Examples

Example 1: Common Private IP

Decimal: 192.168.1.1

Binary: 11000000.10101000.00000001.00000001

Hexadecimal: C0.A8.01.01

This is a common default gateway address in home networks

Example 2: Loopback Address

Decimal: 127.0.0.1

Binary: 01111111.00000000.00000000.00000001

Hexadecimal: 7F.00.00.01

Used for localhost testing

Tips for Using This Calculator

  • Enter IP address in decimal format (e.g., 192.168.1.1) or binary format
  • Binary format must have 8 bits per octet, separated by dots
  • Decimal octets must be between 0 and 255
  • Results show all three formats simultaneously
  • Use binary format to understand subnet masks and network boundaries
  • Hexadecimal format is useful for compact representation in technical documentation
  • Always verify critical conversions independently, especially for network configuration

Common Pitfalls

Leading zeros in octets. Some operating systems (historically Linux, macOS, and modern browsers too) treat 192.168.001.001 as octal in certain contexts, making 010 mean 8, not 10. The CVE-2021-29921 bug in Python's ipaddress module exploited exactly this. Our calculator treats each octet as decimal without leading-zero octal interpretation, but some tools don't — always strip leading zeros before pasting addresses.

Assuming 32-bit integers and endianness. Converting an IP to a single integer (192.168.1.1 → 3,232,235,777) depends on endianness. Network order is big-endian (most significant octet first), but C functions like inet_addr() vs. inet_pton() differ in return format, and htonl()/ntohl() swap bytes. Sharing a "numeric IP" across platforms without specifying endianness leads to subtle bugs. Our calculator uses big-endian dotted-decimal mapping exclusively.

Shortened octet counts. Linux ping 10.1 expands to 10.0.0.1 — yes, really. Windows expands 10.1 to 10.0.0.1 too. This is a legacy BSD feature from the classful era (10.1 was a class A host 1 on network 10). Shorthand like this confuses logs and firewall rules; always use the full 4-octet form in configs.

Mixing IPv4 and IPv6 formats. IPv4-mapped IPv6 (::ffff:192.0.2.1) and IPv4-compatible IPv6 (::192.0.2.1) both embed a v4 address inside a v6 128-bit field. Dual-stack applications sometimes receive connections in the mapped form when a v4 peer connects to a v6 socket; your logging or ACL code must handle both representations or strip the prefix before comparison.

Hex conversion without octet boundaries. Writing 192.168.1.1 as hex C0A80101 (no separators) is correct but easy to misread. Tools like Wireshark show it as c0 a8 01 01; source code may prefix with 0x. Verify the format your tool expects before pasting. See the Number System Converter for base conversions.

Frequently Asked Questions

Why do I need to see an IP in binary?

Because subnet masks, supernetting, and ACL wildcards are bitwise operations. Looking at 172.16.0.0/19 decimally tells you nothing; seeing 10101100.00010000.00000000.00000000 shows you exactly which bits are fixed (the prefix) and which vary (the host portion). Network engineers routinely switch between decimal for humans and binary for math.

What's the difference between 192.0.2.1 and 192.0.2.001?

In strict RFC 791 parsing, identical. In practice, dangerous — some parsers read 001 as octal (still 1), but 010 as octal 8 instead of decimal 10. 192.0.2.010 might hit 192.0.2.8 or 192.0.2.10 depending on the implementation. Always use unpadded decimal octets.

Can I convert a hostname to an IP here?

No — that requires a DNS lookup. This calculator does format conversion (decimal ↔ binary ↔ hex) on an address you already have. For DNS resolution, use dig, nslookup, or host on the command line.

How do I represent IPv6 compactly?

Use :: to collapse one run of consecutive zero groups, and drop leading zeros within each group. 2001:0db8:0000:0000:0000:0000:0000:0001 becomes 2001:db8::1. You can only use :: once per address. This calculator is IPv4-only; for IPv6 tooling, a dedicated IPv6 calculator is needed.

What's the hexadecimal form of 255.255.255.0?

FF.FF.FF.00 — or FFFFFF00 as a 32-bit integer. This appears in router configuration dumps, packet captures, and NetFlow records. Convert by octet: 255 = 0xFF, 0 = 0x00. See the Subnet Calculator for common mask values and their hex/CIDR equivalents.

Related Calculators

Pair format conversion with these network tools:

Disclaimer

This calculator is provided for educational and informational purposes only. While we strive for accuracy, users should verify all calculations independently, especially for critical applications. We are not responsible for any errors, omissions, or damages arising from the use of this calculator.


Also in Technical