{"uid":"cap_k0yyIfEUbdwKbRMKQUAiE","slug":"network-calc-ipv4-netmask-converter-7f6b6031","name":"Network Calc: IPv4 Netmask Converter","description":"Convert an IPv4 prefix length, netmask, wildcard or hex mask into every other form with host counts; flags bad masks.","url":"https://network-calc.x402tookit.com/netmask-convert?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["input"],"properties":{"input":{"type":"object","required":["type","method"],"properties":{"type":{"type":"string","const":"http"},"method":{"enum":["GET"],"type":"string"},"queryParams":{"type":"object","required":["value"],"properties":{"value":{"type":"string","description":"/24, 24, 255.255.255.0, wildcard 0.0.0.255 or hex 0xffffff00"}}}},"additionalProperties":false},"output":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"example":{"type":"object","properties":{"hex":{"type":["null","string"]},"asOf":{"type":["null","string"]},"valid":{"type":["boolean","null"]},"binary":{"type":["null","string"]},"source":{"type":["null","string"]},"netmask":{"type":["null","string"]},"reasons":{"type":["array","null"],"items":{"type":"string"}},"summary":{"type":["null","string"]},"verdict":{"type":["null","string"]},"degraded":{"type":["boolean","null"]},"hostBits":{"type":["null","number"]},"wildcard":{"type":["null","string"]},"inputKind":{"type":["null","string"]},"cidrSuffix":{"type":["null","string"]},"disclaimer":{"type":["null","string"]},"notChecked":{"type":["array","null"],"items":{"type":"string"}},"networkBits":{"type":["null","number"]},"usableHosts":{"type":["null","number"]},"prefixLength":{"type":["null","number"]},"totalAddresses":{"type":["null","number"]},"classfulDefault":{},"subnetsOfPrefix24":{"type":["null","number"]},"blockSizeLastOctet":{},"percentOfIpv4Space":{"type":["null","number"]}}}}}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.02","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.02/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.02","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_quyoz0Pj3-oglz_pVFYwn","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.02","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Converts any IPv4 mask representation (prefix length, dotted netmask, wildcard, or hex) into all equivalent forms with host counts and validity flags.","exampleAgentPrompt":"Convert the netmask 255.255.252.0 into every equivalent form — prefix length, wildcard, hex, binary — and tell me how many usable hosts it gives.","exampleUseCases":[{"title":"Validate subnet mask from config file","prompt":"I found the mask 255.255.254.0 in a router config — is it a valid netmask, and what CIDR prefix and wildcard does it correspond to?"},{"title":"Firewall ACL wildcard conversion","prompt":"I need to write an ACL rule and the firewall uses wildcard masks. What's the wildcard mask equivalent to a /22, and how many hosts does that cover?"},{"title":"Hex mask decoding from packet capture","prompt":"I saw the mask 0xffff0000 in a packet capture — convert it to dotted-decimal netmask and CIDR prefix length and tell me how many addresses are in the block."}],"resultDescription":"Returns a structured object containing the input's canonical prefix length, dotted-decimal netmask, wildcard mask, hex mask, binary mask, network bit count, host bit count, total addresses, usable host count, percentage of IPv4 space, number of /24 subnets, classful default, block size in last octet, a validity flag, a human-readable verdict and summary, and reasons if the mask is invalid.","failureModes":["Invalid or unrecognizable input format returns valid=false with reasons explaining the error","Ambiguous input (e.g. a number that could be prefix length or octet) may be interpreted as prefix length","Non-contiguous bit patterns flagged as invalid masks with explanation","Missing required 'value' query parameter returns an error"],"whenToPreferThis":"Use this endpoint when you need to convert between any IPv4 mask notation (CIDR, dotted decimal, wildcard, hex, binary) and obtain a complete picture of host counts and validity in one call. Prefer it over manual calculation or general-purpose code execution when building network automation, validating configs, or populating firewall rules that require wildcard or hex formats.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-29T13:15:02.864Z","isFirstParty":false,"canonicalSlug":"network-calc-ipv4-netmask-converter-7f6b6031"}