在線即時計算器 · 純前端本地秒算 · 零數據上傳

🧰 Cidr 計算機

專業免費的 Cidr 計算機。純前端本機毫秒級計算、零資料上傳、極致隱私保護。提供詳細公式推導、實例示範與常見問答。

即時推算結果 (Computed Output)
即時試算完成
專業公認計算模型,即時運算完畢
📜 計算歷史記錄 (試算軌跡)
尚無歷史記錄,每次點擊「計算」將在此留下試算軌跡...

What is CIDR?

CIDR (Classless Inter-Domain Routing) is a method for allocating IP addresses and routing Internet Protocol packets. It was introduced in 1993 to replace the previous addressing architecture of classful network design in the Internet. CIDR addresses include a network address and the routing prefix length, written in a format like 192.168.1.0/24.

The CIDR notation combines the network address with a suffix that indicates the number of bits used for the network portion. For example, in 192.168.1.0/24, the "/24" indicates that the first 24 bits are used to identify the network, leaving 8 bits for host addresses.

When to Use a CIDR Calculator

A CIDR calculator is an essential tool for network administrators and IT professionals in various scenarios:

  • Network Planning: When designing or expanding a network infrastructure and needing to allocate IP address ranges efficiently.
  • Subnet Configuration: When configuring routers, firewalls, or other network devices that require subnet mask information.
  • Troubleshooting Network Issues: When diagnosing connectivity problems related to IP addressing or routing configuration.

How to Calculate CIDR Information

CIDR calculations involve several formulas to determine network properties:

CIDR = IP / p
\begin{aligned} Mask &= first p bits set to 1 \\ Network &= IP \mathbin{\&} Mask \\ Broadcast &= IP \mid (\lnot Mask) \\ Hosts &= 2^{ 32 - p} - 2 \end{aligned}

Subnet Mask Calculation: Convert the CIDR prefix to a dotted-decimal subnet mask.

Network Address: Bitwise AND operation between IP address and subnet mask.

Broadcast Address: Bitwise OR operation between IP address and inverted subnet mask.

Total Available Hosts: 2^{(32-prefix)} - 2

First Usable Host: Network address + 1

Last Usable Host: Broadcast address - 1

Wildcard Mask: Bitwise NOT of the subnet mask (255.255.255.255 - subnet mask)

Examples

Example 1: Basic CIDR Calculation

Calculate the network information for the CIDR notation 192.168.1.0/24.

Parameter Value
IP Address 192.168.1.0
CIDR Prefix 24
Subnet Mask 255.255.255.0
Network Address 192.168.1.0
Broadcast Address 192.168.1.255
First Usable Host 192.168.1.1
Last Usable Host 192.168.1.254
Total Hosts 254
Wildcard Mask 0.0.0.255

Example 2: Small Network Segment

Calculate the network information for the CIDR notation 10.0.0.0/28.

Parameter Value
IP Address 10.0.0.0
CIDR Prefix 28
Subnet Mask 255.255.255.240
Network Address 10.0.0.0
Broadcast Address 10.0.0.15
First Usable Host 10.0.0.1
Last Usable Host 10.0.0.14
Total Hosts 14
Wildcard Mask 0.0.0.15

Example 3: Large Enterprise Network

Calculate the network information for the CIDR notation 172.16.0.0/16.

Parameter Value
IP Address 172.16.0.0
CIDR Prefix 16
Subnet Mask 255.255.0.0
Network Address 172.16.0.0
Broadcast Address 172.16.255.255
First Usable Host 172.16.0.1
Last Usable Host 172.16.255.254
Total Hosts 65,534
Wildcard Mask 0.0.255.255

CIDR Prefix Reference Table

CIDR Prefix Subnet Mask Number of Networks Hosts per Network
/32 255.255.255.255 2^{32} 1
/31 255.255.255.254 2^{31} 2*
/30 255.255.255.252 2^{30} 2
/28 255.255.255.240 2^{28} 14
/24 255.255.255.0 2^{24} 254
/22 255.255.252.0 2^{22} 1,022
/20 255.255.240.0 2^{20} 4,094
/16 255.255.0.0 2^{16} 65,534
/8 255.0.0.0 2^{8} 16,777,214

* Note: In /31 networks, all addresses are usable per RFC 3021 for point-to-point links.

Related Calculators

Enhance your network planning with these additional tools:

使用注意事項與精準校對原則(6 大核心守則)

📐 1. 嚴格對齊輸入量綱與單位

輸入各項數值時請務必確認量綱(例如小時、天數、金額、百分比),避免單位不匹配引發推算偏差。

🔒 2. 純前端本機毫秒級隱私保障

所有計算邏輯 100% 在您的終端瀏覽器內完成,資料絕不上傳伺服器,嚴格守護商業與個人隱私。

📊 3. 符合公認學術與產業計算模型

演算法嚴格遵循國際通用數學公式與標準計算模型,經多重情境交叉核對,數值嚴密精確。

📋 4. 一鍵複製與免登入 PDF 匯出

支援一鍵複製推算結果字串至剪貼簿,亦可直接點擊列印按鈕輸出純淨 PDF 工作報表。

🔄 5. 多情景敏感度動態對比

建議針對極端值與多組預期情景分別試算,觀察輸出數據的波動區間,輔助做出更穩健的決策。

🛡️ 6. 專業諮詢與日常參考免責聲明

本工具運算結果供日常排程、學業研習與事前參考之用,如涉及重大法規或投資決策請諮詢持證專家。