MDUtil

Underline Text in Markdown

Markdown has no syntax for underline, so underlined text is written with HTML: <ins>text</ins> or <u>text</u>. This guide shows which tag to use where, and the shortcuts some apps add.

Quick answer

How do you underline text in Markdown?

Markdown has no underline syntax. Where HTML is allowed, wrap the text in <ins> or <u>: <ins>underlined</ins>. Use <ins> on GitHub, which removes <u>. In Discord, two underscores underline text instead: __text__.

Markdown
<ins>This text is underlined</ins>

<u>This text is underlined too</u>

Result

This text is underlined

This text is underlined too

Ways to underline in Markdown

The HTML tags work in any app that keeps inline HTML. A few apps have their own syntax, shown here with the app it belongs to.

The <ins> tag

Marks inserted text and is underlined by default. It also works on GitHub, which removes <u>.

Markdown
The API now accepts <ins>bearer tokens</ins>.

Result

The API now accepts bearer tokens.

The <u> tag

Underlines text without extra meaning. Works in editors that keep HTML, such as Obsidian, Typora and VS Code.

Markdown
Read the <u>installation notes</u> before upgrading.

Result

Read the installation notes before upgrading.

With bold or italic

Markdown inside the tag still works, and the tag can sit inside bold or italic text.

Markdown
<ins>**Important:**</ins> restart after upgrading.

**Bold and <ins>underlined</ins>**

Result

Important: restart after upgrading.

Bold and underlined

Headings and table cells

The tags work inside headings, list items and table cells too.

Markdown
## <ins>Release notes</ins>

| Field | Status |
| --- | --- |
| Email | <ins>required</ins> |

Result

Release notes
FieldStatus
Emailrequired

Discord: two underscores

In Discord, two underscores underline text and combine with asterisks. Discord shows HTML tags as typed.

Markdown
__underlined__

***__bold, italic and underlined__***

Discord only. Other Markdown apps display this differently, so there is no preview.

Pandoc: the underline class

Pandoc underlines a bracketed span with the .underline class and keeps the underline in Word and PDF output.

Markdown
[underlined text]{.underline}

Pandoc only. Other Markdown apps display this differently, so there is no preview.

Underline in popular apps

Support depends on whether the app keeps HTML and which tags it allows.

AppSupportNotes
GitHubDiffers<ins> is underlined. <u> and style attributes are removed.
DiscordDiffers__text__ underlines. HTML tags are shown as typed.
SlackNot supportedNo typed syntax; underline with the toolbar or ⌘U / Ctrl+U.
ObsidianSupported<u> and <ins> both work.
NotionNot supportedNo typed syntax; underline with Ctrl+U or ⌘U.
Typora / VS CodeSupported<u> and <ins> work in the editor and preview.

Questions and answers

Does Markdown have underline syntax?

No. Markdown has no underline syntax; on the web, underlined text is easily mistaken for a link. Use the HTML tags <ins> or <u> where HTML is allowed.

How do I underline text on GitHub?

Use <ins>text</ins>. GitHub removes the <u> tag and style attributes, which leaves plain text.

What is the difference between <u> and <ins>?

<ins> marks text added to a document and is underlined by default. <u> marks text that should look different without extra meaning, such as a misspelled word. Both look the same.

How do I underline text in Discord?

Wrap it in two underscores: __text__. Add asterisks for more, as in __**bold and underlined**__.

Why does my <u> tag show as plain text?

The app removes or escapes HTML. GitHub drops <u> but keeps <ins>; Discord, Slack and Reddit show tags as typed or remove them. Use the app's own syntax, such as __text__ in Discord.

Can I underline a heading or a table cell?

Yes. Put the tag inside the heading or cell: ## <ins>Title</ins> or | <ins>cell</ins> |.

Is underlined text bad for accessibility?

Readers often take underlined text for a link and try to click it. Underline sparingly, and use bold or italic for emphasis.

Does the underline survive a Word or PDF export?

With <u> or <ins>, yes: Markdown to Word and Markdown to PDF both keep it.