IP to Hex Converter — IPv4 / IPv6 to Hexadecimal, Free
Convert any IPv4 or IPv6 address to hex notation. Decimal, octet, packed forms supported. Browser-only.
About Convert IP to Hex
Converting an IP address to hex represents the same address in hexadecimal — useful for low-level networking, IPv6 already-hex notation, packet captures, and embedded systems where addresses are stored as 4 / 16 raw bytes. IPv4 dotted-quad 192.168.1.1 becomes 0xC0A80101 in hex; IPv6 stays close to its native colon-hex form. The ZTools IP to Hex Converter handles both versions, supports CIDR notation, and outputs in multiple formats (packed, byte-spaced, with / without 0x prefix).
Use cases
- Decode a packet capture. tcpdump shows hex addresses; convert back to dotted-quad for human reading.
- Embedded systems / firmware. Static IP addresses stored as 4-byte arrays. Hex form is the canonical representation.
- Database storage. Some databases (PostgreSQL inet, MySQL VARBINARY) store IPs as bytes. Hex form is portable across systems.
- Verify subnet math. AND-ing an address with its netmask is easier visualised in hex than dotted-decimal.
How it works
- Paste IP. IPv4 (192.168.1.1) or IPv6 (2001:db8::1). Tool detects version automatically.
- Convert. IPv4: each octet → 2 hex digits → concatenated. IPv6: already hex, just normalised.
- Pick format. Packed (C0A80101), byte-spaced (C0 A8 01 01), 0x-prefixed (0xC0A80101), array of bytes ([192,168,1,1]).
- Reverse direction. Toggle to convert hex back to IP.
Examples
Input: 192.168.1.1
Output: Hex packed: C0A80101. Bytes: C0 A8 01 01. 0x form: 0xC0A80101.
Input: 10.0.0.1
Output: Hex: 0A000001. Easy to spot the leading 10 (= 0x0A).
Input: 2001:db8::1
Output: Already hex; full form 2001:0DB8:0000:0000:0000:0000:0000:0001.
Frequently asked questions
Why hex instead of decimal?
Hex maps cleanly to bits (4 bits per hex digit). Easier for bitmask math, firewall rules, low-level packet work. Dotted-quad is friendlier for humans navigating networks.
IPv6 already shows hex — why convert?
IPv6 in zero-compressed form (::1) hides leading zeros. Packed hex shows all 16 bytes for byte-level work.
CIDR support?
Yes — 192.168.0.0/24 converts the address; the prefix length stays as-is.
Privacy?
All in browser.
Pro tips
- For firewall rule debugging, convert both address and netmask to hex — bit operations become obvious.
- For database storage, packed bytes (no separators) is the most portable.
- For human reading, prefer dotted-quad — hex is for code and packet captures.
Reviewed by Ahsan Mahmood · Last updated 2026-05-06 · Part of ZTools.
For the full,
formatted version of this page, please enable JavaScript and reload
https://ztools.zaions.com/ip-to-hex.