IPv4 to Integer Converter
Enter an IPv4 address or an integer and choose the conversion direction.
Result
How it is calculated
Address to integer: for a.b.c.d the tool computes a × 16777216 + b × 65536 + c × 256 + d. Integer to address: a = floor(n / 16777216), then b, c and d are taken from the remainders after dividing by 65536 and 256. The hexadecimal result is the same number as eight hex digits, padded with zeros and prefixed with 0x.
The tool is strict: a dotted address needs exactly four decimal parts, each 0 to 255, and an integer must be plain digits from 0 to 4294967295. Anything else, including a number in the wrong direction mode, gives no result. Leading zeros are read as ordinary decimal (010 is ten, not octal eight). The integer is shown with thousands separators, but when converting back you must type it without them.
Worked example
Take 192.168.1.10 in address-to-integer mode. The four octets are weighted: 192 × 16777216 = 3,221,225,472; 168 × 65536 = 11,010,048; 1 × 256 = 256; and 10. Adding them gives 3,232,235,786. In hexadecimal, the octets 192, 168, 1 and 10 are C0, A8, 01 and 0A, so the tool also shows 0xC0A8010A. Switching to integer-to-address mode and entering 3232235786 returns 192.168.1.10 again.
Common mistakes
- Leaving the mode on address-to-integer while typing a number (or the other way round). The input then does not match the expected format and nothing is returned.
- Typing the integer with thousands separators such as 3,232,235,786. When converting to an address, only digits are accepted, so type 3232235786.
- Entering an octet above 255 (for example 192.168.1.256) or fewer than four parts. Both are rejected rather than corrected.
- Assuming leading zeros mean octal, as some older tools treat them. Here 010.000.000.001 is read as decimal 10.0.0.1 and gives 167,772,161.
- Using the result for IPv6 or for a signed 32-bit field. This covers IPv4 only, and the integer is unsigned, so values above 2147483647 appear as large positive numbers.
About this calculator
An IPv4 address written in dotted-decimal form (like 192.168.1.1) is really a 32-bit unsigned integer split into four 8-bit octets. Converting to integer form multiplies each octet by its positional weight — 256³, 256², 256¹, and 256⁰ — and sums the results, giving a single number from 0 to 4,294,967,295; the reverse operation splits that integer back into four octets.
This calculator performs the conversion in either direction and also shows the hexadecimal representation, since IP addresses are frequently stored, sorted, and compared as plain integers or hex values in databases, firewall rules, and network logs rather than as strings.
Working with the integer form makes range checks and CIDR-block math (is address X within subnet Y?) a simple numeric comparison instead of parsing and comparing dotted strings, which is why network engineers and backend developers convert between the two formats regularly.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
For a subnet membership test, convert the first and last address of the block and compare. The range 192.168.1.0/24 runs from 3232235776 (192.168.1.0) to 3232236031 (192.168.1.255), so any address whose integer falls between those two numbers is inside it, such as 192.168.1.10 at 3232235786. The tool converts one value at a time and does not take a CIDR prefix. Where do you store addresses as integers: a database column, a log, or a firewall rule?