Beginner

IP位址轉整數轉換器

將IPv4位址轉換為32位元十進位整數(加上十六進位和二進位),或將整數轉換回點分四組表示法。

換算方向

Dotted-quad, each octet 0-255
Decimal integer
3,232,235,777

Dotted IP: 192.168.1.1

Hexadecimal
0xC0A80101
Binary
11000000.10101000.00000001.00000001
Dotted-quad
192.168.1.1
100%
0%
0%
0%
Octet 1
Octet 2
Octet 3
Octet 4
Each octet's weighted contribution to the 32-bit integer
Step by step
  1. 1

    Octet 1 contribution (×2²⁴)

    192 × 16,777,216 = 3,221,225,472
  2. 2

    Octet 2 contribution (×2¹⁶)

    168 × 65,536 = 11,010,048
  3. 3

    Octet 3 contribution (×2⁸)

    1 × 256 = 256
  4. 4

    Octet 4 contribution (×2⁰)

    1 × 1 = 1
  5. 5

    32-bit integer

    3,221,225,472 + 11,010,048 + 256 + 1 = 3,232,235,777
    Each octet scaled by its byte-position weight (256³, 256², 256, 1) then summed.
計算結果僅為一般資訊用途的估算值,並非專業建議——在仰賴重要結果之前,請務必自行獨立查證。 閱讀完整免責聲明.
快速解答

此計算機如何運作?

將每個IPv4八位組乘以其位置值(256³、256²、256、1)並求和,得到0至4294967295的32位元整數。例如,192.168.1.1變為3232235777。反向操作通過對256連續做除法和取餘數恢復點分四組位址。

公式
integer = a×16777216 + b×65536 + c×256 + d
How this is calculated

IPv4位址有四個八位組(a.b.c.d),每個都是0到255的8位元值。要將位址轉換為單一32位元數,每個八位組按其位置加權:第一個八位組乘以256³(16777216),第二個乘以256²(65536),第三個乘以256,最後一個乘以1。相加後得到0到4294967295的無符號整數。

反向過程中,整數被分解回八位組:a = floor(n / 16777216) mod 256,b = floor(n / 65536) mod 256,c = floor(n / 256) mod 256,d = n mod 256。結果重新組合為熟悉的點分四組字串。

十六進位形式是以16進位表示的整數(填充後為8位十六進位數字),二進位形式將每個八位組顯示為8位元組。工具驗證每個八位組保持在0-255範圍內,且任何整數輸入為無符號32位元範圍內的整數;超出範圍或格式錯誤的輸入不返回結果。

常見問題

IPv4位址為32位元,因此最大可能值為2³² − 1 = 4294967295,對應255.255.255.255。

許多資料庫和程式語言將該值存儲在64位元有符號long中以保持正數,因為32位元有符號整數超過2147483647後會溢位。數字本身仍是無符號32位元IPv4值。

不適用。IPv6位址為128位元並使用不同的十六進位表示法。此轉換器僅處理32位元IPv4位址。

也稱為

IP 轉整數
IP 轉十進位
IP 位址轉數字
整數轉 IP
ipv4 轉數字
IP 轉換器

APA

TG we-Calculate Editorial Team. (2026). IP位址轉整數轉換器 [Online calculator]. TG we-Calculate. https://we-calculate.com/zh-tw/calculator/ip-to-integer-converter

Chicago

TG we-Calculate Editorial Team. "IP位址轉整數轉換器." TG we-Calculate. 2026. https://we-calculate.com/zh-tw/calculator/ip-to-integer-converter.

IEEE

TG we-Calculate Editorial Team, "IP位址轉整數轉換器," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/zh-tw/calculator/ip-to-integer-converter

BibTeX

@misc{wecalculate_ip_to_integer_converter, title = {IP位址轉整數轉換器}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/zh-tw/calculator/ip-to-integer-converter}}, year = {2026}, note = {TG we-Calculate} }

這個計算機對您有幫助嗎?