HTML Entity for Music Sharp Sign (♯)

Beginner
5 min read
Updated: Sep 2026
1 example
Unicode U+266F

What Is the Music Sharp Sign Entity?

Music Sharp Sign (♯) is the accidental at Unicode U+266F that raises a pitch by one semitone. HTML5 provides ♯. Example: F♯ for F-sharp.

Remember
Character     ♯
Unicode       U+266F
Named entity  ♯
Hex entity    ♯
Decimal       ♯
CSS escape    \266F

Named, hex, decimal, CSS, and a typed character all produce the same glyph: ♯.

Quick Reference

One table for every form you will actually use.

FormCodeWhere it goes
Named entity♯HTML markup (preferred)
Direct character♯UTF-8 HTML text
Hex entity♯HTML markup
Decimal entity♯HTML markup
CSS escape\266FStylesheet content

When to Use Which

SituationUse
Sharp accidental / key name♯
Need an entity in HTML source♯, ♯, or ♯
Generated text via ::before / ::aftercontent: "\266F"
Flat accidental (♭)See Music Flat Sign — ♭
Hash / number sign (#)Type # — not a music sharp

Live Preview

Sharp in key names and beside flat, natural, and hash.

Example F♯ major
Large glyph ♯
Named entity ♯ → ♯
vs ♭ / ♮ / # ♯  |  ♭  |  ♮  |  #
With entities Named: ♯ | Hex: ♯ | Decimal: ♯

Complete HTML Example

One page that shows the Music Sharp Sign with named, hex, decimal, and CSS forms. Use View Output or open the live editor.

Named + Hex + Decimal + CSS

Four ways to produce ♯ in a single document.

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Music Sharp Sign (♯)</title>
  <style>
    #point::after {
      content: "\266F";
    }
  </style>
</head>
<body>
  <p>Using Named Entity: &sharp;</p>
  <p>Using Hex Code: &#x266F;</p>
  <p>Using HTML Code: &#9839;</p>
  <p id="point">Using CSS Entity: </p>
  <p>Key: F&sharp; major</p>
</body>
</html>
Try It Yourself

How It Works

1. Named: &sharp; is the clearest HTML form and renders ♯.

2. Hex: U+266F → &#x266F; in HTML. Same result as the named entity.

3. Decimal: same code point as 9839 → &#9839;. Same result as hex and named.

4. CSS: use \266F in content (not an HTML entity). #point::after appends that ♯ after the paragraph text.

Pitfalls & Tips

Common mistakes when working with the Music Sharp Sign.

Prefer

Use &sharp;

The named form is clearer than numeric references and is defined in HTML5.

vs #

Not the hash key

Keyboard # is U+0023 (NUMBER SIGN). Prefer &sharp; for music accidentals.

vs ♭

Not flat

&flat; lowers pitch. &sharp; raises pitch. Do not swap them.

CSS vs HTML

Do not mix escapes

\266F belongs in CSS. &sharp; / &#x266F; / &#9839; belong in HTML.

Encoding

Declare UTF-8

If you type ♯ directly, keep <meta charset="UTF-8"> so the file is not misread.

Semicolon

End references

Always finish with ; — write &sharp;, not &sharp.

Browser Support

Music Sharp Sign (U+266F) and its entity forms (&sharp;, &#x266F;, &#9839;, CSS \\266F) are supported in all mainstream browsers with a Unicode-capable font.

✓ Universal support

Music Sharp Sign (♯)

Encode with named, hex, decimal, or CSS escape — or type ♯ directly in UTF-8 HTML.

100% Browser coverage
Google Chrome Supported
Yes
Microsoft Edge Supported
Yes
Mozilla Firefox Supported
Yes
Apple Safari Supported
Yes
Opera Supported
Yes
Internet Explorer IE 9+
Yes*
U+266F / &sharp; Full support

Bottom line: Prefer &sharp; in music HTML. Use \\266F only inside CSS content.

Key Takeaways

  • Unicode: Music Sharp Sign is U+266F (decimal 9839).
  • HTML: prefer &sharp;.
  • CSS: use \266F inside content for generated text.
  • Lookalike: not # — use with &flat; and &natural;.

One line: U+266F → prefer &sharp; (also &#x266F; / CSS \266F).

Frequently Asked Questions

Use &sharp; (named), &#x266F; (hex), &#9839; (decimal), or the CSS escape \266F in the content property. All render ♯. Prefer &sharp; in music HTML.
U+266F (MUSIC SHARP SIGN). Hex 266F, decimal 9839. It belongs to the Miscellaneous Symbols block.
Yes. HTML5 defines &sharp; for ♯.
Use it in chord charts, key names, sheet-music text, and music education — for example F♯ major or C♯.
HTML entities (&sharp;, &#9839;, or &#x266F;) go in markup. The CSS escape \266F is used in stylesheets (usually in the content property of ::before/::after). Both render ♯.
No. Sharp is &sharp; (♯, U+266F). Hash/number sign is # (U+0023). Flat is &flat; (♭, U+266D). Different characters.

Did you know?

Music Sharp Sign is Unicode U+266F (decimal 9839) — in Miscellaneous Symbols. HTML5 provides &sharp;. It raises a pitch by a semitone (e.g. F♯). Pair it with Flat &flat; (♭) and Natural &natural; (♮). Not the same as the hash/number sign # (U+0023).

Next: N-Ary Coproduct

Continue with the N-Ary Coproduct (∐) entity tutorial.

N-Ary Coproduct tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful