HTML Entity for Exclamation Mark (!)

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

What Is Exclamation Mark?

Exclamation mark (!) is the Unicode character at U+0021 in Basic Latin. Official name: EXCLAMATION MARK. HTML5 names it !. In everyday HTML you can type ! on the keyboard.

Remember
Character     !
Unicode       U+0021
Named entity  !
Hex entity    !
Decimal       !
CSS escape    \21
Not the same  ¡ (¡) · ‼ (double) · ⁉ (excl+question)

Prefer typing ! in HTML text. Use !, !, or ! when you want an explicit entity form.

Quick Reference

One table for every form you will actually use.

FormCodeWhere it goes
Named entity!HTML markup
Hex entity!HTML markup
Decimal entity!HTML markup
Direct character!HTML text (preferred)
CSS escape\21Stylesheet content

When to Use Which

SituationUse
Ordinary English emphasis / alertType ! or use !
Spanish inverted exclamationInverted exclamation (¡, ¡)
Double exclamation glyphDouble exclamation (‼)
Exclamation + question in one glyphExclamation question mark (⁉)
Generated text via ::before / ::aftercontent: "\21" or content: "!"

Live Preview

Exclamation mark rendered alone, in a sentence, and compared with related punctuation.

Glyph !
Large glyph !
Sample Watch out!
Compared !   ¡   ‼   ⁉
With entities Named: ! | Hex: ! | Decimal: !

Complete HTML Example

One page that shows Exclamation mark with named, hex, decimal, CSS escape, and a typed character. Use View Output or open the live editor.

Named + Hex + Decimal + CSS + Typed

Five ways to display ! in HTML and CSS.

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Exclamation Mark (U+0021) in HTML</title>
  <style>
    #point::after {
      content: "\21";
    }
  </style>
</head>
<body>
  <p>Built with Named: &excl;</p>
  <p>Built with Hex: &#x21;</p>
  <p>Built with Decimal: &#33;</p>
  <p id="point">Built with CSS: </p>
  <p>Typed: !</p>
  <p>Sentence: Watch out&excl;</p>
</body>
</html>
Try It Yourself

How It Works

1. Named: &excl; is the HTML5 name for U+0021 → !.

2. Hex: &#x21; inserts the same code point. Same visual as named.

3. Decimal: same code point as 33 → &#33;.

4. CSS: use \21 (or a literal !) in content. #point::after appends !.

5. Typed: press ! on the keyboard, or write a sentence like Watch out&excl;.

Pitfalls & Tips

Common mistakes when working with Exclamation mark.

Type it

Prefer a real !

In everyday HTML, type ! directly. Use &excl; when you want the named form for clarity or tooling.

Case

&excl; is case-sensitive

Write &excl;, not &Excl;. Invalid names may show as literal text.

¡

Not inverted exclamation

U+00A1 (&iexcl;) is ¡ — used at the start of Spanish exclamations.

‼

Not double exclamation

U+203C (‼) is a single double-exclamation character — not two ! characters.

CSS vs HTML

Do not mix escapes

\21 belongs in CSS strings. &excl; / &#x21; / &#33; belong in HTML.

Semicolon

End references

Always finish entities with ; — write &excl;, not &excl.

Browser Support

Exclamation mark (U+0021) and its entity forms (&excl;, &#x21;, &#33;, CSS \\21) are supported in all mainstream browsers. As a Basic Latin character, the glyph is available in essentially every text font.

✓ Universal support

Exclamation Mark (!)

Encode with named, hex, decimal, CSS escape, or type the character — same code point everywhere encoding is supported.

100% Browser coverage
Google Chrome Supported
Yes
Microsoft Edge Supported
Yes
Mozilla Firefox Supported
Yes
Apple Safari Supported
Yes
Opera Supported
Yes
Internet Explorer All versions
Yes
U+0021 / &excl; Full support

Bottom line: Prefer typing ! in HTML text. Use &excl; / &#x21; / &#33; when an entity is required, and \\21 only inside CSS content.

Key Takeaways

  • Unicode: exclamation mark is U+0021 (decimal 33) — glyph !.
  • HTML: type !, or use &excl; / &#x21; / &#33;.
  • CSS: use \21 or "!" inside content.
  • Meaning: ! ≠ inverted ¡ ≠ double ‼.

One line: U+0021 → type ! / &excl; / CSS \21.

Frequently Asked Questions

Type ! directly in UTF-8, or use &excl; (named), &#x21; (hex), &#33; (decimal), or the CSS escape \21 in content.
U+0021 (EXCLAMATION MARK). Hex 21, decimal 33. It belongs to the Basic Latin block (U+0000–U+007F).
Yes. &excl; is the HTML5 named entity for U+0021. It is case-sensitive — &Excl; is not valid.
Use it for emphasis, alerts, and ordinary English punctuation. Prefer &iexcl; (¡) for Spanish inverted exclamation, and U+203C for a double exclamation glyph.
HTML entities (&excl;, &#33;, or &#x21;) go in markup. The CSS escape \21 goes in stylesheet strings (usually content on ::before/::after).
No. U+0021 is ! (exclamation mark). U+00A1 is ¡ (inverted exclamation). U+203C is ‼ (double exclamation).

Did you know?

Exclamation mark is Unicode U+0021 (decimal 33) — glyph ! (EXCLAMATION MARK) in Basic Latin. HTML5 names it &excl;. In normal text you can type ! directly. Related forms include inverted exclamation (&iexcl;, ¡) and double exclamation (‼).

Next: Exclamation Question Mark

Learn the HTML entity for exclamation question mark (U+2049).

Exclamation Question Mark tutorial →

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