Skip to content
FeaturesPricingBlogDownload
Home / Markdown syntax / Colored text in Markdown

Colored text in Markdown

Markdown has no syntax for colored text. Color needs HTML with a style attribute, such as <span style="color: red">, and only some apps keep that attribute. GitHub removes it, so on GitHub the portable ways to make text stand out are bold, a blockquote, or an alert box.

<span style="color: crimson">This text is red</span> where inline styles are allowed.

Where does colored text work?

App or spec <span style="color: ..."> Notes
CommonMark Passed through as HTML The viewer decides
GitHub No, the style attribute is removed Math with \color works
Obsidian Yes, in reading view Also ==highlight== and callouts
Pandoc HTML output only Word and PDF drop the tag
Noteline No Tags show as typed; exports keep the plain text

The older <font color="red"> tag is obsolete in HTML and is removed by many sanitizers, so <span> is the better choice where any HTML color works.

How do you color text on GitHub?

GitHub has no supported way to color normal text. Two workarounds are common:

Math with \color. GitHub renders math with MathJax, which accepts color commands:

$\color{red}{\text{Deprecated}}$ in version 3.

The text renders as a math expression, so spacing and font can differ from the paragraph, and screen readers read it as math. Use it for a word or two, not for paragraphs.

Alerts. For a colored callout box, GitHub supports alert blockquotes with five types: NOTE, TIP, IMPORTANT, WARNING and CAUTION.

> [!WARNING]
> This command deletes the branch.

GitHub also shows a small color swatch next to a color code in backticks, such as `#ff6600`, in issues, pull requests and discussions, but not in .md files (GitHub Docs, checked November 2026). That shows a sample of the color, not colored text.

What are the alternatives to colored text?

Color often carries meaning that a reader on another device, in print or with a screen reader will miss. These forms keep the meaning in the text:

  • Bold or a label: **Warning:** this deletes the branch.
  • A blockquote for a note or warning. See blockquotes.
  • A status word in a table, such as Done, Blocked or Late, instead of green and red cells.
  • Highlight: Obsidian and some other apps render ==text== with a highlight color, but others show the equals signs.

How do you color text in Word or PDF made from Markdown?

Converters drop HTML styles when they make Word or PDF files. With Pandoc, the dependable route is a reference document: style headings, quotes and other elements in a .docx template and pass it with --reference-doc, so every blockquote or heading gets the color you set. That colors elements by type, not individual words.

Colored text in Noteline

Noteline has no text color option, because Markdown has no color syntax. If a note contains a <span style> tag, the editor shows the tag as typed, and HTML export, printing and the desktop app's Word and PDF export remove it and keep the plain text. The tag stays in the .md file, so it still renders in apps that allow inline styles, such as Obsidian.

Common questions

Does Markdown support background colors or highlighting?

Not in CommonMark or GFM. ==text== is an extension that some apps support. Elsewhere, <mark>text</mark> gives a highlight where HTML is allowed.

Can I color a code block?

The language name after the opening fence controls syntax highlighting, which colors code by token. A diff block shows added lines in green and removed lines in red on GitHub and in many editors. See code blocks.

Why does my colored text show in one app but not on GitHub?

Each renderer has its own HTML rules. GitHub removes style attributes for security, while some note apps and local previews keep them. Check the file where your readers will open it.

Noteline

Download Noteline↓See pricing→

Related

  • HTML in Markdown
  • Underline in Markdown
  • Markdown blockquotes
  • Math in Markdown
  • Markdown for beginners: the 15-minute guide
  • Markdown syntax

A Markdown note editor with everything you need

We’re listening

Tell us what you need or what gets in your way. If something isn’t working, write to us any time.

contact@noteline.io→

Product

  • Download
  • Pricing
  • Features
  • Changelog

Learn

  • Markdown syntax
  • Use cases
  • Blog

Compare

  • vs Obsidian
  • vs Notion

Support

  • Help
  • Support
  • Privacy
  • Terms

© 2026 Notelinecontact@noteline.io