cidr-calc

Calculate subnet information from CIDR notation. Use when the user asks to calculate a subnet, find the network address, broadcast address, host range, subnet mask, or number of hosts for an IP in CIDR notation like 192.168.1.0/24.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "cidr-calc" with this command: npx skills add ohernandez-dev-blossom/cidr-calc

CIDR Calculator

Given an IP address in CIDR notation, compute all subnet parameters: network address, broadcast, host range, subnet mask, wildcard mask, host counts, IP class, and binary representation.

Input

  • A CIDR notation string in the format A.B.C.D/N (e.g. 192.168.1.0/24)

Output

A structured result with these fields:

  • CIDR Notation (normalized)
  • Network Address
  • Broadcast Address
  • Subnet Mask
  • Wildcard Mask
  • First Usable Host
  • Last Usable Host
  • Total Hosts (2^(32-N))
  • Usable Hosts
  • IP Class (A / B / C / D Multicast / E Reserved)
  • Network Type (Private / Public)
  • Binary Representation of the IP

Instructions

  1. Validate the input. It must match \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}. Each octet must be 0–255. Prefix must be 0–32.
  2. Compute values using standard subnet math:
    • maskNum = (0xFFFFFFFF << (32 - prefix)) >>> 0
    • wildcardNum = ~maskNum >>> 0
    • networkNum = (ipNum & maskNum) >>> 0
    • broadcastNum = (networkNum | wildcardNum) >>> 0
    • totalHosts = 2^(32 - prefix)
    • usableHosts: if prefix == 32 → 1; if prefix == 31 → 2; else totalHosts - 2
  3. Determine IP class from first octet:
    • 1–126 → A; 128–191 → B; 192–223 → C; 224–239 → D (Multicast); 240–255 → E (Reserved); 127 → Loopback
  4. Determine private vs public:
    • Private: 10.x.x.x, 172.16–31.x.x, 192.168.x.x, 127.x.x.x (loopback)
  5. Compute binary as four 8-bit groups joined by dots.
  6. Present results in a clear labeled format.

Quick CIDR reference

CIDRSubnet MaskTotal Hosts
/8255.0.0.016,777,216
/16255.255.0.065,536
/20255.255.240.04,096
/22255.255.252.01,024
/24255.255.255.0256
/28255.255.255.24016
/30255.255.255.2524
/32255.255.255.2551

Options

  • Input is always a single CIDR string; no additional options.

Examples

Input: 192.168.1.0/24

Output:

CIDR Notation:   192.168.1.0/24
Network Address: 192.168.1.0
Broadcast:       192.168.1.255
Subnet Mask:     255.255.255.0
Wildcard Mask:   0.0.0.255
First Host:      192.168.1.1
Last Host:       192.168.1.254
Total Hosts:     256
Usable Hosts:    254
IP Class:        C
Network Type:    Private
Binary:          11000000.10101000.00000001.00000000

Input: 10.0.0.0/8

Output:

CIDR Notation:   10.0.0.0/8
Network Address: 10.0.0.0
Broadcast:       10.255.255.255
Subnet Mask:     255.0.0.0
Wildcard Mask:   0.255.255.255
First Host:      10.0.0.1
Last Host:       10.255.255.254
Total Hosts:     16,777,216
Usable Hosts:    16,777,214
IP Class:        A
Network Type:    Private
Binary:          00001010.00000000.00000000.00000000

Error Handling

  • If the input is not valid CIDR notation, say so and provide the expected format (A.B.C.D/N).
  • If an octet exceeds 255 or the prefix exceeds 32, explain the validation error.
  • If the user provides an IP without a prefix (e.g. 192.168.1.1), ask for the prefix length or assume /32.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Huo15 Openclaw Enhance

火一五·克劳德·龙虾增强插件 v5.7.8 — 全面适配 openclaw 2026.4.24:peerDep ^4.24 + build/compat 同步到 4.24 + 14 处 api.on 全部去掉 as any 改成 typed hook(hookName 联合类型 + handler 自动推断 Pl...

Registry SourceRecently Updated
General

Content Trend Analyzer

Aggregates and analyzes content trends across platforms to identify hot topics, user intent, content gaps, and generates data-driven article outlines.

Registry SourceRecently Updated
General

Prompt Debugger

Debug prompts that produce unexpected AI outputs — diagnose failure modes, identify ambiguity and conflicting instructions, test variations, compare model re...

Registry SourceRecently Updated
General

Indie Maker News

独行者 Daily - 变现雷达。读对一条新闻,少走一年弯路。每天5分钟,给创业者装上商业雷达。聚焦一人公司、副业、创业变现资讯,智能分类,行动导向。用户下载即能用,无需本地部署!

Registry SourceRecently Updated