Markdown Links to HTML Anchor Tags
Convert Markdown link syntax [text](url) to HTML <a> anchor tags. Covers inline links, reference links, autolinks, and adding title attributes.
Detailed Explanation
Markdown Links to HTML Anchor Tags
Markdown provides several ways to create hyperlinks, all of which convert to HTML <a> (anchor) tags.
Inline Links
The most common syntax uses square brackets for the text and parentheses for the URL:
[Visit GitHub](https://github.com)
Converts to:
<a href="https://github.com">Visit GitHub</a>
Links with Title Attribute
Add a title in quotes after the URL for a tooltip on hover:
[Visit GitHub](https://github.com "GitHub Homepage")
Converts to:
<a href="https://github.com" title="GitHub Homepage">Visit GitHub</a>
Reference-Style Links
Reference links separate the link definition from the text, improving readability in long documents:
[Visit GitHub][gh]
[gh]: https://github.com "GitHub Homepage"
The HTML output is identical to an inline link. The reference definition is not rendered in the output.
Autolinks
URLs and email addresses wrapped in angle brackets are automatically linked:
<https://github.com>
<user@example.com>
Converts to:
<a href="https://github.com">https://github.com</a>
<a href="mailto:user@example.com">user@example.com</a>
Many Markdown parsers (including GitHub Flavored Markdown) also auto-link bare URLs without angle brackets.
Fragment and Relative Links
Links can point to page anchors or relative paths:
[Jump to section](#section-id)
[See the docs](./docs/guide.md)
These are essential for internal navigation in documentation sites and wikis.
Use Case
Links are the backbone of web content. When converting Markdown documentation to HTML for static sites, wikis, or help centers, understanding anchor tag generation ensures correct navigation, proper SEO link structure, and accessible link text.