HTML Entity for Quotation Mark (")

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 1 Code Example
Unicode U+0022

What You'll Learn

How to display the quotation mark (") in HTML using hexadecimal, decimal, named entity, and CSS escape methods. This is the straight double quote—one of the most important characters for dialogue, citations, and escaping quotes inside HTML attributes.

It is U+0022 (QUOTATION MARK) in the Basic Latin block (ASCII). Use ", ", the named entity ", or CSS \22. The named entity " is especially common when a double quote must appear inside an attribute value delimited by quotes.

⚡ Quick Reference — Quotation Mark

Unicode U+0022

Basic Latin (ASCII)

Hex Code "

Hexadecimal reference

HTML Code "

Decimal reference

Named Entity "

Standard named entity

Reference Table
Name           Value
────────────   ──────────
Unicode        U+0022
Hex code       "
HTML code      "
Named entity   "
CSS code       \22
Meaning        Quotation mark (straight double quote)
Related        U+201C = Left double quotation mark (“)
               U+201D = Right double quotation mark (”)
               U+0027 = Apostrophe (')
Block          Basic Latin (U+0000–U+007F)
1

Complete HTML Example

A simple example showing " using hexadecimal code, decimal HTML code, the named entity, and a CSS content escape:

html
<!DOCTYPE html>
<html>
<head>
 <style>
  #point::after{
   content: "\22";
  }
 </style>
</head>
<body>
<p>Hex: &#x22;</p>
<p>Decimal: &#34;</p>
<p>Named: &quot;</p>
<p>CSS: <span id="point"></span></p>
<p>She said &quot;Hello.&quot;</p>
</body>
</html>
Try it Yourself

🌐 Browser Support

The quotation mark is universally supported—it is part of ASCII and renders in every browser:

Chrome 1+
Firefox 1+
Safari 1+
Edge 12+
Opera 4+
Android All
iOS Safari All

👀 Live Preview

See " rendered live in different contexts:

Glyph "
Dialogue She said "Hello."
Compare " straight   “ left curly   ” right curly
Attribute <input title="Search">
Numeric refs &#x22; &#34; &quot; \22

🧠 How It Works

1

Hexadecimal Code

&#x22; uses the Unicode hexadecimal value 22 to display the quotation mark.

HTML markup
2

Decimal HTML Code

&#34; uses the decimal Unicode value 34 to display the same character.

HTML markup
3

Named Entity

&quot; is the standard named entity—essential for escaping double quotes inside HTML attribute values.

HTML markup
4

CSS Entity

\22 is used in CSS stylesheets in the content property of pseudo-elements like ::before and ::after.

CSS stylesheet
=

Same visual result

All four methods produce: ". Unicode U+0022 in Basic Latin (ASCII).

Use Cases

The quotation mark (") commonly appears in:

💬 Dialogue

Quoted speech, interviews, testimonials, and chat transcripts.

📄 Attributes

Escaping &quot; inside title, alt, and data-* values.

📝 Citations

Blockquotes, pull quotes, and reference snippets in articles.

💻 Code Samples

String literals, JSON examples, and entity tutorials.

🔘 UI Labels

Search placeholders, filter chips, and quoted button text.

📖 Typography

Plain straight quotes in monospace or technical content.

💡 Best Practices

Do

  • Use &quot; to escape quotes inside double-quoted attributes
  • Type " directly in UTF-8 body text when safe
  • Distinguish straight " from curly “ / ” for typography
  • Pick one encoding style (named, hex, or decimal) per project
  • Serve pages with UTF-8 (<meta charset="utf-8">)

Don’t

  • Confuse &quot; with &ldquo; / &rdquo; (curly quotes)
  • Put CSS escape \22 inside HTML text nodes
  • Mix straight and curly quotes randomly in the same article
  • Over-encode every quote when plain UTF-8 text works
  • Use HTML entities in JavaScript strings (use \u0022 or '"' instead)

Key Takeaways

1

Three HTML references plus a named entity render "

&#x22; &#34; &quot;
2

For CSS stylesheets, use the escape in the content property

\22
3

Unicode U+0022 is QUOTATION MARK in Basic Latin (ASCII)

4

&quot; is the standard named entity for escaping double quotes

❓ Frequently Asked Questions

Use &#x22; (hex), &#34; (decimal), &quot; (named entity), or \22 in CSS content. All produce the straight double quote.
U+0022 (QUOTATION MARK). Basic Latin block. Hex 22, decimal 34.
Use &quot; inside HTML attribute values delimited by double quotes, in generated markup, and in tutorials where explicit encoding is shown.
&quot; is U+0022 (straight ASCII quote). Curly quotes are different characters—for example &ldquo; (U+201C) and &rdquo; (U+201D) for typographic opening and closing quotes.
HTML entities (&#34;, &#x22;, or &quot;) go in markup. The CSS escape \22 is used in stylesheets, typically in the content property. Same visual result, different layers.

Explore More HTML Entities!

Discover 1500+ HTML character references — punctuation, symbols, and more.

All HTML Entities →

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