192.168.1.132322357770xC0A8010111000000.10101000.00000001.00000001::ffff:192.168.1.1About IPv4 Address Converter
An IPv4 address is fundamentally a 32-bit integer that can be written as dotted decimal (192.168.0.1), a decimal integer (3232235521), hexadecimal (0xC0A80001), or binary. This tool converts an IPv4 address between these bases locally in your browser, handy for storing in integer columns, doing bitwise work, or checking low-level data. For example, it converts the private address 192.168.1.1 to hex C0A80101 or the integer 3232235777, handy for cross-checking numeric IP fields in packet captures.
Dotted and integer forms are two representations of one address, and treating them as different things breaks comparisons. The integer form combines four bytes in a fixed order, so numeric order matches address order and testing whether an address falls inside a range becomes one numeric comparison, while the dotted form reads well but computes poorly. That mapping underpins the choice of representation.
The integer form wins in databases and indexes, which matters at scale. Storing it needs four bytes and both comparison and sorting are numeric, so range queries use greater-than and less-than directly, while a string occupies more space and sorts lexicographically into the wrong address order. Any scenario retrieving addresses by range or order favours the integer form.
Overflow and sign are the most common implementation mistakes. An address whose top bit is set, usually in the larger ranges, exceeds a signed thirty-two-bit integer when combined, and handling it as signed turns it negative, corrupting both comparison and display. Use an unsigned or wider integer type for intermediate values to avoid sign differences across languages.
Byte order needs an explicit convention when exchanging binary data. The same four bytes read under the two endiannesses give opposite results, so one side writing network order and the other reading host order yields a very different address. The dotted text form avoids this, so prefer text when the peer implementation is uncertain.
A further class embeds one address inside a larger structure, and conversion must recognise it. Such addresses live in a different space numerically and are not equivalent to native ones, so treating the two as the same value in deduplication or counting misstates the scale. Where both appear, normalise to one form before comparing rather than comparing integers or strings directly.
Finally, an address is identifiable information with boundaries during conversion and bulk handling. Storing addresses as integers does not reduce sensitivity and can lower caution during export or sharing because they are harder to read by eye. Manage bulk output as internal material and mask where possible, keeping only the network portion, rather than exporting in full.
How It Works Internally
One address has several notations: dotted decimal, a single integer, hexadecimal and others, all representing the same 32-bit value, so converting between them needs no lookup. The real hazard is byte order — interpreting the integer form as big or little endian yields an entirely different address, so the order must be agreed across systems.
192.168.1.1As an integer 3232235777 (192×2²⁴ + 168×2¹⁶ + 1×2⁸ + 1, computed directly rather than looked up)Measured on This Page
| Baseline before | Five malformed inputs were silently accepted: hex -1 became 255.255.255.255, 33-bit hex wrapped, decimal 1.5 truncated to 1, +5 read as 5, and 33-bit binary wrapped |
|---|---|
| Cause | The old code ran Number()/parseInt() then >>> 0, which reduces negatives and values above 32 bits modulo 2^32 — silently rewriting the input |
| Fix | Each format is validated against its own syntax first (regex), then against the 32-bit bound, and rejected otherwise |
| Valid inputs | All 12 valid cases match Python, including the 4294967295 boundary and the leading-zero form 192.168.01.1 |
| Outputs | Dotted, decimal, eight-digit uppercase hex, byte-grouped binary and the IPv4-mapped IPv6 form are all correct |
The classic failure here is treating anything number-shaped as a number: -1, 1.5 and 33-bit binary all become a plausible-looking IPv4 after >>> 0, and the user cannot tell their input was rewritten. The correct order is validate the spelling for that format, then bound-check. Note that 4294967296 and 0x1FFFFFFFF exceed 32 bits and must be rejected rather than wrapped — a wrapped address points at an entirely different machine.
How to Use
- Open "IPv4 Address Converter"
- Pick the input format and enter the address
- Every other notation appears below immediately
- The IPv4-mapped IPv6 form is listed as well
- Copy the notation you need with its row icon
Use Cases
- Integer storage — Convert IPs to unsigned integers for a database INT column to speed range queries and indexing.
- Bitwise debugging — View an IP in binary to understand intermediate results of masking and subnet math.
- Hex cross-check — Reconcile with address representations in packet captures or hex logs.
- Config compatibility — Produce integer or hex IP forms for legacy systems and firmware that expect them.
- Reverse lookup — Turn an integer IP from a log back into readable dotted decimal for troubleshooting.
- CIDR boundary — Convert a network address to its integer form to compute the range boundaries of a CIDR block.
- Log analysis — Turn integer IPs from parsed logs back into dotted decimal for human-readable troubleshooting.
FAQ
How is dotted decimal converted to an integer?
For a.b.c.d compute a*256^3 + b*256^2 + c*256 + d. For example, 192.168.0.1 = 192*16777216 + 168*65536 + 0 + 1 = 3232235521.
Why is the integer range 0 to 4294967295?
IPv4 is 32-bit, representing 2^32 values, i.e., 0 to 4294967295 (2^32 - 1). Integers outside this range are not valid IPv4.
Why does hex often carry a 0x prefix?
0x is the conventional hexadecimal prefix for programs to recognize. 192.168.0.1 maps to 0xC0A80001, with each two hex digits forming one byte.
What if I need subnet calculations?
This tool only converts bases. For network/broadcast addresses or host counts, use our IPv4 Subnet Calculator.
Can it convert IPv6?
No, this tool targets 32-bit IPv4 only. IPv6 is 128-bit in colon-hex notation with different rules.
What is an IP-as-integer good for?
Integer form makes range checks and storage efficient: testing whether an IP falls in 192.168.1.0/24 becomes a numeric interval comparison instead of string parsing. IP databases, firewall rules and CDN routing all work on integers internally.
Why do some systems accept odd notations like 192.168.257?
Legacy inet_aton accepts shortened forms (the last field as 16 bits, etc.), so 192.168.257 actually equals 192.168.1.1 — a flexibility once used to bypass filters. This tool validates strict dotted-quad form and rejects non-standard input.
How do I convert a subnet mask to a CIDR prefix?
255.255.255.0 has 24 leading ones, so it equals /24. Per octet: 255 = 8 bits, 254 = 7, 252 = 6, 248 = 5, 240 = 4, 224 = 3, 192 = 2, 128 = 1. The tool converts both ways — enter either form to get the other.