Skip to main content
HTML Validation

Bad value X for attribute “href” on element “a”: Port number must be less than 65536.

About This HTML Issue

The URL in this link has a port number above 65535, the largest value a network port can have.

In a URL such as https://example.com:8080/, the digits after the colon that follows the host are the port. Ports are 16-bit numbers, so the URL Standard rejects any port greater than 65535. A browser can't parse a URL like that, and clicking the link does nothing.

The usual cause is a phone link written as http://tel: followed by the number. The URL parser reads tel as a host name and the phone number as its port, and almost every phone number is larger than 65535. Phone links use the tel: scheme on its own, with no http:// in front, as defined in RFC 3966.

A short number doesn't make http://tel: correct. http://tel:12345 passes validation because 12345 is a valid port, but the link points at a web server called tel instead of dialing. A number containing + or - gets a different error, Illegal character in port. Whatever the validator says, drop the http:// from phone links.

When the URL really is meant to carry a port, check the digits for a typo: valid ports go from 0 to 65535.

Invalid example

<a href="http://tel:5551234567">Call us</a>

<a href="https://example.com:80800/">Open the dashboard</a>

Valid example

<a href="tel:+15551234567">Call us</a>

<a href="https://example.com:8080/">Open the dashboard</a>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries