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.

Standards-compliant markup Free & private

HTML link code generator

Your anchor tag builds live as you type.

Advanced attributes (title, class, id)

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:

AttributeExampleWhat it does
hrefhref="https://example.com"The destination URL. Required for the link to be clickable.
targettarget="_blank"Opens the link in a new browser tab instead of the current one.
relrel="noopener noreferrer nofollow"Controls security (noopener/noreferrer) and search-engine signal (nofollow/sponsored/ugc).
titletitle="Read the guide"Optional tooltip text shown when a visitor hovers over the link.
class / idclass="btn-link"Hooks used by your CSS or JavaScript to style or target the link.
Why the rel attribute matters: according to Google Search Central's guidance on qualifying outbound links, marking paid, user-generated, or untrusted links correctly helps search engines interpret your site's link profile accurately — it's a small detail that many free link generators skip entirely.

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.