MDConverter
Universal In-Browser Converter
100% Client-Side Private

Markdown Links: Every Way to Add a Link

By the MDConverter team · Updated · 3 min read

Quick answer

A Markdown link is the link text in square brackets followed immediately by the URL in parentheses: [MDConverter](https://mdconverter.net). Add a title in quotes after the URL for a hover tooltip, use #heading-name to link to a section, or a relative path such as docs/setup.md to link to another file. Markdown cannot open links in a new tab on its own — that needs HTML (<a target="_blank">) or a renderer setting.

The most common form. No space is allowed between ] and (.

Markdown
Read the [CommonMark spec](https://spec.commonmark.org).

Hover for a [tooltip](https://commonmark.org "CommonMark home page").
Result

Read the CommonMark spec.

Hover for a tooltip.

Wrap a URL or email address in angle brackets to make it clickable as-is. GitHub and most GFM renderers also link bare URLs that start with https:// or www. automatically.

Markdown
<https://mdconverter.net>

<hello@mdconverter.com>

https://www.example.com is linked automatically in GFM.
For an email link with custom text, use [Email us](mailto:hello@mdconverter.com).

Put a short label in the text and define the URL elsewhere — usually at the bottom of the document. The definitions never appear in the output. Useful for long URLs and for links you repeat.

Markdown
Compare [CommonMark][cm] with [GitHub Flavored Markdown][gfm].
Both build on [the original Markdown].

[cm]: https://commonmark.org
[gfm]: https://github.github.com/gfm/ "GFM spec"
[the original Markdown]: https://daringfireball.net/projects/markdown/
Result
Labels are case-insensitive. The third link uses its own text as the label (a "shortcut" reference).

Use # plus the heading's anchor: lowercase, spaces replaced by hyphens, punctuation removed. ## Install & Setup becomes #install--setup. The rules are covered in detail in Markdown headings.

Markdown
Jump to [Installation](#installation) or the [FAQ](#faq).
Result

Jump to Installation or the FAQ.

In a repository or docs site, link to other Markdown files with a relative path so the link keeps working on forks, branches and local clones:

  • [Setup guide](docs/setup.md) — a file in a sub-folder
  • [Changelog](../CHANGELOG.md) — one folder up
  • [Install section](docs/setup.md#install) — a heading in another file
  • On GitHub, a path starting with / is relative to the repository root.

If a path contains spaces, wrap it in angle brackets — [Notes](<my notes/todo.md>) — or encode the spaces as %20.

Opening a link in a new tab

Standard Markdown has no syntax for this. Your options:

  1. HTML, where it is allowed: <a href="https://example.com" target="_blank" rel="noopener">Example</a>. GitHub removes the target attribute, so it has no effect there.
  2. Attribute lists in renderers that support them (Kramdown, Pandoc, MkDocs with attr_list): [Example](https://example.com){:target="_blank"}.
  3. Site settings — many static site generators and themes can open all external links in a new tab.

Link text can contain formatting, and an image can be wrapped in a link — the pattern behind every README badge.

Markdown
[**Bold link text**](https://example.com)

[![MDConverter logo](/logo.png)](https://mdconverter.net)

Markdown to Word turns links into real clickable hyperlinks, and Markdown to PDF keeps them clickable in the PDF. In the other direction, HTML to Markdown and Word to Markdown convert hyperlinks to [text](url) syntax. For plain text, the plain-text converter lets you keep links as “text (URL)” or text only.

Link support by app

AppSupportedNotes
GitHub / GitLabYesInline, reference, autolinks, relative links; target is stripped.
ObsidianYesMarkdown links plus [[wiki links]] between notes.
DiscordYesMasked links [text](url) in messages; a confirmation dialog appears before opening.
SlackPartlyPasted [text](url) is not converted; Slack’s own format is <url|text> (see Markdown to Slack).
RedditYesInline links in Markdown mode.
NotionYesTyping or pasting [text](url) creates a link.

Common mistakes and how to fix them

ProblemFix
Link shows as [text] (url)Remove the space between ] and (.
URL with parentheses breaks the linkEncode them as %28 and %29, or wrap the URL in <…>.
Relative link works locally but 404s on the siteStatic site generators often need the built URL (/docs/setup/) instead of the file name. Check your generator’s docs.
Section link does nothingThe anchor must match the heading’s generated ID exactly — lowercase, hyphens, no punctuation.

Tools for this

Frequently Asked Questions

Frequently Asked Questions About Links

Comprehensive answers to common technical, formatting, security, and compatibility questions.

Markdown itself cannot. Use an HTML link with target="_blank" rel="noopener" where HTML is allowed, an attribute list such as {:target="_blank"} in Kramdown or MkDocs, or a site-wide setting. GitHub strips target attributes, so links always open in the same tab there.

Sources

← All Markdown lessons · Markdown cheat sheet