Markdown Underline
Standard Markdown has no underline syntax. The workaround is HTML: <ins> on GitHub, <u> in Obsidian, VS Code, and most renderers that allow HTML. Discord is the exception with its own syntax.
Jump to: Why no underline? · HTML <u> tag · <ins> tag (GitHub) · Common mistakes · Discord · Other syntaxes · Platform support · FAQ
Short answer
Markdown has no underline syntax, so you borrow HTML. On GitHub use <ins>text</ins>, because GitHub strips <u>. In Obsidian, the VS Code preview, and most static-site generators, <u>text</u> works too. On Discord, type __text__. Reddit can't underline at all, and Notion and Slack only underline with Cmd/Ctrl+U or the toolbar.
Why Standard Markdown Has No Underline
John Gruber's original Markdown never had an underline: asterisks and underscores map to emphasis (<em>) and strong emphasis (<strong>), and CommonMark kept that design. The usual explanation is that on the web, underlined text reads as a link, so underline is a confusing way to emphasize words.
Most flavors follow suit. Discord is the best-known exception, and a few tools such as Pandoc add their own syntax (see other underline syntaxes).
The HTML <u> Tag Workaround
Wrap your text in <u>text</u> to add an underline. This works in Obsidian, the VS Code preview, and most static-site generators, anywhere the renderer passes inline HTML through.
<u>: the text survives, the underline doesn't. Inline style attributes are stripped too. Use <ins> there instead, which is what GitHub's own docs recommend.Markdown
<u>This text is underlined.</u>Preview
This text is underlined.
Markdown
This is normal text with <u>underlined words</u> inside a sentence.Preview
This is normal text with underlined words inside a sentence.
Markdown
**Bold** text and <u>underlined text</u> in the same line.Preview
Bold text and underlined text in the same line.
Markdown
<u>**Underlined and bold**</u> — combine both effects.Preview
Underlined and bold — combine both effects.
The <ins> Tag: Underline That Works on GitHub
Browsers underline <ins> by default, just like <u>, and it is on GitHub's and GitLab's HTML allowlists. That makes it the most portable underline in Markdown, and it is the tag GitHub's formatting docs list for underline. Semantically it marks content inserted into a document, so it fits changelogs and diffs best, but it is the practical choice for plain underlining on GitHub too.
Markdown
This is an <ins>underlined</ins> word.Preview
This is an underlined word.
Markdown
<ins>**Bold and underlined**</ins> works too.Preview
Bold and underlined works too.
Markdown
Original text. <ins>This was added later.</ins> More original text.Preview
Original text. This was added later. More original text.
Common Mistakes
Underscores in Markdown do not create underline — they create emphasis. Here is what actually happens when you try the obvious guesses:
What you type
_This creates italic, not underline._What you get
This creates italic, not underline.
What you type
__This creates bold, not underline.__What you get
This creates bold, not underline.
The fix for both: use <ins>text</ins> (or <u>text</u> outside GitHub and GitLab) instead of underscores.
Discord Native Underline
Discord is the best-known platform with real underline syntax. Use __text__ (double underscores) to underline text in Discord. This is Discord-specific: the same syntax creates bold in standard Markdown.
Discord syntax
__underline text__Discord syntax
__**underline + bold**__Discord syntax
__*underline + italic*__Discord syntax
__***underline + bold + italic***__Using Discord? See the full Discord Markdown guide for every formatting trick available in Discord.
Other Underline Syntaxes
A few tools went further than HTML and gave underline its own markup. None of these work outside the tool that defines them.
| Where | Syntax | Notes |
|---|---|---|
| Discord | __text__ | Double underscores underline instead of bolding |
| Telegram Bot API (MarkdownV2) | __text__ | Same idea as Discord, for bot messages |
| Pandoc | [text]{.underline} | A bracketed span with the underline class |
| markdown-it + markdown-it-ins plugin | ++text++ | Outputs <ins>text</ins> |
Platform Support
Support splits three ways: renderers that pass <u> through, sanitizers like GitHub's that keep only <ins>, and editors with no HTML at all.
| Platform | Underline? | Method | Notes |
|---|---|---|---|
| GitHub | Partial | <ins>text</ins> | <u> and style attributes are stripped; <ins> is kept |
| GitLab | Partial | <ins>text</ins> | <u> is not on its HTML allowlist; <ins> is |
| Obsidian | Yes | <u>text</u> or <ins>text</ins> | HTML passes through |
| VS Code preview | Yes | <u>text</u> or <ins>text</ins> | HTML passes through |
| Discord | Yes | __text__ | Native syntax; HTML is not rendered |
| Notion | Partial | Cmd/Ctrl+U | Shortcut or toolbar only; no markup, HTML not rendered |
| Slack | Partial | ⌘U (Mac composer) | Composer only; no mrkdwn or markdown-block syntax |
| No | None | No syntax, and HTML is stripped | |
| Pandoc | Yes | [text]{.underline} | Pandoc's own span syntax |
| CommonMark / standard Markdown | No | None | Only the HTML workaround |
Quick Reference
| Syntax | Result | Works in |
|---|---|---|
| <ins>text</ins> | underlined text | GitHub, GitLab, VS Code, Obsidian |
| <u>text</u> | underlined text | VS Code, Obsidian, most static-site generators (not GitHub) |
| __text__ | underlined | Discord only (bold elsewhere) |
| [text]{.underline} | underlined | Pandoc |
| _text_ | italic (not underline) | Do not use for underline |
Frequently Asked Questions
How do I underline text in Markdown?
Standard Markdown has no underline syntax, so you use HTML. On GitHub, use <ins>text</ins>: GitHub strips the <u> tag, and its own formatting docs list <ins> for underline. In Obsidian, the VS Code preview, and most static-site generators, <u>text</u> works as well. On Discord, type __text__. Reddit has no way to underline, and Notion and Slack only underline through a shortcut or the toolbar.
Why doesn't Markdown support underline?
John Gruber's original Markdown never had underline syntax: asterisks and underscores map to emphasis (<em>) and strong emphasis (<strong>), and CommonMark kept that design. The usual explanation is that on the web, underlined text reads as a link, so underline is a poor way to add emphasis.
Does _text_ create underline in Markdown?
No. Single underscores (_text_) create italic text in Markdown, not underline. Double underscores (__text__) create bold text in standard Markdown. Neither creates underline, except on Discord, where __text__ is Discord's native underline syntax.
What is the difference between <u> and <ins>?
Both are underlined by default. In HTML, <ins> marks content added to a document, as in a diff or changelog. <u> marks a non-textual annotation, such as a misspelled word or a proper name in Chinese text. In practice <ins> is the more portable choice for Markdown, because GitHub and GitLab keep it and strip <u>.
Does Discord have native underline syntax?
Yes. Discord uses __text__ (double underscores) for underline. This is Discord-specific and replaces the standard Markdown meaning of double underscores, which is bold. It does not work in GitHub, Notion, or other standard Markdown tools. You can stack it: __**underlined bold**__.
Can I underline text in GitHub Markdown?
Yes, with <ins>text</ins>. GitHub's HTML sanitizer removes <u> tags (the text stays, the underline disappears) and strips style attributes, so <span style="text-decoration: underline"> doesn't work either. <ins> survives, and GitHub's own formatting docs list it as the underline syntax. It works in READMEs, issues, pull requests, comments, and wikis.
Does the <u> tag work in every Markdown editor?
No. It works where the renderer passes HTML through: Obsidian, the VS Code preview, and most static-site generators. GitHub and GitLab sanitize HTML against an allowlist that includes <ins> but not <u>. Reddit strips HTML entirely, and Notion does not render typed HTML at all. If you need one tag that works in the most places, use <ins>.
How do you underline text on Reddit?
You can't. Reddit has no underline syntax, and it strips HTML tags, so neither <u> nor <ins> works in posts or comments. Bold (**text**) or italics (*text*) are the alternatives.
How do I underline in Notion or Slack?
Use the shortcut or the formatting toolbar. Notion uses Cmd+U on Mac or Ctrl+U on Windows. Slack documents ⌘U for its Mac composer. Neither has underline markup you can type, and Slack's mrkdwn and markdown blocks have no underline at all.
Can I underline with CSS in Markdown?
Only where inline styles survive. <span style="text-decoration: underline">text</span> works in Obsidian and the VS Code preview, but GitHub removes the style attribute and leaves plain text. Use <ins> for GitHub.