Convert an IPv4 address to hexadecimal, binary or decimal
192.0.2.1 is 0xC0000201 in hexadecimal and 3221225985 as an unsigned decimal integer. These are different ways to write the same 32-bit IPv4 value. Select the format of your input, enter one value and choose Convert. The four outputs appear together so you can compare each representation without changing pages.
Use IPv4 dotted decimal for an ordinary address such as 192.0.2.1. Choose Hexadecimal for eight hex digits, Binary for 32 bits, or Unsigned decimal for an integer. Changing a field clears the previous answer. Reset returns to the documentation example, and Copy all results copies the current four representations.
This is an address-format calculator. It does not discover your public IP, look up a hostname, connect to the entered address or verify a device. A syntactically valid address is not necessarily assigned, reachable or suitable for a particular network.
IP address to hex: work one octet at a time
An IPv4 address has four eight-bit octets. One hexadecimal digit represents four bits, so each octet needs two hexadecimal digits. Keep the original octet order and retain leading zero digits in the output.
192 → C0 | 0 → 00 | 2 → 02 | 1 → 01
Join those four pairs to obtain C0000201, or 0xC0000201 with a hex prefix. The prefix identifies the notation; it is not part of the address's 32 bits.
To convert hex to IP, split eight digits into four pairs. Convert C0, 00, 02 and 01 from base 16 to decimal, then separate the values with dots: 192.0.2.1. Uppercase and lowercase hex input mean the same thing here. The tool displays uppercase output consistently.
Unsigned decimal and network byte order
This tool treats the first dotted octet as the most significant byte, followed by the second, third and fourth. This is the network-byte-order convention used for the displayed number; it is not a signed integer or a representation of a program's raw memory layout.
Decimal integer = a × 16,777,216 + b × 65,536 + c × 256 + d
For 192.0.2.1: 192 × 16,777,216 + 0 × 65,536 + 2 × 256 + 1 = 3221225985.
The unsigned range is 0 through 4,294,967,295. Some programming interfaces show a signed 32-bit result or store bytes in a different order. Confirm the source field's format before comparing it with this output. Reversing the byte order changes which address a number represents; the converter does not silently swap bytes or infer that convention.
IP address to binary
Write each decimal octet as eight binary digits, including leading zeros. For 192.0.2.1, the result is 11000000 00000000 00000010 00000001. The spaces make octet boundaries visible; there are 32 bits in total.
Binary input accepts 32 consecutive digits, four eight-bit groups separated by spaces, or four eight-bit groups separated by dots. Each digit must be 0 or 1. Do not add a 0b prefix, shorten an octet or mix separators. Choose the input format explicitly rather than expecting the tool to guess whether a string of digits is binary, hex or decimal.
These bits are also useful when learning subnet masks, but an address alone does not specify a network prefix. Use the subnet mask calculator and cheat sheet for a CIDR network, broadcast address and host range, or try subnetting practice for worked exercises.
Worked address-format examples
| IPv4 | Hexadecimal | Unsigned decimal |
|---|---|---|
| 192.0.2.1 | 0xC0000201 | 3221225985 |
| 198.51.100.10 | 0xC633640A | 3325256714 |
| 203.0.113.255 | 0xCB0071FF | 3405804031 |
The examples use IPv4 documentation ranges described in RFC 5737. They demonstrate conversion, not endpoints to contact. Values such as 0.0.0.0 and 255.255.255.255 also have valid numerical representations, but their network meanings depend on context; converting them does not make them ordinary host assignments.
Accepted inputs and common mistakes
- Dotted IPv4: exactly four decimal octets from 0 to 255. Do not use leading zeros, a port, a URL, brackets or a /prefix. For example, 192.000.2.1 and 192.0.2.1/24 are rejected.
- Hexadecimal: exactly eight digits, with an optional 0x prefix. Enter C0000201 or 0xC0000201. A shortened value such as C001 is not expanded automatically.
- Binary: exactly 32 bits in the complete or grouped forms described above. Preserve all eight digits per octet.
- Decimal: one unsigned integer up to 4294967295, without signs, commas, exponents or leading zeros. The single value 0 is valid.
Outer whitespace is ignored, and input is limited to 80 characters. IPv6, hostnames, CIDR networks, signed integers and mixed legacy numeric IPv4 forms are outside this tool's input formats. These are deliberate input rules, not a promise about what every operating system or URL parser accepts.
If you need public DNS answers for a domain, use the separate DNS lookup tool. The IPv6 connectivity test checks browser endpoint observations; it does not convert IPv6 text to a 32-bit IPv4 number.
Local calculations and precision
The converter parses the selected text into an unsigned 32-bit value and formats the same value four ways. Every integer in this range can be represented exactly by JavaScript's number type, so this calculation does not need approximate rounding. The four output octets are always kept in network order.
Conversion starts only when you select Convert. Its code does not send the entered address to a conversion or lookup service, put it into a URL, save a conversion history or attach it to analytics events. Leaving the page clears the entered value and output. A copy you place on your clipboard remains your responsibility. Other website services and consent choices are described in the privacy policy.
For broader connection troubleshooting, explore all internet tools or run the separate Internet Speed Test. Address notation alone cannot establish throughput, latency, ownership, location or the safety of an endpoint.
Definitions and sources
The address width and transmission-order context come from RFC 791, Internet Protocol. The dotted-decimal input subset follows the four decimal-octet grammar in RFC 3986 section 3.2.2. Hex, binary and integer presentation choices are defined explicitly above so that you can reproduce the arithmetic. Read how our tools and measurements work for the wider site's methods and limits.
IP to hex converter questions
How do I convert an IP address to hex?
Select IPv4 dotted decimal, enter four octets and choose Convert. Each octet becomes two hexadecimal digits. For example, 192.0.2.1 becomes 0xC0000201; both describe the same 32-bit value.
Can I convert hex back to an IP address?
Yes. Choose Hexadecimal and enter exactly eight hex digits, optionally prefixed with 0x. C0000201 and 0xC0000201 both become 192.0.2.1. Uppercase and lowercase input are accepted.
Which byte order does the decimal output use?
The output is an unsigned 32-bit integer in network byte order: the first dotted octet is the most significant byte. It ranges from 0 to 4294967295. Signed integers and automatic byte swapping are not supported.
How do I convert a binary IP address?
Choose Binary and enter 32 bits, or four groups of eight bits separated by spaces or dots. Each group represents one IPv4 octet. Preserve leading zeros and do not add a 0b prefix or mix separators.
Does this tool support IPv6 or check whether an IP is online?
No. This converter handles IPv4 text and number representations only. It does not probe the entered address, look up a hostname or verify an assignment. IPv6 requires 128-bit address handling rather than this 32-bit conversion.
Useful next steps
To see the address used by your connection, open What Is My IP?. To inspect approximate location and network details for an entered public address, use IP address lookup. The converter here changes notation locally.
Explore all network tools for other calculators and diagnostics.