Markdown links

A link is square brackets for the text followed by round brackets for the address. Everything else is a variation on that.

[MarkdownForge](https://markdownforge.com)

[With a title](https://commonmark.org "CommonMark spec")

A [reference link][spec] keeps long URLs out of the sentence.

[spec]: https://spec.commonmark.org/

<https://github.com> is an autolink.

[Jump to a heading](#links-to-headings)

Inline links

Write the visible text in square brackets and the URL in parentheses, with no space between them: [text](https://example.com). An optional title goes inside the parentheses in quotes and shows as a tooltip: [text](https://example.com "Title").

Reference-style links

Put a label in the second pair of brackets, then define it anywhere in the document on its own line: [text][label] and [label]: https://example.com. Labels are case-insensitive and the definition never renders. This keeps paragraphs readable when URLs are long, and lets you reuse one URL many times.

Autolinks and bare URLs

Angle brackets turn a URL or email into a link: <https://example.com>, <me@example.com>. GitHub Flavored Markdown also links bare URLs such as https://example.com automatically; strict CommonMark does not.

GitHub, GitLab and most renderers give every heading an id: lowercase, spaces become hyphens, punctuation is dropped. ## Getting Started becomes #getting-started, so [see setup](#getting-started) jumps there. Duplicate headings get -1, -2 suffixes.

Relative links

In a repository, link to other files with relative paths: [Contributing](CONTRIBUTING.md) or [API](docs/api.md#auth). GitHub resolves these against the current file.

Open in a new tab

Markdown has no syntax for target="_blank". Where HTML is allowed, write the link as HTML: <a href="https://example.com" target="_blank" rel="noopener">text</a>. GitHub strips the target attribute, so on GitHub it is not possible.

Spaces and parentheses in URLs

Encode spaces as %20 or wrap the URL in angle brackets: [file](<my file.pdf>). Balanced parentheses inside a URL work; unbalanced ones need %28/%29.

Quick answers

Why is my Markdown link not working?
The most common causes are a space between ] and (, an unencoded space inside the URL, or a missing https:// so the renderer treats the address as a relative path.
How do I make a link open in a new tab in Markdown?
Standard Markdown can’t. Use an HTML <a target="_blank" rel="noopener"> tag where your renderer allows HTML. GitHub removes target attributes.
How do I link to a section of the same page?
Use the heading’s generated id: [text](#heading-text-in-kebab-case).