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
| Platform | Support | Notes |
|---|---|---|
| GitHub (README) | Partial | Works in body text, not in headings |
| GitLab | Yes | — |
| Typora | Yes | — |
| VS Code Preview | Yes | — |
| Obsidian | Yes | — |
| Jupyter Notebook | Yes | — |
| Jekyll / Hugo | Yes | — |
| GitHub Issues/PRs | No | Use <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
| Tag | Semantics | HTML5 Status | GitHub Headings | GitHub Body |
|---|---|---|---|---|
<u> | Unarticulated annotation | Valid | Not supported | Partial |
<ins> | Inserted content | Valid | Supported | Supported |
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:
| Value | Effect |
|---|---|
underline | Standard underline |
underline wavy | Wavy line |
underline dotted | Dotted line |
underline dashed | Dashed line |
underline double | Double line |
underline red | Red underline |
underline wavy red 2px | Red 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:
| Method | Syntax | GitHub | Typora | Obsidian | Jupyter | Discord | Self-hosted |
|---|---|---|---|---|---|---|---|
<u> tag | <u>text</u> | Partial | Yes | Yes | Yes | N/A | Yes |
<ins> tag | <ins>text</ins> | Yes | Yes | Yes | Yes | N/A | Yes |
| CSS style | <span style="text-decoration:underline"> | No | Yes | Partial | Yes | N/A | Yes |
| Discord syntax | __text__ | Bold | Bold | Bold | Bold | Underline | Bold |
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.