MDUtil

Links in Markdown

Put the link text in square brackets and the address in parentheses: [text](https://example.com). This guide covers every link form, links to headings and files, and how chat apps handle them.

Quick answer

How do you add a hyperlink in Markdown?

Write the link text in square brackets followed by the address in parentheses, with no space between them: [Example](https://example.com). Add a title in quotes after the address to show it on hover, and wrap a bare address in angle brackets, <https://example.com>, to link it as it is.

Markdown
[Example](https://example.com)

<https://example.com>

Link syntax and examples

All of these produce an ordinary <a> link; they differ in how the address is written.

Link with a title

Text in quotes after the address becomes the link's title, which browsers show on hover.

Markdown
[Example](https://example.com "Shown on hover")

Result

Automatic links

An address in angle brackets becomes a link to itself. GitHub Flavored Markdown also links bare https:// and www. addresses, and email addresses in angle brackets.

Markdown
<https://example.com>

https://example.com

<[email protected]>

Reference links

Give the address a label and define it anywhere in the document. Long URLs stay out of the paragraph, and several links can share one address.

Markdown
Read the [style guide][style] and the [FAQ][].

[style]: https://example.com/style
[FAQ]: https://example.com/faq

Result

Read the style guide and the FAQ.

Links to headings

Use # and the heading's id. Most renderers build the id from the heading text in lowercase, with spaces turned into hyphens.

Markdown
[Jump to Installation](#installation)

Addresses with spaces or parentheses

Wrap an address that contains spaces in angle brackets. Balanced parentheses can stay as they are.

Markdown
[The report](<https://example.com/annual report.pdf>)

[Disambiguation](https://en.wikipedia.org/wiki/Markdown_(disambiguation))

Linked images

Put an image inside the link text to make the image clickable, as in README badges.

Markdown
[![Docs passing](/samples/badge.svg)](https://example.com/docs)

Result

Docs passing

Links in popular apps

[text](url) works almost everywhere. Chat apps are the exception.

AppSupportNotes
GitHub / GitLabSupportedEvery link form works; bare URLs become links and headings get ids for # links.
DiscordDiffers[text](https://…) works in messages, and bare URLs become links.
SlackDiffers[text](url) works once "Format messages with markup" is on under Preferences → Advanced; otherwise use the link button.
ObsidianSupportedMarkdown links work, and [[Note name]] links to another note.
RedditSupported[text](url) works, and bare URLs become links.

Questions and answers

Why is my Markdown link not working?

Check for a space between ] and (, for spaces in the address (wrap it in < >), and for a missing https://, without which the address counts as a path on the current site.

How do I link to a heading on the same page?

Use # and the heading's id: [Install](#installation). On GitHub the id is the heading text in lowercase, with spaces turned into hyphens and most punctuation removed.

How do I add a hyperlink in Discord?

Write [text](https://example.com) in a message. Discord shows the text as a link.

Can a Markdown link open in a new tab?

Markdown has no syntax for it. Where HTML is allowed, write the link as HTML: <a href="https://example.com" target="_blank">text</a>. Sites that clean HTML may remove target.

What is the difference between inline and reference links?

Inline links put the address right after the text. Reference links use a short label and list the addresses elsewhere, which keeps long URLs out of paragraphs and lets several links share one address.

How do I link to another Markdown file?

Use a relative path: [Guide](docs/guide.md). GitHub and most site generators open that file's page.

How do I make an email link?

Wrap the address in angle brackets, <[email protected]>, or write [Email us](mailto:[email protected]).

How do I show brackets without making a link?

Put a backslash before the opening bracket: \[not a link](https://example.com).