HTML Link Generator
Configure an HTML anchor tag — href, target, rel, title, download, and more — and get the ready-to-paste code with a live preview.
Last updated: May 21, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is HTML Link Generator?
The HTML `<a>` (anchor) element creates hyperlinks between pages, files, email addresses, or any URL. It supports a wide range of attributes that control link behaviour: `target` defines where to open the link, `rel` communicates the link relationship to browsers and search engines, `download` triggers a file download, and `title` provides a tooltip.
This generator lets you configure all standard anchor attributes through a form and generates the correct HTML syntax, including the recommended `rel="noopener noreferrer"` for external links that open in a new tab.
How to Use HTML Link Generator
Enter the destination URL in the href field
Enter the link text that users will see
Choose the target (same tab, new tab, etc.)
Add optional attributes like rel, title, id, class
Enable download if the link should trigger a file download
Copy the generated HTML
Common Use Cases
- Developers hand-writing HTML who need a quick anchor tag with the right attributes.
- Content editors adding links to HTML email templates or CMS fields.
- Developers creating download links that should trigger the browser save dialog.
- Teams ensuring all external links include rel="noopener noreferrer" for security.
Example Input and Output
An external link that opens in a new tab with proper rel attribute.
href: https://example.com
text: Visit Example
target: _blank
rel: noopener noreferrer<a href="https://example.com" target="_blank" rel="noopener noreferrer">Visit Example</a>Privacy
All HTML generation runs in your browser. No data is sent to any server.
Frequently Asked Questions
Why should I add rel="noopener noreferrer" for _blank links?
Without it, the opened page can access the opener via window.opener, which is a security risk. noopener prevents this. noreferrer additionally hides the referrer header. Browsers now default noopener for _blank links in many cases, but explicitly setting it is still best practice.
What does the download attribute do?
The download attribute tells the browser to download the linked resource instead of navigating to it. You can optionally specify a filename. It works for same-origin resources or data URIs; cross-origin files require appropriate CORS headers.
Related Tools
HTML Button Generator
Generate HTML button elements with type, id, class, style, onclick, disabled, aria-label, and other attributes. Preview included.
HTML Meta Tags Generator
Generate SEO and social meta tags including Open Graph, Twitter Card, charset, viewport, description, and canonical URL.
HTML Table Generator
Generate HTML table code with configurable rows, columns, headers, borders, captions, and attributes. Copy ready-to-use table markup.
HTML Progress Bar Generator
Generate HTML progress bar elements with value, max, label, id, class, and style attributes. Includes live preview.
HTML Text Input Generator
Generate HTML text input elements with placeholder, minlength, maxlength, pattern, autocomplete, spellcheck, and label attributes. Live preview included.
HTML URL Input Generator
Generate HTML <input type="url"> elements with placeholder, pattern, autocomplete, maxlength, required, readonly, disabled, and label. Live preview included.

