FIRST CH TOOLS / Development / 49 CIDR CALCULATOR
IP / CIDR Calculator
Type a block such as 192.168.1.0/24 and read off the network address, broadcast address and the range and count of usable hosts straight away. Split a network into subnets, check an address before you add it to an allow list, and reduce an arbitrary IP range to the smallest set of CIDR blocks — all on one page, for both IPv4 and IPv6.
1 — CIDR or subnet mask
2 — Results
The prefix length says how many bits from the left identify the network. Addresses that share the bold part live on the same network.
3 — Is this address inside the block?
4 — Split into subnets
Divides one network into equally sized subnets — the allocation table you need when handing out address space per VLAN or per team (the first 128 rows are listed).
5 — IP range → smallest CIDR set
Nothing you type leaves the browser — every calculation runs on this page. Settings can be passed in the URL: /en/cidr/?cidr=10.0.0.0/16&split=20 / /en/cidr/?cidr=192.168.1.0/24&ips=192.168.1.77,10.0.0.1 / /en/cidr/?range=10.0.0.5-10.0.0.200;10.0.1.0/24 (use ; between lines).
How to Use
- Paste the blockCopy the 10.0.0.0/16 style notation from your router or cloud console. A plain subnet mask such as 255.255.255.0, or the wildcard mask used in ACLs, is understood as well.
- Read the rangeYou get the network address, the broadcast address and the usable host range. “+1 bit” and “−1 bit” let you compare what happens when the block is halved or doubled.
- Copy it into the configTake the subnet allocation table or the block for your allow list. When all you have is a start and an end address, use the last panel to turn it into the fewest CIDR blocks first.
About This Tool
The 24 in /24 means the leftmost 24 bits identify the network. An IPv4 address is a 32-bit number: the front part names the network, the rest numbers the hosts inside it. Move the boundary by a single bit and the number of hosts doubles or halves — /24 holds 256 addresses (254 usable), /25 holds 128 (126). That boundary is exactly what a subnet mask expresses, which is why 255.255.255.0 and /24 are two ways of saying the same thing.
The first and last addresses are normally not usable. The first one names the network itself and the last one is reserved for broadcasts to everyone on it, which is why a /24 gives you 254 hosts rather than 256. There are two exceptions: on a /31 both addresses may be assigned, because it exists for point-to-point links between routers (RFC 3021), and a /32 names a single host — the form you normally use in an allow list. IPv6 has no broadcast address at all.
Going from a range back to CIDR is the part that is hard to do in your head. Someone asks you to allow 192.168.1.5 through 192.168.1.200, but the firewall or security group only accepts CIDR. That range does not line up with a single block, so it has to be covered by a mix of /32 through /26 blocks. Round up and you let strangers in; round down and you lock out the people you meant to admit. This tool merges overlapping ranges first and then emits the minimum number of blocks that cover them exactly.
Blocks reserved for a special purpose — the private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), loopback, or the documentation range 203.0.113.0/24 — are labelled as such in the results. For neighbouring server chores see the Unix Time Converter, the Cron Explainer and the Hash Generator.
IPv4 prefix cheat sheet
| CIDR | Subnet mask | Addresses | Hosts | Typical use |
|---|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,216 | 16,777,214 | All of 10.0.0.0/8 |
| /16 | 255.255.0.0 | 65,536 | 65,534 | A VPC or a site |
| /20 | 255.255.240.0 | 4,096 | 4,094 | Cloud subnet |
| /24 | 255.255.255.0 | 256 | 254 | One floor or segment |
| /26 | 255.255.255.192 | 64 | 62 | Small team or VLAN |
| /28 | 255.255.255.240 | 16 | 14 | A handful of servers |
| /29 | 255.255.255.248 | 8 | 6 | Static IPs from an ISP |
| /30 | 255.255.255.252 | 4 | 2 | Router-to-router link |
| /31 | 255.255.255.254 | 2 | 2 | Point-to-point (RFC 3021) |
| /32 | 255.255.255.255 | 1 | 1 | A single host in an allow list |
Where subnet maths goes wrong
Leaving host bits set in a config file
192.168.1.130/24 ← as a /24 network this means 192.168.1.0/24
Written into an allow list or a route, some implementations silently treat it as 192.168.1.0/24, so a rule meant for one machine opens up 254 of them; others reject it as a syntax error, and you cannot rely on which you will get. Use /32 for a single host and the network address for a whole block. This tool tells you when the address you typed is not the network address, and shows the block it belongs to.
Misremembering the private ranges
172.16.0.0 – 172.31.255.255 ← 172.16.0.0/12 (172.16 through 172.31) 172.16.0.0/16 ← assuming it stops here is how collisions happen
The 10 and 192.168 ranges are easy, but the 172 range is a /12: the second octet runs from 16 to 31. Address collisions in site-to-site VPNs and VPC peering usually trace back to misreading those sixteen blocks. When designing a new network, pick a corner that will not clash with whoever you may connect to later.
Subnets only start on aligned boundaries
192.168.1.0/26 0 – 63 ← always aligned to multiples of 64 192.168.1.64/26 64 – 127 192.168.1.100/26 ← cannot start here
A block must begin at a multiple of its own size, so a /26 (64 addresses) starts at 0, 64, 128 or 192. “Sixty addresses starting at 100” is not expressible as one block and breaks into several. Design by rounding the host count up to a power of two first, then choosing where it sits.
A bigger number means a smaller block
/16 > /24 > /28 ← the larger the number, the narrower the block
The prefix length counts the bits you pin down, so a larger number leaves fewer bits for hosts. Routers prefer the longest (narrowest) match, which means a specific route added next to a broad one wins for the addresses it covers. That is how a rule you believed applied to everything ends up overridden for part of the range.
Treating IPv6 as “IPv4 with more digits”
2001:db8:abcd::/48 → 65,536 subnets of /64 never split below /64 (SLAAC stops working)
In IPv6 the mechanism that lets hosts build their own address (SLAAC) assumes a /64, so LAN segments are always /64. There is no need to economise: when your ISP hands you a /48 or a /56, carve it into /64s. There is no broadcast address either — multicast (ff00::/8) takes that role.
Putting a private address in an allow list
192.168.1.0/24 ← correct inside your office, meaningless to an outside service
What a SaaS or API allow list needs is the global address the internet sees you as. Registering the private address your laptop happens to have achieves nothing, because NAT rewrites it on the way out. This tool labels the type of every block you enter, so check that you are not about to send something marked “private” to an external vendor.
Other Tools
- 01Batch Image → WebP ConverterWebP Converter
- 02White Background RemoverWhite BG Remover
- 03WCAG Contrast CheckerContrast Checker
- 04Character CounterCharacter Counter
- 05llms.txt Generatorllms.txt Generator
- 06JSON-LD GeneratorJSON-LD Generator
- 07Markdown → PDFMD → PDF
- 08OGP Meta Tag WizardOGP Wizard
- 09Favicon GeneratorFavicon Generator
- 10TikTok PublisherTikTok Publisher
- 11Encoding & Line Ending ConverterEncoding Converter
- 12Batch Image → AVIF ConverterAVIF Converter
- 13Test Data GeneratorTest Data Generator
- 14Marp Markdown → SlidesMarp Slides
- 15Text & Code Diff CheckerDiff Checker
- 16Cron Expression ExplainerCron Explainer
- 17Base64 & Data URI EncoderBase64 & Data URI
- 18URL Parameter Editor & UTM BuilderURL Parameters
- 19HTML Entity Escape & UnescapeHTML Escape
- 20JSON ⇄ YAML ConverterJSON ⇄ YAML
- 21PX ⇄ REM / EM ConverterPX ⇄ REM / EM 単位変換
- 22Color Converter & AlphaColorコード変換&アルファ透過
- 23MD5 / SHA-256 Hash Generatorハッシュ生成
- 24JWT Decoder & Expiry CheckerJWTデコーダー&有効期限チェッカー
- 25User-Agent ParserUser-Agent解析&デバイス判定
- 26UUID & ULID GeneratorUUID (v4) & ULID 一括生成
- 27Aspect Ratio Calculatorアスペクト比計算&サイズ算出
- 28Markdown Table & CSV/TSV ConverterMarkdownテーブル整形&CSV/TSV変換
- 29SQL Query FormatterSQLクエリフォーマッター&整形
- 30QR Code GeneratorQR Code Generator
- 31Regex Tester正規表現テスター
- 32Unix Timestamp ConverterUNIXタイムスタンプ⇄日時変換
- 33New Tab Memo新規タブメモ帳
- 34Image Resizer & Cropper画像リサイズ&クロップ
- 35EXIF Viewer & RemoverEXIF情報の確認&除去
- 36robots.txt Generatorrobots.txt ジェネレーター
- 37Password Generator安全なパスワード生成
- 38Case Converter文字列ケース変換
- 39CSV/TSV ⇄ JSON ConverterCSV/TSV ⇄ JSON 相互変換
- 40PDF Merge, Split & ExtractPDF結合・分割・ページ抽出
- 41Full-width ⇄ Half-width Converter全角⇄半角変換&テキストクリーナー
- 42X (Twitter) Post CounterX(Twitter)投稿の文字ウェイト計算
- 43CSS clamp() Fluid Typography CalculatorCSS clamp() 計算機
- 44CSS Gradient GeneratorCSSグラデーションジェネレーター
- 45Image Colour Palette Extractor画像からカラーパレット抽出
- 46QR Code ReaderQRコード読み取り
- 47SVG Optimizer & Data URISVG最適化&data URI化
- 48Redirect Generatorリダイレクトルール ジェネレーター