Address conversion · IPv4 + IPv6
IP to Hex Converter
Turn IP addresses into exact hex bytes, or decode hex back to an address. Convert a batch, choose the byte order, and see how every byte fits.
Runs in your browser. Address input is never sent or saved by this tool.
Convert addresses
Network order keeps the first address byte first. Little endian reverses all 4 or 16 bytes; it does not reverse digits or swap only 32-bit words.
IPv4 must have four decimal octets without leading zeros. IPv6 may use :: compression and a final dotted IPv4 address. Enter addresses only: no CIDR, zone IDs, brackets, ports, or URLs.
Up to 1,000 lines and 128,000 characters; 256 characters per line. Blank lines are ignored. Input changes clear previous results.
Conversion results
Copy includes successful lines only, in input order. Downloads retain every nonblank row, line numbers, settings, and errors. CSV protects cells that could be interpreted as spreadsheet formulas.
Inside the address
- Canonical IP
- Expanded IP
- Network-order hex
- Selected-order hex
- Address width
Bytes below are always shown in network order, from first to last. Each card gives decimal, hex, binary, and the base-16 calculation.
Read the bytes with confidence
One byte contains 8 bits, so it needs exactly two hex digits. An IPv4 address has 4 bytes (8 hex digits). An IPv6 address has 16 bytes (32 hex digits). Leading zero bytes are part of the address and stay in the result.
192.0.2.1 → C0 00 02 01: 192 = 12 × 16 + 0, so the first byte is C0. Joining the bytes gives 0xC0000201 in network order.
2001:db8::1 expands into eight 16-bit groups. Each group supplies two bytes: 2001 → 20 01. Compression changes only how the address is written, never its width.
IPv6 formatting follows RFC 5952: lowercase, no unnecessary group zeros, and the first longest run of at least two zero groups compressed. IPv4-mapped addresses use ::ffff:192.0.2.1. Address syntax is defined in RFC 4291 §2.2.
Formats and limits
What hex can I decode?
Use exactly 8 or 32 hex digits, optionally preceded by 0x, or exactly 4 or 16 two-digit bytes separated consistently by spaces, dots, colons, or hyphens. For example: C0000201, 0xC0000201, or C0 00 02 01. Short values are rejected instead of guessing missing zeros or an address family.
In Hex → IP mode, colon-separated values are byte lists, not IPv6 hextets. To convert 2001:db8::1, choose IP address → hex.
When should I use little endian?
Use it only when the source or destination format explicitly stores the complete address with its bytes reversed. For 192.0.2.1, that is 01 02 00 C0. Both conversion directions use the selected order for hex. Canonical IP and the network-order reference always retain normal address order.
Some system dumps reverse bytes within each 32-bit word instead. That is a different representation and is not supported here.
Does this check whether an address is reachable?
No. This tool converts address representations locally. It does not perform DNS queries, network requests, reachability tests, subnet calculations, or browser-style parsing of shortened, octal, or numeric IPv4 addresses. A valid conversion does not establish whether an address is assigned or reachable.