How to Underline in Markdown: 4 Methods Complete Guide

Markdown doesn't have a native underline syntax. When John Gruber designed Markdown in 2004, he deliberately left it out — underlined text on the web is almost universally associated with hyperlinks, so adding an underline syntax would create confusion.

But the need is real — reports need highlighted key points, notes need emphasis, and some academic formats explicitly require underlining. I've tested every underline method across GitHub, GitLab, Typora, Obsidian, Jupyter Notebook, and Discord. This article covers all the reliable approaches so you can pick what works for your platform.

Method 1: The <u> Tag (Most Common)

This is the most straightforward approach. Since Markdown supports inline HTML, you can use the HTML underline tag directly:

<u>This text will be underlined</u>

Rendered result: This text will be underlined

Using It in a Sentence

Please note that <u>the deadline is next Friday</u> and late submissions will not be accepted.

Rendered result: Please note that the deadline is next Friday and late submissions will not be accepted.

<u> Tag Compatibility

PlatformSupportNotes
GitHub (README)PartialWorks in body text, not in headings
GitLabYes
TyporaYes
VS Code PreviewYes
ObsidianYes
Jupyter NotebookYes
Jekyll / HugoYes
GitHub Issues/PRsNoUse <ins> instead

For most situations, the <u> tag works fine. But in GitHub Issue comments and PR descriptions, it gets stripped out. That's when you need the <ins> tag covered next.

It's worth noting that the <u> tag was marked as "deprecated" in the HTML4 era, but the HTML5 spec has restored it. The official semantic definition is "a span of text with an unarticulated, though explicitly rendered, non-textual annotation." So it's safe to use going forward.

Method 2: The <ins> Tag (Best for GitHub)

<ins> is the HTML "insert" tag, semantically representing "newly added content." It's typically paired with <del> (the delete tag). Most Markdown renderers display it with an underline:

<ins>This text will also be underlined</ins>

Rendered result: This text will also be underlined

When to Use <ins> Over <u>

If you primarily write documentation on GitHub (Issues, PR descriptions, comments), go straight to <ins>:

### <ins>Important Heading</ins>

This renders correctly with an underline on GitHub. Using <u> won't work here — GitHub's Markdown renderer strips <u> tags in headings and Issue comments but leaves <ins> alone.

I once tried to underline a heading in a PR description using <u> and it just wouldn't render. After checking Stack Overflow, I discovered GitHub handles these two tags differently. Since then, I default to <ins> for all GitHub markdown.

<u> vs <ins> Comparison

TagSemanticsHTML5 StatusGitHub HeadingsGitHub Body
<u>Unarticulated annotationValidNot supportedPartial
<ins>Inserted contentValidSupportedSupported

Semantically, if you just want to underline text for emphasis, <u> is more accurate. If you're marking "newly inserted" content, <ins> is more appropriate. But in practice, <ins> has better compatibility on GitHub specifically.

Method 3: CSS text-decoration Style (Most Flexible)

If your Markdown rendering environment supports CSS (like a self-hosted blog, Hugo, or Jekyll site), you can use inline styles for finer control:

<span style="text-decoration: underline;">Underlined text</span>

Rendered result: Underlined text

The advantage is you can combine it with other styles:

<span style="text-decoration: underline wavy red;">Red wavy underline</span>

Rendered result: Red wavy underline

text-decoration supports quite a few style values:

ValueEffect
underlineStandard underline
underline wavyWavy line
underline dottedDotted line
underline dashedDashed line
underline doubleDouble line
underline redRed underline
underline wavy red 2pxRed wavy line, 2px thickness

Keep in mind that GitHub strips all inline CSS, so this method won't work there. Discord and Obsidian's live preview also don't support custom CSS.

Method 4: Discord Syntax __underline__

If you're writing in Discord, there's good news — Discord has its own underline syntax that doesn't require HTML tags:

__This text will be underlined__

Just wrap the text with double underscores. Discord also supports combining underline with other formats:

__*underline italics*__
__**underline bold**__
__***underline bold italics***__

It's important to note that this is Discord's own extended syntax, not standard Markdown. On most other platforms, __text__ renders as bold text, not underlined.

Platform Quick Reference

Here's a summary for quick lookup:

MethodSyntaxGitHubTyporaObsidianJupyterDiscordSelf-hosted
<u> tag<u>text</u>PartialYesYesYesN/AYes
<ins> tag<ins>text</ins>YesYesYesYesN/AYes
CSS style<span style="text-decoration:underline">NoYesPartialYesN/AYes
Discord syntax__text__BoldBoldBoldBoldUnderlineBold

Two Extra Tips

Using LaTeX for Underlines

If your platform supports LaTeX math rendering (like Jupyter Notebook or Obsidian), you can also use LaTeX commands:

$\underline{Underlined text}$

This works well for academic contexts requiring precise typesetting, but it's cumbersome for everyday use and only works in LaTeX-enabled environments.

VS Code Extension Helper

If you write Markdown frequently in VS Code, check out the Markdown Underline extension. It automatically converts ++text++ to underlined output, which is more convenient than typing HTML tags. Note that this depends on the markdown-it parser's underline plugin — not all renderers recognize the ++ syntax.

Frequently Asked Questions

Why doesn't Markdown have a native underline syntax?

Because hyperlinks on the web are displayed with underlines by default. Adding an underline syntax would make it hard for readers to distinguish between links and regular emphasized text. That's why many Markdown guides recommend using bold or italics instead of underlining for emphasis.

Should I use <u> or <ins>?

Short answer: use <ins> on GitHub, <u> everywhere else. If you don't want to think about it, <ins> works universally since the visual result is identical.

Can I underline headings?

Yes, embed the HTML tag inside the heading:

## <ins>Underlined Heading</ins>

On GitHub, make sure to use <ins> rather than <u>.

Can underline and strikethrough be combined?

Yes, just nest the tags:

<u>~~This text has both underline and strikethrough~~</u>

Rendered result: This text has both underline and strikethrough

References

Summary

Markdown has no native underline syntax, but HTML tags make it easy. For most cases, <u>text</u> is sufficient. On GitHub, <ins>text</ins> is more reliable. When you need fine-grained control, CSS text-decoration styles give you the most flexibility. The syntax itself is simple — the tricky part is the compatibility differences across platforms. Pick the right method for your platform and you're good to go.