How to Underline Text in Markdown (There Is No Syntax, Here Are the Workarounds)

Markdown has no underline. Use the HTML u tag where HTML is allowed, __text__ in Discord, +text+ in Jira, or a different emphasis. What works on GitHub, Notion, Slack and Obsidian.

Markdown has no underline syntax. The closest you can get depends on where the text will be displayed. The most portable approach is inline HTML:

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

This is underlined text.

It works in any renderer that passes inline HTML through. Many do not, so here is what to expect.

Underline by platform

Platform Underline
Obsidian, VS Code preview, most static site generators <u>text</u>
Discord __text__ (Discord uses double underscores for underline, not bold)
Notion Cmd/Ctrl + U in the editor. Pasted Markdown has no underline syntax
Jira and Confluence wiki markup +text+
Slack No underline formatting in messages
GitHub README and comments HTML is sanitized. Test <u> first. <ins>text</ins> is the semantic alternative
Reddit Not supported
Pandoc [text]{.underline}
Word and Google Docs Not Markdown. Use Cmd/Ctrl + U

The Discord row is the one that surprises people. In standard Markdown __text__ means bold, so a document written for Discord and a document written for GitHub disagree about the same characters.

Why Markdown never added underline

Underlined text on the web looks like a link. Markdown was designed around plain-text conventions that map to semantic HTML: emphasis, strong emphasis, links, code. Underline is purely visual, so the original spec left it out, and CommonMark followed. Underline in a rendered page can confuse readers who expect to click it, so consider whether you need it at all.

Alternatives that always work

If you cannot rely on HTML, pick a different way to draw the eye:

  • Bold for warnings and key terms: **text**.
  • Italics for new terms and titles: *text*.
  • A heading, if the underlined text is really a title. In Setext style, a heading is underlined with === or ---, which is the literal origin of "underlined text" in Markdown:
Page Title
==========

Section Title
-------------
  • A block quote or a callout for things that must stand out. The callout generator builds GitHub-style alerts.

Underline with CSS

If you control the site, add a class and style it. With a renderer that allows HTML and attributes:

<span class="u">important</span>
.u { text-decoration: underline; text-underline-offset: 3px; }

If you are using a static site generator with a plugin such as attribute lists ({.u}), you can apply the same class without writing HTML. Check your renderer's docs for the exact syntax.

Underline when exporting to Word or PDF

For Word documents, the Markdown to Word converter and Markdown to PDF converter are the right place to check how your underline survives. HTML tags in the source are the part most likely to be stripped or shown literally, so preview the export before sending it. The live preview editor shows what a standard HTML renderer does with <u>.

See also bold, italics, strikethrough, changing text color and the Markdown cheat sheet.