Port List Expander

Expand port ranges to individual ports

Separate with commas. Use - for ranges (e.g., 8080-8090)

Examples:

The Port List Expander converts compact port range notation into complete lists of individual port numbers. Enter a specification like 22,80-88,443,8000-8010 and get the full enumeration of every port in those ranges, formatted for your target system.

Understanding Port Range Notation

Port range notation is a shorthand that network administrators use every day, but not every system understands it. When you write 8000-8010 in an iptables rule, the firewall expands it internally and matches traffic on any port from 8000 through 8010. But when you try to paste that same notation into a cloud security group interface, an API call, or a custom script, it often does not work -- the system expects a flat list of individual port numbers.

This mismatch comes up more often than you might expect. Cloud providers like AWS have security group interfaces that accept individual ports but not ranges in certain API contexts. Monitoring tools might need a comma-separated list to configure port-based checks. Automation scripts that iterate over ports need each number on its own line for a loop. Even when a system does support ranges, you sometimes need to expand a range to verify it covers exactly the ports you intended -- especially when ranges overlap or were inherited from documentation you do not fully trust.

The expander handles all of this. You give it any combination of individual ports and ranges, and it produces a clean, deduplicated list of every port in your specification. It validates that all values are within the valid range of 0-65535, flags reversed ranges where the start is greater than the end, and warns you when an expansion produces an impractically large list that might indicate a typo.

How to Expand Port Ranges to Individual Ports

  1. Enter port specifications using standard notation -- commas for individual ports, dashes for ranges
  2. The expander validates each port is within 0-65535 and ranges are properly ordered
  3. Choose your output format: one per line, comma-separated, or space-separated
  4. Copy the expanded list of individual port numbers

Port Range Expansion Examples

Simple Range

InputOutput
80-8580, 81, 82, 83, 84, 85

Mixed Ports and Ranges

InputOutput
22,80,44322, 80, 443
22,80-82,44322, 80, 81, 82, 443
8000-8005,90908000, 8001, 8002, 8003, 8004, 8005, 9090

Common Service Patterns

Input:  20-21,22,25,53,80,110,143,443,993,995
Output: 20, 21, 22, 25, 53, 80, 110, 143, 443, 993, 995
Input:  3000-3010
Output: 3000, 3001, 3002, 3003, 3004, 3005, 3006, 3007, 3008, 3009, 3010

Output Format Options

One per line (for shell script loops):

80
81
82
83

Comma-separated (for configuration files):

80,81,82,83

Space-separated (for command-line arguments):

80 81 82 83

When to Use the Port List Expander

  • Migrating firewall rules between systems where the target platform does not support range notation (e.g., some cloud security group interfaces)
  • Generating port lists for scanning tools like nmap when you need explicit port enumeration
  • Creating allowlist entries from compact range specifications provided by vendors or security teams
  • Validating range coverage -- expanding a range to verify it includes exactly the intended ports
  • Scripting port iteration in bash, Python, or other automation languages
  • Populating configuration templates that require individual port entries rather than ranges

How Port Range Notation Works

Standard Range Syntax

Port range notation follows the convention used by most firewalls and network tools:

  • Individual ports: 80,443,8080 -- listed separated by commas
  • Consecutive ranges: 1000-1010 -- start and end connected by a dash
  • Combinations: 22,80-88,443,8000-8010 -- mixed individual ports and ranges

Range Validation Rules

  • Both endpoints must be valid port numbers (0-65535)
  • The start of a range must be less than or equal to the end (80-85 is valid, 85-80 is not)
  • Duplicate ports across overlapping ranges are deduplicated in the output
  • A "range" of one (443-443) is valid and equivalent to specifying 443 alone

Large Range Warnings

Expanding very large ranges can produce impractical lists. A range like 1-65535 generates 65,535 individual entries. The expander warns when an expansion exceeds a configurable threshold to catch accidental specifications like 1-65535 when 1-655 was intended.

Port Expansion in Practice

The most common use case for port expansion is bridging the gap between how humans think about port specifications and how automation tools consume them. A security team might hand you a document that says "allow ports 8000-8100 for the application cluster." That is clear and concise for a human, but if your deployment tool needs each port listed individually in a JSON array, you need to expand it. Rather than manually typing 101 port numbers and inevitably making a mistake, the expander does it in one step.

Another practical scenario is auditing firewall rules. When you see a range like 1024-9999 in a firewall rule, it is not immediately obvious whether that range was intentionally broad or is a leftover from a "just open everything" troubleshooting session. Expanding it and comparing the list against the ports your application actually uses can reveal that only 5 of those 8,976 ports are needed. The expansion makes the gap between what is allowed and what is needed starkly visible, which is exactly the kind of insight security auditors look for.

When working with overlapping ranges, the expander automatically deduplicates the output. If you have one rule for 80-90 and another for 85-95, expanding both and combining them produces a clean list from 80 to 95 with no duplicates. This is particularly useful when consolidating firewall rules from multiple sources or teams, where overlapping ranges are common and manual deduplication is error-prone.

Frequently Asked Questions

What happens if my ranges overlap?

Overlapping ranges are handled gracefully -- the expander deduplicates the output. For example, 80-90,85-95 expands to 80, 81, 82, ..., 95 with no duplicates. Each port appears exactly once in the final list.

Can I expand port ranges for both TCP and UDP?

The Port List Expander works with port numbers only, independent of protocol. Port numbers are valid for both TCP and UDP. If you need protocol-specific output, use the Protocol/Port Template Builder to generate rules with protocol designations.

Is there a limit to how many ports I can expand?

The tool handles any valid range up to the full port space (0-65535). However, expanding very large ranges (thousands of ports) may produce unwieldy output. For ranges producing more than 1,000 ports, consider whether the compact range notation might be more appropriate for your use case.

Can I expand a range and then compress it back?

Yes. The Port List Compressor is the inverse operation. You can expand a range, modify individual ports (add or remove some), and then compress the modified list back into optimal range notation. The two tools are designed to work together.

How does the expander handle invalid input like 85-80?

Reversed ranges where the start port is greater than the end port are flagged as errors. The specification 85-80 is ambiguous -- it could be a typo for 80-85 or an intentional but malformed notation. The expander reports the error and skips the invalid range rather than guessing what was intended.

Related Tools

IPparse•Free Network & Subnet Calculator Tools

© 2026 IPparse. All tools run locally in your browser.

100% Privacy-First • No Data Collected