Code tool

Random Port Generator

Create one or more random port numbers for local development, demos, containers, and network configuration without sending anything anywhere.

In-browser processingNo account requiredPrivacy details ↗

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.

A QUICK WALKTHROUGH

How to use this tool

  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.

GOOD TO KNOW

Common questions

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.