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.
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.
Try it nowβ
The full ip-to-hex runs in your browser at https://ztools.zaions.com/ip-to-hex β no signup, no upload, no data leaves your device.
Last updated: 2026-05-06 Β· Author: Ahsan Mahmood Β· Edit this page on GitHub