TCP/UDP Port List Compressor — Compact Ranges for iptables, ufw, nftables and MikroTik
Collapse comma-separated TCP/UDP port numbers into compact contiguous firewall ranges.
119 unique ports in 9 entries
Overlapping or adjacent ports are merged, so 80, 81, 82 become 80-82 and 3000-3005 absorbs 3003. Port 0 is reserved and cannot be used in firewall rules.
When to use the Firewall TCP/UDP Port Range Compressor
The shortest ranges
Adjacent or overlapping ports are merged: 80, 81, 82 become 80-82, and 3000-3005 absorbs 3003. A messy list from application docs becomes a tidy firewall rule.
The multiport limit handled
The iptables multiport module, which ufw also uses, holds only 15 ports per rule, with a range counting as two. Long lists are split into several valid rules automatically.
Five ready formats
A compact list, iptables, ufw, an nftables set or a MikroTik firewall filter, for TCP, UDP or both, then copy or download.
Flexible input
Separate with commas, spaces or new lines; write ranges as 8000-8010 or 8000:8010. Ports outside 1–65535 and reversed ranges are named and ignored.
Frequently asked questions
Why does iptables refuse more than 15 ports?
The multiport module is limited to 15 slots per rule, and every range uses two. This tool splits long lists into several rules.
Does nftables have the same limit?
No. An nftables set can hold many ports and ranges in one rule.
What is the difference between - and :?
iptables and ufw write ranges with a colon (8000:8010), while nftables and MikroTik use a hyphen; this tool writes the right one for each format.
How do I find a service's port number?
Use the Port Number Lookup to see the standard ports of SSH, Winbox, RTSP, databases and more.
Is my data sent to a server?
No. The list is processed in your browser.
Similar tools
- Well-Known TCP/UDP Port Number & Service LookupSearch standard ports for MikroTik, SSH, CCTV RTSP, Proxmox, WireGuard & DB.
- HTTP Status Code (100–599) Meaning LookupSearch every HTTP response status code (200, 301, 403, 429, 502, 504, 530).
- File Extension ⇄ Content-Type MIME LookupLook up exact MIME Content-Type headers for web, video, fonts & JSON/YAML.
- IPv4 (in-addr.arpa) & IPv6 (ip6.arpa) PTR Zone GeneratorBuild BIND/PowerDNS PTR reverse lookup zone names for IPv4 & IPv6 addresses.