IPv4 地址转换器
把 IPv4 地址转为十进制、十六进制、二进制和 CIDR 表示,查看子网范围、地址类别与是否为内网地址。
The 32-bit model
An IPv4 address is 32 bits, usually written as four decimal octets. Each octet is 8 bits and ranges from 0 to 255.
192.168.1.1
| | | |
| | | +-- 1 = 0x01
| | +----- 1 = 0x01
| +-------- 168 = 0xA8
+----------- 192 = 0xC0
The same address in binary is 11000000.10101000.00000001.00000001, and in hex it is C0A80101.
Address classes
| Class | First octet | Purpose |
|---|---|---|
| A | 1–126 | Large networks |
| B | 128–191 | Medium networks |
| C | 192–223 | Small networks |
| D | 224–239 | Multicast |
| E | 240–255 | Reserved / experimental |
Classful addressing is obsolete — CIDR replaced it in 1993 — but the labels persist in documentation and exam material.
Private ranges
| Range | RFC | Use |
|---|---|---|
10.0.0.0/8 | RFC 1918 | Large private networks |
172.16.0.0/12 | RFC 1918 | Medium private networks |
192.168.0.0/16 | RFC 1918 | Small private networks (home routers) |
127.0.0.0/8 | RFC 1122 | Loopback (127.0.0.1 = localhost) |
169.254.0.0/16 | RFC 3927 | Link-local / APIPA |
Anything in these ranges is not routable on the public internet. 192.168.x.x is the range most home routers hand out via DHCP.
Common gotchas
127.0.0.1is localhost;0.0.0.0means "all interfaces" when binding a server, and is not a valid destination address255.255.255.255is the limited broadcast address- Leading zeros are ambiguous — some parsers treat
010.1.1.1as octal - The loopback range
127.0.0.0/8is entirely reserved, not just127.0.0.1
常见问题
How is an IPv4 address stored?
As 32 bits, usually written as four decimal octets. Each octet is 8 bits and ranges from 0 to 255.
What is the difference between decimal, hex and binary forms?
They are the same 32 bits written three ways. 192.168.1.1 is 3232235777 in decimal, c0:a8:01:01 in hex, and 11000000.10101000.00000001.00000001 in binary.
What does the tool detect about my address?
Whether it falls in a private range, is a loopback address, or is link-local, plus its class and the host range of a /24 subnet.
Is 0.0.0.0 a valid destination?
No. It is a special value meaning "all interfaces" when binding a server, and it is not routable as a destination address.
What is 127.0.0.1?
The loopback address, pointing back at your own machine. The entire 127.0.0.0/8 range is reserved, not just that one address.