The HTML link tag: a practical reference

Updated 10 November 2026 · 8 min read · by the HTML to Link Converter team

Short answerAn HTML link is <a href="URL">text</a>. href sets the destination (web URL, relative path, #section, mailto:, tel:); target="_blank" opens a new tab; rel describes the relationship (noopener, nofollow, sponsored, ugc); download makes the browser save the file.

The basic link

<a href="https://example.com/">Example</a>

Prefer a generator? The URL to HTML link tool writes this for you.

Kinds of href

href valueGoes to
https://other.com/pageAn absolute URL on any site
about.htmlA file next to the current page
../index.htmlOne folder up
/contact/From the root of the current site
#pricingThe element with id="pricing" on this page
mailto:hi@example.comA new email (generator)
tel:+441234567890A phone call on mobile
sms:+441234567890A text message on mobile

target

_self (default) opens in the same tab, _blank in a new one. Use new tabs sparingly — for external references or downloads while a form is half-filled — because they break the Back button.

rel

  • noopener — the new tab cannot reach back via window.opener.
  • noreferrer — also hides which page sent the visitor.
  • nofollow — do not pass ranking credit; use for untrusted links.
  • sponsored — paid or affiliate links.
  • ugc — links in comments and forum posts.

download

<a href="/files/price-list.pdf" download="price-list-2026.pdf">Download the price list</a>

Works for same-origin files; browsers ignore it for cross-site URLs.

Accessible link text

  • Describe the destination: “Read the refund policy”, not “click here”.
  • Make links visibly different from text — underline or a clear colour.
  • Warn about new tabs or file downloads in the text: “(PDF, 2 MB)”.
  • Image links need alt text describing the destination.

Common mistakes

  • Missing https://: href="example.com" is treated as a relative path.
  • Nesting links inside links — invalid HTML, unpredictable behaviour.
  • Using <a> without href as a button — use <button> for actions.
  • Links to file:// paths — they only work on your machine. Convert the page to a link first.