Generováno lokálně pomocí crypto.getRandomValues – nikam se neposílá.
(Dokumentace v angličtině)
What it does
Generates random TCP/UDP port numbers from the band you pick. The tool generates on load and on every option change. Choose the Range (Registered, Ephemeral, or Any), set Count from 1 to 1,000, and toggle Unique when the ports must not repeat. A single value renders in large type; a batch renders as a list. Randomness comes from crypto.getRandomValues locally.
How to use it
- Pick a Range. Registered (1024-49151) is the default and the usual choice.
- Set Count (1 to 1,000).
- Toggle Unique if the ports must be distinct.
- Copy the result.
Examples
Five unique ports from the registered band: 32764, 21044, 48812, 18377, 40291.
Three ports from the ephemeral band: 52143, 49872, 61009.
Every value in both lists sits inside its band. That is the tool’s one job, and Unique guarantees it also never repeats.
How TCP ports work
A port is a 16-bit number: 1 to 65535. IANA splits that space into three bands:
| Band | Range | Values | Used for |
|---|---|---|---|
| Well-known | 1-1023 | 1,023 | system services: HTTP 80, HTTPS 443, SSH 22, DNS 53 |
| Registered | 1024-49151 | 48,128 | applications registered with IANA: MySQL 3306, PostgreSQL 5432 |
| Ephemeral | 49152-65535 | 16,384 | client-side outbound connections, picked by the OS |
Why a developer picks the registered band for a local service:
- Below 1024, binding needs root or administrator privileges.
sudofor a dev server is the wrong trade. - Inside 49152-65535, the OS may hand your port to any outbound connection at any moment. Your listener then races the OS and can fail to bind.
- The registered middle is quiet by default: 48,128 values that only popular daemons claim. Pick one at random, avoid the famous few (3306, 5432, 6379, 8080), and collisions vanish.
How Unique works. The tool runs a partial Fisher-Yates shuffle over the whole band and takes the first count results - every port distinct by construction, no rejection loop. The bound is arithmetic: the ephemeral band holds 16,384 values, so asking for 20,000 unique ephemeral ports is impossible. When count exceeds the band size, generation fails and the tool clears the results. Widen the range or lower the count.
Good to know
- Unique costs nothing until you exceed the band size; then it fails loudly instead of silently repeating.
- One port, one protocol. A TCP port and a UDP port with the same number are separate endpoints; this tool generates numbers, not bindings.
- Private: randomness comes from
crypto.getRandomValueslocally. - Related tools: MAC Address Generator,
ULIDULIDA 128-bit identifier like a UUID, but timestamp-prefixed and Crockford-base32 encoded — so it sorts by creation time and is shorter to read.
Generator.