How to use the html link generator
- Choose the link type: a normal web address, an email address or a phone number.
- Type or paste the destination, then the text people will see. Leave the text empty to show the address itself.
- Tick the options you need: new tab, noreferrer, nofollow, sponsored or ugc. The matching target and rel attributes are added in the right order.
- Copy the generated anchor tag and paste it into your HTML, CMS or email template.
How to turn HTML text to link markup
Turning html text to link markup takes one element: <a href="URL">text</a>. The href attribute holds the destination and the text between the tags is what the visitor clicks. To make text a link html needs nothing else, but real pages usually add target, rel and title.
This generator builds the tag in the order most style guides use: href, target, rel, title. Characters that would break the markup, such as quotes, ampersands and angle brackets, are escaped in both the address and the visible text.
The rel values: noopener, noreferrer, nofollow, sponsored, ugc
The rel attribute describes the relationship between your page and the target. Each option does something different.
| Value | What it does | Use it when |
|---|---|---|
noopener | Cuts the new tab's access to window.opener | Any link with target="_blank" |
noreferrer | Hides the referring page and implies noopener | You do not want the target to see where visitors came from |
nofollow | Asks search engines not to pass endorsement | You do not vouch for the page |
sponsored | Marks paid or affiliate links | You were paid or given something for the link |
ugc | Marks user-generated content | Comments, forum posts and reviews |
Values combine with spaces, so a paid link in a new tab can read rel="noopener noreferrer sponsored". Modern browsers already treat target="_blank" as noopener, but writing it out keeps older browsers and linters happy.
Create an HTML link generator output for email and phone
An html link generator is not only for web pages. Choose Email and the tool writes a mailto: link; add a subject and it is percent-encoded, so spaces become %20 and an ampersand becomes %26. Choose Phone and the number is reduced to digits with an optional leading plus sign, giving a link such as tel:+15551234567 that phones and softphones can dial. The visible text keeps the formatting you typed.
Use the international format with a country code for phone links, otherwise the number only works from one country.
Blocked schemes: why javascript: links are rejected
A link whose address starts with javascript: runs code when clicked, which is a classic cross-site scripting hole when the address comes from user input. The tool refuses it, including disguised forms with mixed case, tabs, newlines or leading control characters, because browsers ignore those when they read the scheme. vbscript:, data:, file: and other unlisted schemes are refused as well.
Allowed schemes are http, https, mailto, tel, sms and ftp. Relative addresses that start with /, #, ? or ./ are kept as they are, and a bare domain such as example.com/page gets https:// added.
Link text, accessibility and SEO
Descriptive link text helps both screen reader users, who often navigate by a list of links, and search engines, which read the anchor text as a hint about the target. "Read the pricing guide" says more than "click here". Keep the text short, make it make sense out of context and avoid using a bare URL unless the address itself is the point.
The title attribute shows a tooltip on hover but is not reliably announced, so never put essential information only there. If you also need to turn pasted prose into paragraphs with links, use the text to HTML converter, and to check how the result looks, paste it into the HTML viewer.
Worked examples
| Example | Input | Result |
|---|---|---|
| External link, new tab | Link type: web; URL, email address or phone number: https://example.com/docs; Link text: Documentation; Open in a new tab (target="_blank"): yes; Add noreferrer: yes; Add nofollow: no; Add sponsored (paid links): no; Add ugc (user-generated content): no | href: https://example.com/docs; rel: noopener noreferrer; Opens in: new tab |
| Paid link | Link type: web; URL, email address or phone number: https://shop.example.com/?aff=42&sku=7; Link text: Buy the book; Open in a new tab (target="_blank"): yes; Add noreferrer: yes; Add nofollow: yes; Add sponsored (paid links): yes; Add ugc (user-generated content): no | href: https://shop.example.com/?aff=42&sku=7; rel: noopener noreferrer nofollow sponsored; Opens in: new tab |
| Email with subject | Link type: email; URL, email address or phone number: help@example.com; Link text: Contact support; Email subject (email links only): Question about my order; Open in a new tab (target="_blank"): no; Add noreferrer: no; Add nofollow: no; Add sponsored (paid links): no; Add ugc (user-generated content): no | href: mailto:help@example.com?subject=Question%20about%20my%20order; rel: none; Opens in: same tab |
| Phone link | Link type: phone; URL, email address or phone number: +1 (555) 123-4567; Link text: Call us; Open in a new tab (target="_blank"): no; Add noreferrer: no; Add nofollow: no; Add sponsored (paid links): no; Add ugc (user-generated content): no | href: tel:+15551234567; rel: none; Opens in: same tab |
FAQ
How do I make text a link in HTML?
Wrap the text in an anchor element: <a href="https://example.com">your text</a>. This generator builds that tag for you and escapes special characters.
How do I open a link in a new tab?
Add target="_blank" and rel="noopener". The new-tab option here adds both, plus noreferrer if you tick it.
When should I use nofollow, sponsored or ugc?
Use sponsored for paid or affiliate links, ugc for links inside user comments and posts, and nofollow when you do not want to endorse the target for any other reason.
Can I create a mailto or tel link?
Yes. Switch the link type to Email or Phone. An optional subject is encoded for you, and phone numbers are cleaned to digits with an optional leading plus sign.
Why was my javascript: link rejected?
Links that start with javascript: run code on click and are a common XSS vector. Use a normal address, and attach behaviour with an event listener instead.
Is the URL sent to a server?
No. The tag is generated in your browser and nothing is uploaded.
Sources and references
- The anchor element, MDN Web Docs: href, target and rel behaviour
- rel attribute values, MDN Web Docs: noopener, noreferrer, nofollow, sponsored and ugc