← All text tools

IP Blocklist Rule Converter

Paste IPs, CIDR blocks and ranges and get merged, deduplicated deny rules for nginx, Apache, iptables, UFW or a Cloudflare expression.

  • Free
  • No sign-up
  • Works on any device

About IP Blocklist Rule Converter

Blocklists arrive as plain lists of addresses and ranges, but each server wants its own syntax. Paste IPv4 and IPv6 addresses, CIDR blocks such as 10.0.0.0/24 and ranges such as 203.0.113.10 - 203.0.113.13 and this page merges overlapping and neighbouring entries, removes duplicates and rewrites the result as nginx deny lines, Apache 2.4 Require not ip lines, Apache 2.2 Deny from lines, iptables and ip6tables DROP commands, UFW deny commands or one Cloudflare ip.src expression. Two adjacent /24 blocks become one /23, and a plain address is written without a /32.

How to use IP Blocklist Rule Converter

  1. Paste the addresses, CIDR blocks or ranges, one per line; comments after a hash are ignored.
  2. Choose the output format for your server or firewall.
  3. Copy the rules, check that your own address is not blocked, and add them to the configuration.

Why use this tool?

Also known as

Frequently asked questions

Why did my list get shorter?

Duplicates are removed and ranges that overlap or touch are combined, so 10.0.0.0/24 and 10.0.1.0/24 become 10.0.0.0/23. Untick the merge option to keep every entry as written.

Can I use a range like 192.168.1.10 - 192.168.1.20?

Yes. A start and end address are turned into the smallest set of CIDR blocks that covers exactly that range, because firewalls cannot take a free-form range.

Is there a length limit for the Cloudflare rule?

Cloudflare limits how long a rule expression can be, at about 4,096 characters when this page was written. The page warns when the expression is long; split a large list across several rules.

Is IP Blocklist Rule Converter free?

Yes. IP Blocklist Rule Converter on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.