Markdown Underline: HTML Workarounds That Work
Markdown has no underline syntax — here are the alternatives
Why Markdown Has No Underline
If you have searched for a native way to underline text in Markdown, the short answer is: there is none. This is intentional.
Markdown was built for the web, and on the web, underlined text looks identical to a hyperlink. If Markdown included underline syntax, readers would constantly mistake emphasized words for clickable links. The CommonMark specification deliberately excludes it to keep documents readable and unambiguous.
That said, most Markdown renderers allow inline HTML, which gives you three practical workarounds.
Method 1 — The HTML <u> Tag
The simplest way to underline text in Markdown is the <u> tag. It produces a visual underline and has the broadest platform support.
This is <u>underlined text</u> in a Markdown document.
Use <u> when you need a straightforward visual underline and your target platform allows inline HTML.
Method 2 — The HTML <ins> Tag
The <ins> tag also renders as underlined text, but it carries semantic meaning: “this content was inserted.” Think of it as the track-changes equivalent in HTML. Screen readers may announce it differently than <u>.
The meeting is on <ins>Thursday</ins> <del>Wednesday</del>.
Use <ins> when the underline represents a revision or addition, not just emphasis.
Method 3 — CSS Span
For maximum control over the underline style, you can use a <span> with inline CSS. This lets you change the color, thickness, or style of the underline.
<span style="text-decoration:underline">underlined with CSS</span>
Caveat: GitHub, GitLab, and most hosted platforms strip inline style attributes for security. This method only works in environments you control, such as local viewers, static sites, or your own documentation tooling.
Platform-Specific: Discord’s Native Underline
Discord is the only major platform with native underline syntax in its Markdown variant. Wrap text in double underscores:
__underlined text__
This is Discord-specific behavior. In standard Markdown (CommonMark, GFM), __text__ produces bold, not underline. Do not rely on this syntax outside Discord.
Platform Support for <u> Tag
Not every platform allows inline HTML in Markdown. Here is how the <u> tag fares across common tools:
| Platform | <u> tag | <ins> tag | CSS span | __text__ |
|---|---|---|---|---|
| GitHub | Yes | Yes | Stripped | Bold |
| GitLab | Yes | Yes | Stripped | Bold |
| VS Code Preview | Yes | Yes | Yes | Bold |
| Obsidian | Yes | Yes | Yes | Bold |
| MDViewer | Yes | Yes | Yes | Bold |
| Slack | No | No | No | Bold |
| Discord | No | No | No | Underline |
| No | No | No | Bold |
The safest choice for most workflows is <u>. It works on every platform that permits inline HTML in Markdown.
When Not to Underline
In web-rendered Markdown, underlined text looks like a link. Readers expect to click it. If you underline a word for emphasis and it does nothing when clicked, you create confusion.
For emphasis, use the tools Markdown already provides:
**bold**for strong emphasis*italic*for light emphasis***bold italic***for maximum emphasis
Reserve underline for specific semantic needs: marking inserted text in a revision, matching a house style that requires underlines, or formatting content that will only be read as PDF or print where the link ambiguity does not apply.
FAQ
How do I underline text in Markdown?
There is no native underline syntax in Markdown. The most reliable workaround is the HTML <u> tag: write <u>your text</u> and it will render as your text on GitHub, GitLab, VS Code, Obsidian, and most Markdown viewers. See the full example above.
Why doesn’t Markdown have underline syntax?
Markdown was designed for web content, where underlined text is visually identical to a hyperlink. Including underline syntax would confuse readers who expect underlined text to be clickable. The CommonMark specification omits it deliberately to keep documents clear and unambiguous.
Does __text__ create underline in Markdown?
No. In standard Markdown (CommonMark, GitHub Flavored Markdown), __text__ produces bold text, exactly like **text**. The only platform where double underscores create an underline is Discord, which uses its own modified syntax. See the platform support table for details.
Preview Your Markdown with MDViewer
MDViewer is a free, native macOS viewer that renders HTML tags like <u> and <ins> inside your Markdown files. Open any .md file and see underlines, tables, code blocks, and Mermaid diagrams rendered instantly.
Requires macOS 13.0 or later. Intel and Apple Silicon.