代码、数据与二维码工具

随机端口生成器

按参数生成随机端口结果。

优先本地处理无需注册隐私说明 ↗

Generate up to 100 values.

Disable this to allow repeats when generating many values.

Both endpoints are included. This tool generates numbers locally; it does not check whether a port is available.

使用步骤

如何使用

  1. Choose the inclusive port range and how many values to generate.
  2. Keep unique values enabled when each result must use a different port.
  3. Generate the ports, then copy the newline-separated result.

Useful ranges for development

Ports are limited to 0 through 65,535. The default range starts at 1024 so generated values avoid the well-known system port range; choose any valid range when your environment requires it.

Local and unbiased generation

Values are generated in your browser with crypto.getRandomValues and rejection sampling, so the range does not introduce modulo bias. No port is checked against the ports currently in use on your machine.

常见问题

你可能还想知道

Does this reserve or test a port?

No. It only generates numbers. A port may already be in use, blocked by a firewall, or restricted by your operating system.

Are the endpoints included?

Yes. Both the minimum and maximum values are inclusive.

Can I request unique ports?

Yes. Keep unique values enabled; the requested count cannot exceed the number of values in the selected range.

Is this suitable for security-sensitive assignments?

It uses browser cryptography for unpredictable selection, but it does not reserve a port or replace an operating system allocator.