IPv4 Converter
IPv4 Converter
Convert between IPv4 addresses and decimal, binary, or hexadecimal formats.
Conversion Result
IPv4 addresses have multiple representations: human-readable dotted decimal (e.g., 192.168.1.1), 32-bit integers for computer storage, binary, and hexadecimal. When studying network protocols, analyzing logs, writing ACL rules, or processing low-level scripts, you frequently need to switch between different bases. This tool provides 4-way conversion capability — enter any format to instantly get the other three representations. All calculations run locally in your browser, no internet required, results appear instantly.
Related
Use Cases
- When learning network protocols, convert dotted IPs to binary to observe subnet mask bitwise operations and understand the division principle between network and host addresses
- When writing firewall ACL rules or routing tables, convert IPs to decimal integers for range matching, or to hexadecimal for packet analysis
- When analyzing network logs, convert decimal or hexadecimal IPs in logs back to dotted format to quickly identify source addresses
- When writing Python/Shell scripts to process IP data, use this tool first to verify conversion results before writing logic into code
- During network operations troubleshooting, compare the same IP in different bases to help diagnose subnet boundary and address conflict issues
How to Use
- Enter an IPv4 address (dotted decimal format, e.g., 192.168.0.1) or decimal integer (0–4294967295) in the input box
- The tool automatically detects the input format and completes 4-way conversion in real time — no button click needed
- View the four result fields: IPv4 (dotted decimal), Decimal (integer), Binary (32-bit), and Hex (8-digit hexadecimal)
- Click the "Copy JSON Result" button to copy the complete conversion results to your clipboard for use in scripts or documentation
Features
- 4-way conversion: Automatic conversion between dotted decimal, decimal integer, 32-bit binary, and 8-digit hexadecimal — enter once to see all four results simultaneously
- Smart detection: Automatically identifies whether input is a dotted IP or decimal number, enabling bidirectional conversion without format switching
- Range validation: Automatically validates IP legality and decimal integer range (0–4294967295), with instant prompts for invalid input
- Pure client-side calculation: All conversions run locally in the browser with no data sent to any server — zero latency and zero privacy risk
- One-click JSON copy: Copy conversion results in JSON format with one click, convenient for pasting into scripts, config files, or technical documentation
FAQ
Why convert IPv4 to different bases?
Different scenarios use different representations: dotted decimal for human reading, decimal integers for database storage and range comparison, binary for subnet mask bitwise operations, and hexadecimal for packet analysis and protocol debugging. Mastering base conversion helps you understand the underlying structure of IP addresses.
Does it auto-detect decimal number input?
Yes. The tool automatically determines whether input is in dotted IP format (e.g., 192.168.1.1) or pure numeric (e.g., 3232235777), enabling bidirectional conversion without mode switching. Numbers are validated to be within the range 0–4294967295.
Are conversion results uploaded to a server?
No. All conversion logic runs entirely locally in your browser via JavaScript. Neither input nor results are sent to any server — zero privacy risk, zero network latency.
Why is binary output shown as a continuous 32-bit string instead of four groups?
Binary results display the complete 32-bit continuous string (32 zeros or ones total) for convenient observation of the entire address bit pattern. You can split into octets by referencing each 8-bit boundary. The reference table shows four-group binary format for learning purposes.
Does hexadecimal output match what I see in Wireshark?
Yes. Hexadecimal results use 0x-prefixed 8-digit hex representation (e.g., 0xC0A80101), consistent with network byte order as shown in packet capture tools like Wireshark, and can be directly used for protocol analysis.
Does it support IPv6 address conversion?
The current tool only supports IPv4. For IPv6-related tools, you can use the site's IPv6 Toolbox. IPv4 is 32-bit while IPv6 is 128-bit, and their base conversion logic differs significantly.
How do I convert IP to integer in code?
Most languages have built-in functions: Python uses the ipaddress module (int(ipaddress.IPv4Address('192.168.1.1'))), PHP uses ip2long(), MySQL uses INET_ATON(), and C uses inet_pton(). We recommend first verifying your conversion results with this tool.
Glossary
- Dotted Decimal
- The most common human-readable IPv4 format, dividing the 32-bit address into four 8-bit groups, each converted to a decimal number 0–255 and connected by dots, e.g., 192.168.1.1.
- Decimal Integer
- Treating the 32-bit IPv4 address as a single unsigned integer in the range 0–4294967295. Commonly used for database storage (e.g., MySQL's INET_ATON function) and range comparison.
- Binary
- The raw 32-bit binary representation of an IPv4 address, with 8 bits per octet. Bitwise operations for subnet masks and CIDR prefixes all occur at the binary level.
- Hexadecimal
- An 8-digit hexadecimal representation prefixed with 0x, where each 2 digits correspond to one octet. Commonly seen in packet capture analysis (e.g., Wireshark) and low-level protocol debugging.
- Octet
- Each dot-separated 8-bit segment in an IPv4 address is called an octet, with values from 0–255. Four octets make up the complete 32-bit address.
- Network Byte Order
- TCP/IP protocols specify Big-Endian for transmitting multi-byte data, meaning the most significant byte comes first. The writing order of dotted decimal is consistent with network byte order.
- CIDR (Classless Inter-Domain Routing)
- A notation using a /prefix length to indicate network bits, e.g., /24 means the first 24 bits are network bits and the last 8 bits are host bits.
- Subnet Mask
- A 32-bit binary number where network bits are all 1s and host bits are all 0s, used to distinguish the network portion from the host portion of an IP address, e.g., 255.255.255.0.
- Wildcard Mask
- The bitwise NOT of a subnet mask, where 0 means must match and 1 means ignore. Used in ACL and routing configurations, e.g., 0.0.0.255 corresponds to /24.
- INET_ATON / INET_NTOA
- Classic function names for IP address-to-integer conversion. ATON (ASCII to Number) converts dotted IP to integer; NTOA (Number to ASCII) does the reverse. Available in MySQL, PHP, and C.
Common IPv4 Address Ranges and Base Comparison
0.0.0.0 | 0 | 0x00000000 | 00000000 00000000 | Default route / unspecified address |
10.0.0.0 | 167772160 | 0x0A000000 | 00001010 00000000 | Private Class A address range start |
127.0.0.1 | 2130706433 | 0x7F000001 | 01111111 00000000 | Local loopback address |
172.16.0.0 | 2886729728 | 0xAC100000 | 10101100 00010000 | Private Class B address range start |
192.168.0.0 | 3232235520 | 0xC0A80000 | 11000000 10101000 | Private Class C address range start |
192.168.1.1 | 3232235777 | 0xC0A80101 | 11000000 10101000 | Common home router default gateway |
255.255.255.0 | 4294967040 | 0xFFFFFF00 | 11111111 11111111 | /24 subnet mask |
255.255.255.255 | 4294967295 | 0xFFFFFFFF | 11111111 11111111 | Limited broadcast address |
Reserved/Special IPv4 Address Range Quick Reference
0.0.0.0/8 | This Network | 0 – 16777215 | Represents "this host on this network", used only as source address |
10.0.0.0/8 | Private Class A | 167772160 – 184549375 | Enterprise internal network, not routed on the public internet |
127.0.0.0/8 | Loopback | 2130706432 – 2147483647 | Local loopback testing, packets never leave the network interface |
169.254.0.0/16 | Link-Local | 2851995648 – 2852061183 | Auto-assigned when DHCP fails (APIPA) |
172.16.0.0/12 | Private Class B | 2886729728 – 2887778303 | Enterprise internal network, not routed on the public internet |
192.168.0.0/16 | Private Class C | 3232235520 – 3232301055 | Home/small office internal networks |
224.0.0.0/4 | Multicast | 3758096384 – 4026531839 | Multicast addresses |
240.0.0.0/4 | Reserved | 4026531840 – 4294967295 | Reserved for experimental use; 255.255.255.255 is broadcast |
Authoritative References
- Authentication Header Generator
- Cache-Control Parser
- Content-Disposition Parser
- CORS Header Generator
- CORS Inspector
- CSP Generator
- cURL to Code Generator
- DNS Propagation Checker
- DNS Lookup
- Forwarded Header Parser
- Hreflang Tag Generator
- HSTS Analyzer
- HTTP Cookie Parser
- HTTP Headers Checker
- HTTP Request Tester
- HTTP Status Codes Lookup
- IP Lookup
- IPv4 Converter
- IPv4 Range Expander
- IPv6 Toolbox
- Link Header Parser
- MX Lookup
- Port Checker
- URL Parameter Builder
- Rate Limit Header Parser
- Redirect Chain Checker
- Robots.txt Generator
- Robots.txt Checker
- Security Headers Checker
- Security.txt Generator
- Set-Cookie Parser
- Site Network Audit
- Sitemap Generator
- Sitemap Inspector
- SSL Certificate Checker
- Subnet Calculator
- URL Parser
- User-Agent Parser
- UTM Link Generator
- WebSocket Tester
- What Is My IP?
- WHOIS Lookup