IP子网计算器:网络地址与IP范围
Calculate network address, broadcast address, usable IP range, and host count from any IP address and subnet mask or CIDR prefix.
Enter an IPv4 address and subnet mask (or CIDR prefix length) to see the complete network details including all usable host addresses.
IP子网计算器:网络地址与IP范围
Calculate network address, broadcast address, usable IP range, and host count from any IP address and subnet mask or CIDR prefix.
About the IP Subnet Calculator
IP subnetting is the technique of dividing a single IP address space into multiple smaller logical networks called subnets. Every device on an IPv4 network requires a unique IP address, and subnetting is the tool that organises those addresses into a coherent, manageable structure. Understanding subnetting is a foundational skill for network engineers, system administrators, and anyone studying for networking certifications such as CompTIA Network+, CCNA, or JNCIA.
Every IPv4 address is a 32-bit binary number typically written in dotted decimal notation: four groups of eight bits (octets), each from 0 to 255, separated by dots. The subnet mask is another 32-bit number that tells you which portion of the IP address identifies the network and which portion identifies the individual host. The network portion is represented by consecutive 1-bits starting from the left; the host portion is all 0-bits on the right. In CIDR (Classless Inter-Domain Routing) notation, the prefix length — the number after the slash, such as /24 — simply counts those leading 1-bits.
To find the network address, apply a bitwise AND between the IP address and the subnet mask. To find the broadcast address, set all host bits to 1 (bitwise OR with the wildcard mask). The first usable host is the network address plus one; the last usable host is the broadcast address minus one. The number of usable hosts is 2^(32-prefix) − 2, subtracting the network address and broadcast address that are reserved.
Subnet classes originate from the original classful addressing scheme. Class A addresses (1.x.x.x–126.x.x.x) used a /8 prefix, providing millions of hosts per network. Class B (128.x.x.x–191.x.x.x) used /16. Class C (192.x.x.x–223.x.x.x) used /24 with 254 hosts. Modern networks use CIDR, which allows any prefix length from /0 to /32 regardless of these historical class boundaries. Private address ranges (10.x.x.x, 172.16.x.x–172.31.x.x, and 192.168.x.x) are reserved for internal use and are never routed on the public internet.
The wildcard mask is the bitwise complement of the subnet mask, used in access control lists (ACLs) and routing protocols such as OSPF to specify which parts of an address should match. A wildcard mask of 0.0.0.255 means the last octet can be anything — it matches any host in the /24 subnet. The IP subnet calculator provides all of these derived values instantly, eliminating the error-prone manual binary arithmetic that makes subnet calculations a common stumbling block for networking students.
IP Subnet Calculator Examples
Common network configurations showing how different subnet masks affect address ranges and usable host counts.
| IP / Mask | Network / Hosts | Use Case |
|---|---|---|
| 192.168.1.100 / 255.255.255.0 (/24) | 192.168.1.0 — 254 usable hosts | Standard home and small-office network. Supports up to 254 devices. Range: 192.168.1.1–192.168.1.254. |
| 10.0.1.50 / 255.255.255.192 (/26) | 10.0.1.0 — 62 usable hosts | Small department subnet within a corporate network. Range: 10.0.1.1–10.0.1.62. Four /26 subnets fit inside a /24. |
| 172.16.100.200 / 255.255.0.0 (/16) | 172.16.0.0 — 65,534 usable hosts | Large corporate or campus network. Entire 172.16.x.x block; suitable for thousands of devices across multiple floors or buildings. |
| 10.0.0.5 / 255.255.255.252 (/30) | 10.0.0.4 — 2 usable hosts | Point-to-point router link. Only 2 usable addresses, ideal for connecting two routers with no wasted addresses. |
How to Use the IP Subnet Calculator
- Enter a valid IPv4 address in dotted decimal notation (e.g. 192.168.1.100) in the IP Address field.
- Enter the subnet mask in dotted decimal format (e.g. 255.255.255.0) or leave the subnet mask field empty and enter only the CIDR prefix length (e.g. 24).
- If you enter both a subnet mask and a CIDR prefix, the CIDR prefix takes precedence.
- Click Calculate to see the network address, broadcast address, usable host range, host count, wildcard mask, and binary mask.
- Use the results to plan your network layout, configure router interfaces, write ACLs, or study for networking exams.
IP Subnet Calculator FAQ
What is the difference between a subnet mask and a CIDR prefix?
They express the same information in different formats. A subnet mask such as 255.255.255.0 is a 32-bit number in dotted decimal notation. A CIDR prefix such as /24 counts the number of consecutive 1-bits in that mask. Both identify the network portion of the IP address; /24 and 255.255.255.0 are exactly equivalent.
Why are two addresses always reserved in a subnet?
The lowest address in any subnet (all host bits zero) is the network address, used to identify the subnet itself in routing tables. The highest address (all host bits one) is the broadcast address, used to send packets to all devices in the subnet simultaneously. Neither can be assigned to an individual host, so a /24 subnet has 256 total addresses but only 254 usable ones.
What subnet mask should I use for a small home network?
A /24 (255.255.255.0) is the standard choice. It provides 254 usable addresses — far more than most homes need — and is universally understood. Most home routers default to 192.168.1.0/24 or 192.168.0.0/24. If you need fewer addresses and want to practice subnetting, /28 gives 14 usable hosts, and /25 gives 126.
What are private IP address ranges?
RFC 1918 defines three private ranges not routed on the public internet: 10.0.0.0/8 (16.7 million addresses), 172.16.0.0/12 (1 million addresses across 172.16–172.31), and 192.168.0.0/16 (65,536 addresses). Devices using these ranges communicate with the internet through Network Address Translation (NAT) on a router.
What is a /32 subnet?
A /32 subnet mask (255.255.255.255) identifies a single host — there are no host bits, so only the exact address matches. It is used in host routes in routing tables to direct traffic to a specific device, and in loopback interface configurations. A /32 has zero usable hosts in the traditional sense because there is no network or broadcast address distinct from the host address.
How do I split a /24 into four equal subnets?
Add 2 bits to the prefix length: /24 becomes /26. Each /26 contains 64 addresses (62 usable hosts). The four subnets are: .0/26 (.1–.62), .64/26 (.65–.126), .128/26 (.129–.190), and .192/26 (.193–.254). The subnet boundary increments by 64 in the last octet. This calculator confirms the details for each individual subnet.
相关工具
PPI计算器 - 像素密度
输入分辨率和屏幕尺寸,计算任意显示器的像素密度(PPI)和点距,并比较显示器、电视和手机的清晰度。
降雨量计算器 - 降水量与体积
计算降雨量、强度、持续时间和体积,用于水文分析。适合气象人员、工程师和天气爱好者的免费在线工具。
鱼缸计算器:水量、鱼量与维护
计算鱼缸水体积、安全养鱼量、过滤流量和每周换水量,帮助你科学规划水族缸。
人像宽高比计算器 - 图像尺寸
计算 Instagram、TikTok 和印刷人像照片的宽高比与缩放尺寸,立即得到化简比例和对角线长度。
玛雅历转换器:公历转玛雅日期
将公历日期转换为玛雅长纪、卓尔金和哈布历,并支持玛雅日期反查公历。
Amdahl定律并行加速与效率计算器
使用Amdahl定律计算并行加速比、理论最大加速比、执行时间和并行效率,帮助规划多处理器系统并找出串行瓶颈。
垂直夸张计算器 - 地图比例尺
计算地形图和3D地形的垂直夸张比率。输入水平与垂直比例尺,立即得到 VE 结果。
宽高比计算器 - 屏幕、视频和图片比例
计算任意显示器、视频或图片的宽高比,立即获取简化 W:H 比例、小数值和最接近的标准格式名称。