Tool guide
About this tool.
- A port number identifies a transport endpoint used by a service. This generator picks numeric candidates for configuration; it does not open, reserve or test those ports.
- Each generated batch contains distinct candidates. A later run may repeat a port from an earlier batch. Results stay unchanged until you run again or edit settings.
- IANA defines System Ports as 0–1023, User Ports as 1024–49151 and Dynamic/Private Ports as 49152–65535. This tool excludes port 0; operating-system ephemeral ranges can differ.
- Choose candidate ports for separate local development services.
- Prepare distinct port values for a test configuration within your chosen range.
- Pick from the dynamic/private range when you do not need a fixed service assignment.
- Export a candidate list and its exact range for review before configuring your application.
Set count and inclusive min/max ports or apply a complete sample. Every field requires a decimal integer; invalid or empty edited fields are rejected rather than silently rounded or clamped.
Run to generate a fresh batch. The output contains one distinct candidate per line. Editing settings clears old results and exports but does not silently generate another batch.
Review the range and warning. A candidate may already be used, reserved by a service, blocked by a firewall or require elevated permissions.
Copy or save random-ports.txt. The additional random-ports-report.json records the same batch, range, count, uniqueness and availabilityChecked: false. Verify by actually binding the service in your target environment.
- Count 5, min 3000, max 9999 → five distinct integers within the inclusive bounds, one per line; the exact values vary.
- Count 3, min 3000, max 3002 → 3000, 3001 and 3002 in random order, not duplicates.
- Count 1, min 65535, max 65535 → 65535. A one-port range has no random choice.
- Count 4, min 3000, max 3002 → error: Count exceeds the 3 distinct ports in the inclusive range.
- Count 1, min 1, max 1 → 1, with a warning that the range includes System Ports.
- Count 10, min 49152, max 65535 → ten candidates from IANA’s Dynamic/Private range, not a promise that the operating system leaves those ports free.
- Bounds are inclusive integers from 1 through 65,535. Count is an integer from 1 through 1,000 and cannot exceed max − min + 1.
- ASCII digits with surrounding whitespace are accepted. Fractions, exponent/hex notation, signs, empty edited fields and out-of-range values are rejected. No silent flooring or clamping occurs.
- Distinct selection uses sampling without replacement and unbiased rejection of random draws outside the usable range.
- Random draws use the shared Web Crypto source, without a Math.random fallback. A range with one candidate is deterministic and does not need randomness.
- Uniqueness applies only within one batch. Regenerating can return a previously generated candidate; no global reservation or history exists.
- The tool never scans, opens, binds or reserves sockets, detects occupied ports, modifies firewall rules or checks IANA service assignments.
- The default 3000–9999 range is for candidate generation, not a recommendation that every port there is available. System Ports below 1024 may involve permissions and established services.
- IANA’s Dynamic/Private range is 49152–65535. Actual operating-system ephemeral allocation and network policies can differ.
- TXT contains only ports separated by LF, without a trailing newline. The JSON audit records the same generation; requesting another run creates a fresh batch.