Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<meta charset=utf-8>
<title>valid href</title>
<a href="a:foo.com"></a><!-- scheme-private -->
<a href="foo:/"></a><!-- scheme-private-slash -->
<a href="foo://"></a><!-- scheme-private-slash-slash -->
<a href="foo:/bar.com/"></a><!-- scheme-private-path -->
<a href="c:/foo"></a><!-- scheme-private-single-letter -->
<a href="madeupscheme:/example.com/"></a><!-- scheme-private-single-slash -->
<a href="file:/example.com/"></a><!-- scheme-file-single-slash -->
<a href="ftps:/example.com/"></a><!-- scheme-ftps-single-slash -->
<a href="gopher:/example.com/"></a><!-- scheme-gopher-single-slash -->
<a href="ws:/example.com/"></a><!-- scheme-ws-single-slash -->
<a href="wss:/example.com/"></a><!-- scheme-wss-single-slash -->
<a href="javascript:/example.com/"></a><!-- scheme-javascript-single-slash -->
<a href="mailto:/example.com/"></a><!-- scheme-mailto-single-slash -->
<a href="madeupscheme:example.com/"></a><!-- scheme-private-no-slash -->
<a href="ftps:example.com/"></a><!-- scheme-ftps-no-slash -->
<a href="gopher:example.com/"></a><!-- scheme-gopher-no-slash -->
<a href="wss:example.com/"></a><!-- scheme-wss-no-slash -->
<a href="mailto:example.com/"></a><!-- scheme-mailto-no-slash -->
<a href="data:text/plain,foo"></a><!-- scheme-data-no-slash -->
<a href="http💩//:foo"></a><!-- path-contains-pile-of-poo -->
<a href="http://%25DOMAIN:foobar@foodomain.com"></a><!-- userinfo-username-contains-percent-encoded -->
<a href="//foo/bar"></a><!-- scheme-schemeless-relative -->
<a href="/"></a><!-- path-slash-only-relative -->
<a href="/a/b/c"></a><!-- path-simple-relative -->
<a href="/a%2fc"></a><!-- path-percent-encoded-slash-relative -->
<a href="/a/%2f/c"></a><!-- path-percent-encoded-slash-plus-slashes-relative -->
<a href="?"></a><!-- query-empty-no-path-relative -->
<a href="#"></a><!-- fragment-empty-hash-only-no-path-relative -->
<a href="#/"></a><!-- fragment-slash-relative -->
<a href="#;?"></a><!-- fragment-semicolon-question-mark-relative -->
<a href="#β"></a><!-- fragment-non-ascii-relative -->
<a href="foo.com"></a><!-- scheme-none-relative -->
<a href=":"></a><!-- path-colon-relative -->
<a href=":a"></a><!-- path-leading-colon-letter-relative -->
<a href=":foo.com"></a><!-- path-leading-colon-chars-relative -->
<a href=":/"></a><!-- path-leading-colon-slash-relative -->
<a href=":#"></a><!-- path-leading-colon-hash-relative -->
<a href=":23"></a><!-- path-leading-colon-number-relative -->
<a href="/:23"></a><!-- path-slash-colon-number-relative -->
<a href="::"></a><!-- path-leading-colon-colon-relative -->
<a href="::23"></a><!-- path-colon-colon-number-relative -->
<a href="/💩"></a><!-- path-slash-pile-of-poo -->
<a href="file:"></a><!-- scheme-file-scheme-only -->
<a href="file:/"></a><!-- scheme-file-slash-only -->
<a href="file://"></a><!-- scheme-file-slash-slash-only -->
<a href="file:test"></a><!-- scheme-file-no-slash -->
<a href=""></a><!-- empty-href -->