HTML Link Generator
Generate correct HTML link code — href, target & rel, done right.
Skip memorizing anchor tag syntax. This html link generator builds the full <a href> element for you, including target and rel attributes, so the html code for your link is correct the first time.
HTML link code generator
Your anchor tag builds live as you type.
Anatomy of an HTML link
Every attribute, explained
An HTML hyperlink is built from the anchor element, <a>, plus a small set of attributes. Here's what each one does:
| Attribute | Example | What it does |
|---|---|---|
href | href="https://example.com" | The destination URL. Required for the link to be clickable. |
target | target="_blank" | Opens the link in a new browser tab instead of the current one. |
rel | rel="noopener noreferrer nofollow" | Controls security (noopener/noreferrer) and search-engine signal (nofollow/sponsored/ugc). |
title | title="Read the guide" | Optional tooltip text shown when a visitor hovers over the link. |
class / id | class="btn-link" | Hooks used by your CSS or JavaScript to style or target the link. |
Explore more
Related link tools & guides
FAQ
HTML link generator questions
What is href in HTML?
href stands for "hypertext reference." It's the attribute inside an HTML anchor tag that holds the destination URL — for example href="https://example.com". Without it, an <a> element isn't clickable.
How do I write the HTML code for a link?
Wrap your clickable text in an anchor tag with an href attribute pointing to the destination: <a href="https://example.com">Your link text</a>.
How do I convert a plain URL into HTML link code?
Paste the URL into the generator above, add anchor text, and the tool outputs the complete anchor tag ready to copy and paste.
What does target="_blank" do?
It opens the link in a new browser tab. Pair it with rel="noopener noreferrer" for security.
What's the difference between rel="nofollow", "sponsored", and "ugc"?
All three limit ranking credit passed through the link. Use nofollow for untrusted links, sponsored for paid/affiliate links, and ugc for user-generated content.