IPv4 to Decimal
Convert IPv4 to decimal.
Loading tool…
About this tool
Enter an IPv4 address and get its 32-bit decimal value. Each octet is a byte of the number, so 192.168.1.1 becomes 3232235777. Integers make IP ranges easy to store and compare in a database.
How to use
1
Step 1
Enter an IPv4 address such as 192.168.1.1.
2
Step 2
Press Run.
3
Step 3
Copy the decimal number.
How it works
The four octets are combined as a base-256 number: a×256³ + b×256² + c×256 + d. For 192.168.1.1 that is 192×16,777,216 + 168×65,536 + 1×256 + 1.
decimal = a×256³ + b×256² + c×256 + d
Worked example
A private address
- Input
- 192.168.1.1
- Output
- 3232235777
- Walkthrough
- 192×16,777,216 = 3,221,225,472; plus 168×65,536 = 11,010,048; plus 256; plus 1 gives 3,232,235,777.
Limitations
- IPv4 only; IPv6 addresses are not converted.
- An invalid address (such as one with an octet over 255) returns an error.
Questions
How do I convert an IP address to a number?
Enter the IPv4 address and press Run to get the 32-bit integer.
What is 192.168.1.1 in decimal?
3232235777.
Why convert IPs to integers?
Integers are compact and make range checks (between start and end) a simple numeric comparison.
Can I convert back?
Yes, use the decimal to IPv4 tool.
Features
- 32-bit integer
- Validated input
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Learn JSON - Full Crash Course
freeCodeCamp.org
JSON is the payload format behind many developer tools here.
Watch on YouTubeTypeScript in 100 Seconds
Fireship
Typed JS snippets often get formatted or hashed nearby.
Watch on YouTube
- Introducing JSON
json.org
Canonical JSON grammar for formatters and validators.
- Regular expressions
MDN
JS regex guide aligned with browser-based testers.