Numbers
Random Network Port Generator
Used by developers, writers, and creators worldwide.
A random network port generator is the fastest way to grab a conflict-free batch of port numbers for containers, services, or test environments without staring at a spreadsheet. Port space is divided into three ranges: well-known (0–1023) for system protocols, registered (1024–49151) for applications, and dynamic (49152–65535) for OS-assigned ephemeral sockets. Picking from the right range at random dramatically reduces collisions on shared machines. You control how many ports to generate, which range to draw from, and whether the list is unique. For most Docker Compose or microservice work, the registered range with unique mode on is all you need. Switch to dynamic only when you're explicitly testing ephemeral socket behavior.
Loading usage…
Free forever — no account required
How to use
- Choose your options above
- Click Generate
- Copy your result
Detailed instructions
- Set the Count field to match how many ports you need — one per service or container is typical.
- Select your Port Range: choose Registered (1024-49151) for application servers, or Dynamic (49152-65535) for testing ephemeral socket behavior.
- Keep Unique Only set to Yes to ensure no two generated ports are the same.
- Click Generate to produce the port list, then copy the numbers directly into your config file, docker-compose.yml, or environment variables.
- Verify each port is free on your machine before binding by running a quick check with lsof or netstat.
Use Cases
- •Assigning unique host ports to each service in a Docker Compose file to avoid bind conflicts on shared dev machines
- •Generating non-overlapping ports for parallel Jest or Cypress test runners inside a CI pipeline
- •Picking registered-range ports for mock API servers spun up with tools like WireMock or json-server in integration tests
- •Allocating ports for a local Kubernetes kind cluster where multiple engineers share the same host network
- •Seeding a service-registry config or README with placeholder ports before finalizing a microservice architecture
Tips
- →Generate 10-15 ports at once and keep a short list in your project README so teammates don't accidentally reuse the same host ports.
- →Avoid ports ending in common defaults like 000, 080, or 443 — even in the registered range, these attract accidental conflicts and firewall rules.
- →For Docker Compose, use generated ports only on the host side; keep internal container ports at their application defaults (e.g., 8080 inside, random port outside).
- →If your CI system runs parallel test jobs, generate a separate port set per job using different seeds or counts so concurrent builds don't clash on the same host.
- →Cross-reference generated ports against IANA's assigned numbers list (iana.org/assignments/service-names-port-numbers) before finalizing, especially above 8000 where many tools default.
FAQ
which port range should i use for local development
Stick to registered ports (1024–49151) for almost all development work. They don't require root privileges, and they sit safely outside the ephemeral range the OS uses for outgoing TCP connections. Avoid the dynamic range (49152–65535) for persistent services — the kernel may try to claim those same ports for outbound sockets.
are generated port numbers guaranteed to be free on my machine
No — this tool generates valid numbers within the chosen range but has no visibility into what your OS is currently using. Before binding, check availability with `lsof -i :<port>` on macOS/Linux or `netstat -ano | findstr :<port>` on Windows. If a port is taken, just regenerate and pick another from the list.
what's the difference between registered ports and ephemeral ports
Registered ports (1024–49151) are IANA-assigned to named applications and are the standard choice for servers and dev tooling. Ephemeral or dynamic ports (49152–65535) are reserved for the OS to assign as source ports on outgoing connections. Binding an application to a dynamic port risks collisions with the kernel's own socket assignments, so only use that range when you're specifically testing OS-level socket behavior.