IP Address With a Port: IPv4 and IPv6 Examples
A port identifies a service endpoint on a host. Put :port after IPv4; bracket an IPv6 address before adding a port in a URL.
Examples at a glance
https://[2001:db8::1]:8443/
IPv4 endpoint
- Complete URL
http://192.0.2.10:8080/HTTP service on port 8080.
- Address
192.0.2.10The bare IPv4 address.
- Port
8080The service number.
IPv6 endpoint
- Complete URL
https://[2001:db8::1]:8443/HTTPS service on port 8443.
- Address
2001:db8::1Brackets surround this address in the URL.
- Port
8443The colon after ] introduces the port.
Why IPv6 needs brackets
IPv6 already contains colons. In https://[2001:db8::1]:8443/, brackets delimit the host and 8443 is the port. The bare address remains 2001:db8::1.
Ports are separate from addresses
TCP and UDP port numbers are 16-bit values. Applications generally use service ports from 1 to 65535; port 0 has special uses. A syntactically valid URL does not prove a service is listening.
Choose the matching tool
Use the URL analyzer for a complete HTTP/HTTPS endpoint. The IP validator accepts only bare addresses, so remove scheme, brackets and port first.