Skip to main content
HTML Validation

Bad value X for attribute “href” on element “a”: Illegal character in path segment. “>” is not allowed.

About This HTML Issue

The href value on the <a> element contains a literal > character, which is not allowed in a URL path.

The URL standard does not allow a raw > anywhere in a URL. Writing it as &gt; doesn't change that, because the HTML parser decodes &gt; back to > before the URL is read. Browsers still follow the link, but they percent-encode the character themselves and request a path that usually does not exist.

When the value starts with >, it is often not an address at all. Some sites put a > in front of link text as a small arrow, as in > Read the full report. If an editor pastes that text into the URL field of a CMS instead of the label field, the whole sentence becomes the href, and the browser treats it as a relative path to a missing page. A stray > at the end of a value, like href="/reports/annual>", is usually a typo in the markup.

Put the real address in href and keep the text inside the element. The validator reports only the first illegal character in a value, so if you remove the > but leave the sentence in href, it will report the spaces next. If a path really needs a >, write it as %3E.

Invalid example

<a href="&gt; Read the full report">Read the full report</a>

Valid example

<a href="/reports/annual">Read the full report</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