Random Port Generator
Generate random port numbers within specified ranges for development, testing, and network configuration.
Random Port Generator tool
Example
Input: Port Range Dynamic / Private (49152 - 65535), Count 5, then Generate Ports
Result: Generated Ports (5): five unique random ports between 49152 and 65535, sorted ascending, different on every run
The dynamic range is never assigned to services by IANA, so it is the safest choice for local development servers and temporary listeners.
Common Service Ports the Generator Labels
| Port | Service | Band |
|---|---|---|
| 22 | SSH | Well-known |
| 25 | SMTP | Well-known |
| 53 | DNS | Well-known |
| 80 | HTTP | Well-known |
| 443 | HTTPS | Well-known |
| 1433 | MSSQL | Registered |
| 3306 | MySQL | Registered |
| 3389 | RDP | Registered |
| 5432 | PostgreSQL | Registered |
| 5672 | AMQP | Registered |
| 6379 | Redis | Registered |
| 8080 | HTTP Alt | Registered |
| 9200 | Elasticsearch | Registered |
| 27017 | MongoDB | Registered |
A sample of the 57 ports the tool labels and can exclude.
- Pick a port range: well-known (1-1023), registered (1024-49151), dynamic (49152-65535), or a custom minimum and maximum.
- Set how many ports you want (up to 50). Turn on "Exclude common service ports" to skip ports used by well-known services.
- Click "Generate Ports" to get unique random ports in that range, sorted from low to high.
- Check each port for a service label, which marks a port that a common service uses.
- Copy single ports or use "Copy All" for the whole list.
Picking a Port Number for Development and Testing
The Random Port Generator picks unique random TCP or UDP port numbers from a range you choose. Port numbers run from 0 to 65535, and IANA splits them into three bands: well-known (0 to 1023), registered (1024 to 49151) and dynamic or private (49152 to 65535). Choose a band or set your own minimum and maximum, then ask for 1 to 50 ports. The results are sorted from low to high and never repeat. Port 0 is never produced, since it is reserved. Each number comes from the browser crypto API with rejection sampling, a method that gives every port in the range the same chance.
Which band should you use? Well-known ports below 1024 usually need admin or root rights. They belong to core services like SSH (22) and HTTPS (443). The registered band holds most app defaults, such as 3306 for MySQL and 5432 for PostgreSQL. The dynamic band is never assigned to a service. However, your operating system also uses part of it for outgoing connections, so a busy machine may briefly hold a port you picked.
The tool labels any result that matches one of 57 common service ports in its list. The "Exclude common service ports" switch skips them entirely. It cannot see your machine, so it does not know which ports are actually free. Check before you bind, as shown in the questions below. For random numbers of any other kind, use the Random Number Generator.
Sources
Frequently Asked Questions
Related Tools
Random Number Generator
Generate random numbers within a range with options for count, uniqueness, and sorting.
Math and NumbersIPv4 Subnet Calculator
Calculate network address, broadcast address, host range, subnet mask, and wildcard mask from any IP and CIDR prefix.
Network Tools