Subnet to CIDR Converter
Convert a subnet mask (e.g. 255.255.255.0) to CIDR prefix notation (e.g. /24).
Inputs
CIDR Details
Results will appear here.
Network configurations written in older style often use dotted-decimal subnet masks (255.255.255.0) while modern tooling expects CIDR prefix notation (/24). This mismatch is a constant source of minor friction when migrating configurations, writing Terraform or Ansible scripts, or reconciling documentation from different eras of network management.
This tool accepts a subnet mask in dotted-decimal form and returns the CIDR prefix length, with validation to ensure the input is a legitimate contiguous mask. It also supports the reverse direction, converting a prefix length back to dotted-decimal for use in legacy systems.
オンラインでサブネットマスクをCIDR表記に変換する方法
- 1
サブネットマスクを入力
ドット区切り10進数形式(例: 255.255.255.0)でサブネットマスクを入力するか、CIDRプレフィックス長(例: /24)を入力して逆変換します。
- 2
形式を変換
ツールは対応するCIDRプレフィックス長(サブネットマスク→CIDR)またはサブネットマスク(CIDR→サブネットマスク)を即時計算して表示します。
- 3
結果をコピー
変換結果をルーター設定、ファイアウォールルール、ネットワーク文書化に使用します。
How Subnet Mask Conversion Works
A subnet mask is a 32-bit value where all network bits are 1 and all host bits are 0, and crucially these bits must be contiguous — no 0 bits may appear before a 1 bit when reading from the most significant side. The CIDR prefix length is the count of leading 1 bits, equivalent to 32 minus the count of trailing 0 bits.
Validation checks that the input has no non-contiguous 1 bits, which would indicate a wildcard mask or an erroneous value rather than a subnet mask. Values like 255.255.254.0 (/23) are valid but easily confused with 255.255.255.0 (/24) under time pressure — this tool removes ambiguity by showing both representations simultaneously.
FileCrank サブネットマスク→CIDRツールを使う理由
- ✓ 双方向変換: サブネットマスクとCIDRプレフィックス長の相互変換
- ✓ 標準IPv4サブネットマスクをすべてサポート
- ✓ 完全ブラウザ内で動作 — データを転送しない
- ✓ 登録不要で無料
- ✓ ネットワーク設定と文書化作業に最適
機能と仕様
よくある質問
How do I use the Subnet to CIDR Converter?
Enter either a dotted-decimal subnet mask (e.g., 255.255.255.0) or a CIDR prefix (e.g., /24) and the tool instantly converts to the other format.
What is CIDR prefix notation?
CIDR prefix notation uses a slash followed by a number (e.g., /24) to indicate how many bits from the left are the network portion. It is a compact alternative to writing out a full subnet mask.
How do I convert a subnet mask to CIDR manually?
Count the number of consecutive 1 bits in the binary representation of the subnet mask. For example, 255.255.255.0 in binary is 24 consecutive 1s, so it equals /24.
What does /24 mean in networking?
A /24 prefix means the first 24 bits are the network portion and the last 8 bits (32 - 24 = 8) are for host addresses. This equals a subnet mask of 255.255.255.0 and allows 256 total addresses (254 usable).
Does this converter send my data anywhere?
No. All subnet mask and CIDR conversions run entirely in your browser using binary arithmetic. Your network configuration data never leaves your device.
Why is CIDR notation easier than subnet masks?
CIDR notation (/24, /16, /8) is more compact than writing out full subnet masks (255.255.255.0, 255.255.0.0, 255.0.0.0). It is easier to compare subnets and communicate network sizes quickly.
Subnet-to-CIDR Converter vs. Online Subnet Calculators
Full-featured subnet calculators include this conversion as a side output among many fields, which can make the result easy to miss. This tool makes the conversion its sole purpose, producing an immediate, unambiguous answer with validation feedback — optimised for the common workflow of translating a single mask value from a config file or documentation.
関連ツール
FileCrank サブネットマスク→CIDRツールは、サブネットマスク(ドット区切り10進数)とCIDRプレフィックス長の双方向変換をサポートします。変換はブラウザ内でローカルに完結し、データを保存しません。アカウント不要で無料。
Advertisement