Home › Developer Tools › CIDR to IP Range

CIDR to IP Range

Paste one or more CIDR blocks, IPv4 or IPv6, and instantly see the first and last IP address, network and broadcast addresses, mask and number of hosts. Need the opposite? Turn any start-to-end IP range into the shortest list of CIDR blocks, or export every address in a block as a text or CSV file.

Last updated:

Also accepts 192.168.1.10 255.255.255.0 (netmask) and single addresses. Commas and spaces between blocks work too.

Advertisement
Advertisement

How to use the CIDR to IP Range

  1. Enter your CIDR blocks, such as 192.168.1.0/24 or 2001:db8::/48, one per line. Click an example chip to try one.
  2. Read the IP range in the highlighted box: the first and last usable address and how many hosts the block holds.
  3. Check the details: network and broadcast address, masks, address type and the step-by-step working.
  4. Export the IP list if you need every address: pick the block, usable or all addresses and a format, then generate, copy or download it.
  5. Convert a range to CIDR on the second tab by entering a first and last IP address to get the minimal set of CIDR blocks.

How CIDR notation maps to an IP range

CIDR (Classless Inter-Domain Routing, RFC 4632) writes a network as an address plus a prefix length, like 192.168.1.0/24. The prefix says how many leading bits are fixed for the network; the rest are free for hosts. With h host bits (32 − prefix for IPv4, 128 − prefix for IPv6) the block always contains exactly 2h addresses and always starts on a multiple of that size.

  • First IP (network address) = IP AND subnet mask (all host bits 0).
  • Last IP (broadcast in IPv4) = network address OR wildcard mask (all host bits 1).
  • Usable IPv4 hosts = 2h − 2 for /0 to /30, 2 for a /31 and 1 for a /32.
  • IPv6 has no broadcast address, so the full 2h addresses are counted.

Worked example: 172.16.5.37/20 has 12 host bits. The mask is 255.255.240.0, so the third octet is rounded down to a multiple of 16: 5 becomes 0. The range is 172.16.0.0 to 172.16.15.255, which is 4,096 addresses and 4,094 usable hosts.

IPv4 CIDR reference table

CIDRSubnet maskWildcardAddressesUsable hostsTypical use
/8255.0.0.00.255.255.25516,777,21616,777,21410.0.0.0/8 private space
/12255.240.0.00.15.255.2551,048,5761,048,574172.16.0.0/12 private space
/16255.255.0.00.0.255.25565,53665,534Cloud VPC, campus network
/20255.255.240.00.0.15.2554,0964,094Large cloud subnet
/22255.255.252.00.0.3.2551,0241,022Big office or Wi-Fi network
/24255.255.255.00.0.0.255256254Home or small office LAN
/26255.255.255.1920.0.0.636462Department or VLAN
/28255.255.255.2400.0.0.151614Small server segment
/29255.255.255.2480.0.0.786Static IP block from an ISP
/30255.255.255.2520.0.0.342Classic point-to-point link
/31255.255.255.2540.0.0.122Point-to-point link (RFC 3021)
/32255.255.255.2550.0.0.011Single host, firewall rule

Cloud providers often reserve extra addresses in each subnet (for example the first four and the last one), so the number you can actually assign there can be lower than the usable host count above.

Common IPv6 prefix sizes

PrefixNumber of /64 subnetsTypical holder
/324,294,967,296ISP or large organization allocation
/4865,536One site or organization
/56256Home or small business customer
/6016Some residential ISPs
/641 (264 addresses)A single LAN segment, required for SLAAC
/127—Point-to-point router link (RFC 6164)
/128—Single address, loopback

Tips for working with CIDR ranges

  • Allow-lists and firewall rules: summarize a range with the IP range to CIDR tab instead of listing hundreds of single addresses. Ranges that do not start on a block boundary need several CIDR entries.
  • Check for overlaps before creating VPCs, VPN routes or Docker networks. Paste all your blocks at once and the tool flags any block that sits inside another.
  • Documentation addresses such as 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 and 2001:db8::/32 are reserved for examples and are never routed on the internet.
  • Leading zeros in IPv4 octets (like 010.0.0.1) are rejected because some software reads them as octal numbers.

Frequently asked questions

What does a CIDR block like /24 mean?

The number after the slash is the prefix length: how many leading bits of the address identify the network. The remaining bits identify hosts. An IPv4 /24 leaves 32 - 24 = 8 host bits, so it contains 2^8 = 256 addresses, for example 192.168.1.0 to 192.168.1.255.

How do I calculate the first and last IP of a CIDR range?

The first address (network address) is the IP with all host bits set to 0, which is the IP AND the subnet mask. The last address is the IP with all host bits set to 1, which is the network address OR the wildcard mask. For 172.16.5.37/20 that gives 172.16.0.0 to 172.16.15.255.

Why are there 2 fewer usable hosts than addresses in IPv4?

In a normal IPv4 subnet the first address identifies the network and the last address is the broadcast address, so neither is assigned to a device. A /24 therefore has 256 addresses but 254 usable hosts. The exceptions are /31, used for point-to-point links where both addresses are usable (RFC 3021), and /32, which is a single host.

How is IPv6 different?

IPv6 has 128-bit addresses and no broadcast address, so every address in the prefix is counted as usable. The numbers get huge: a single /64, the standard size for one IPv6 subnet, holds 2^64 = 18,446,744,073,709,551,616 addresses, and a /48 contains 65,536 of those /64 subnets.

What happens if I enter an IP with host bits set, like 10.1.2.3/8?

The tool keeps the prefix and works out the block the address belongs to, here 10.0.0.0/8, and shows a note. Many routers and firewalls reject or silently correct such entries, so it is best to write the network address.

How do I convert an IP range to CIDR?

Use the IP range to CIDR tab. Starting at the first address, it takes the largest aligned power-of-two block that does not go past the last address, then repeats from the next address. For example 192.168.0.10 to 192.168.0.200 becomes 8 blocks, from 192.168.0.10/31 to 192.168.0.200/32.

Can I download every IP address in a CIDR block?

Yes, for blocks of up to 1,048,576 addresses (an IPv4 /12 or an IPv6 /108). Choose usable hosts or all addresses, one per line, comma-separated or CSV, and download the file. The list is generated in your browser.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Subnet CalculatorCalculate IPv4 network, broadcast, host range, masks and host count, and split subnets.IP Address ConverterConvert IPv4 to decimal, hex, binary, octal and back, with class and private/public check.IPv6 Expander & CompressorExpand IPv6 addresses to full form or compress them per RFC 5952, one or many at once.What Is My IPSee your public IP address and location.Email ValidatorCheck email lists and spot disposable addresses.Website Down CheckerCheck if a website is down for everyone.Deep Link GeneratorCreate links that open directly in apps.URL ParserBreak a URL into its parts and edit query string parameters with a live rebuild.User Agent ParserSee your user agent and parse any UA string into browser, OS, engine and device.HTTP Status CodesSearch every HTTP status code with plain-English meanings, causes, fixes and RFC references.Bulk URL OpenerOpen a list of URLs in new tabs at once or in batches, with cleanup, dedupe and delay.DNS LookupLook up A, AAAA, MX, TXT, NS, CNAME, SOA and CAA records with TTLs over secure DNS.API Request TesterSend GET, POST, PUT and DELETE requests with headers and a body, then inspect the response.WebSocket TesterConnect to a ws:// or wss:// server, send messages and watch a timestamped live log.WHOIS LookupLook up who registered a domain or IP: registrar, creation and expiry dates, name servers, status.Mailto Link GeneratorBuild encoded mailto: links with cc, bcc, subject and body, plus HTML code and a QR code.WhatsApp Link GeneratorCreate wa.me click-to-chat links with a pre-filled message, button HTML and a QR code.Basic Auth Header GeneratorCreate an Authorization: Basic header from a username and password, or decode one.Common Ports ListSearchable TCP/UDP port number list with service, protocol and description, filterable by range.DMARC CheckerLook up a domain's DMARC record, explain every tag, grade the policy and get fix suggestions.DMARC Record GeneratorCreate a DMARC TXT record with policy, reporting and alignment options, every tag explained.Email Header AnalyzerPaste raw email headers to trace every server hop, see delays and check SPF, DKIM and DMARC.IP Geolocation LookupFind the country, city, ISP, ASN and time zone of any IP address or domain, with a map.Reverse DNS LookupFind the PTR hostname of any IPv4 or IPv6 address, one at a time or hundreds in bulk.SPF Record CheckerLook up a domain's SPF record, count nested DNS lookups, find errors and test a sender IP.SPF Record GeneratorBuild a valid SPF TXT record from mail providers, IPs and includes, with a lookup-count check.DNS Propagation CheckerCompare DNS answers and TTLs from Cloudflare, Google, Quad9, AdGuard and NextDNS side by side.Domain Availability CheckerCheck if domain names are available across .com, .io, .ai and more, with registrar and expiry.MAC Address LookupFind the vendor of a MAC address or OUI, check multicast and random bits, look up many at once.MX LookupFind a domain's mail servers: MX priority, host, IP addresses and the email provider.Uptime SLA CalculatorTurn 99.9% uptime into allowed downtime per day, month and year, or downtime into uptime %.Website Speed TestTest page speed with Lighthouse: performance score, Core Web Vitals and fixes, mobile or desktop.ASN LookupLook up an AS number or IP: network owner, country, registry, abuse contact and announced prefixes.Bandwidth CalculatorEstimate monthly website bandwidth (GB) and the Mbps you need from page views and page size.CNAME LookupFollow a hostname's full CNAME chain to its final IP addresses, with TTLs and CDN detection.CORS TesterSend GET, POST or OPTIONS from your browser to any API and see whether CORS allows it and why not.DKIM Record CheckerLook up a domain's DKIM key by selector (or auto-detect), check key type, bit length and tags.DKIM Record GeneratorCreate a DKIM RSA key pair in your browser with the TXT record, selector host and private key PEM.IPv6 Subnet CalculatorIPv6 prefix to network, range, address count and /64s, and split it into child subnets.Link in Bio Page GeneratorCreate a link-in-bio page with avatar, bio, links and theme, then download it as one HTML file.NS LookupFind a domain's authoritative nameservers with their IPs, SOA record and DNS hosting provider.Social Share Link GeneratorMake share links and buttons for Facebook, X, LinkedIn, Reddit, Pinterest, WhatsApp and email.Subnet Mask Cheat SheetInteractive /0 to /32 table of subnet masks, wildcards and host counts with details per prefix.TXT Record LookupLook up a domain’s DNS TXT records and see which are SPF, DMARC, DKIM or verification tokens.VLSM CalculatorSplit a network into variable-length subnets sized to the hosts each one needs.YouTube Timestamp Link GeneratorMake YouTube links that start at a set time, embed start/end codes and lists of timestamps.DMARC Report AnalyzerRead DMARC aggregate XML reports (.xml, .gz, .zip): sources, SPF/DKIM alignment and pass rates.Domain Age CheckerSee how old a domain is, when it was registered and when it expires. Bulk check up to 50.Email Deliverability CheckerGrade a domain's MX, SPF, DMARC, DKIM, BIMI and MTA-STS records in one report with fixes.Email ObfuscatorHide an email address from spam bots with HTML entities, a JavaScript mailto link or reversed CSS text.Email PermutatorGenerate every common business email format from a first name, last name and company domain.HTTP Header ParserPaste raw HTTP headers to get a table explaining each one plus a security headers grade.IP Blacklist CheckerCheck an IPv4 address against 21 public spam blocklists (DNSBLs) and see listed or clean.IP Range to CIDRTurn a start and end IP into the shortest list of CIDR blocks, for IPv4 and IPv6.
See all 52 Network, DNS & Email Tools →