๐Ÿฆ IP Animals
๐Ÿ” Generators & Security

Random Port Number Generator

Pick random TCP/UDP port numbers within the well-known, registered, ephemeral or full range. Generated locally in your browser with a cryptographic RNG โ€” nothing is ever transmitted.

About port numbers

A port number is a 16-bit value (0โ€“65535) that lets a single IP address host many services at once. When traffic arrives, the operating system uses the destination port to decide which application should receive it. IANA divides the range into three groups:

  • Well-known ports (0โ€“1023): reserved for core services โ€” 22 SSH, 25 SMTP, 53 DNS, 80 HTTP, 443 HTTPS. On most systems only privileged processes may listen here.
  • Registered ports (1024โ€“49151): used by a wide range of applications and databases โ€” 3306 MySQL, 5432 PostgreSQL, 6379 Redis, 8080 HTTP-alt.
  • Dynamic / ephemeral ports (49152โ€“65535): handed out automatically by the OS as the source port for outbound connections.
๐Ÿ”’ Generated locally, never transmitted

Each port comes from crypto.getRandomValues() running in your browser, using rejection sampling so every value in the range is equally likely. Nothing is uploaded, logged, or stored โ€” the tool works offline.

Choosing a port for your own service

Prefer the registered range and pick something not already taken by common software. Avoid well-known ports unless you are implementing that exact protocol, and stay out of the ephemeral range so the operating system does not grab the same number for an outbound socket.

Learn more in our guide on what a network port is, and browse the common ports reference to see what is already assigned. Building test fixtures? Combine this with the random IP generator.

Frequently asked questions

What are the well-known, registered and ephemeral port ranges?

Ports 0โ€“1023 are well-known (system) ports assigned to core services like HTTP and SSH. Ports 1024โ€“49151 are registered ports used by many applications. Ports 49152โ€“65535 are the dynamic or ephemeral range that operating systems pick from for outgoing connections.

Which range should I pick for a new service?

For a custom application, choose from the registered range (1024โ€“49151) and avoid ports already used by common software. Do not use well-known ports below 1024 unless you are implementing that standard service, and avoid the ephemeral range so you do not clash with the OS.

Is anything sent to a server?

No. Port numbers are generated with crypto.getRandomValues in your browser. Nothing is uploaded, logged, or stored, and the tool works completely offline.

Are the numbers evenly distributed?

Yes. The tool uses rejection sampling over crypto.getRandomValues so every port in the selected range is equally likely, with no modulo bias.

Want the theory? Read the guides โ†’ ยท Visit the zoo โ†’