HTML Entity for Quotation Mark (")

Beginner
6 min read
Updated: Sep 2026
1 example
Unicode U+0022

What Is the Quotation Mark Entity?

Quotation mark (") is the Basic Latin (ASCII) character at Unicode U+0022 (QUOTATION MARK). It is the straight double quote used in code, plain text, and HTML attribute escaping. The preferred named form is ".

Remember
Character     "
Unicode       U+0022
Named entity  "
Hex entity    "
Decimal       "
CSS escape    \0022

Named, numeric, and UTF-8 forms produce the same glyph: ". Prefer " when escaping quotes inside attributes; type " in body text when convenient. Curly quotes (“ / ”) are different characters.

Quick Reference

One table for every form you will actually use.

FormCodeWhere it goes
Named entity"HTML markup (preferred for escaping)
Hex entity"HTML markup
Decimal entity"HTML markup
Direct character"HTML text (UTF-8 default)
CSS escape\0022Stylesheet content (padded)

When to Use Which

SituationUse
Quote inside a double-quoted attribute" (or switch to single-quoted attributes)
Normal body text / dialogueType ", or use " for explicit encoding
Typographic / curly quotes“ … ” (see punctuation)
Generated text via ::before / ::aftercontent: "\0022"
Apostrophe / single quote' or ' (U+0027)

Live Preview

Quotation mark rendered in common contexts.

Glyph "
Large glyph "
In a sentence She said "Hello."
With entities Named: " | Hex: " | Decimal: "
Related “ ” (“ / ”) · '

Complete HTML Example

One page that shows the quotation mark with named, hex, decimal, direct, and CSS forms. Use View Output or open the live editor.

Named + Hex + Decimal + Direct + CSS

Five ways to produce " in a single document, plus a dialogue example.

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Quotation Mark (") in HTML</title>
  <style>
    #point::after {
      content: "\0022";
    }
  </style>
</head>
<body>
  <p>Using Named Entity: &quot;</p>
  <p>Using Hex Code: &#x22;</p>
  <p>Using Decimal: &#34;</p>
  <p>Using Direct Character: "</p>
  <p>Using CSS Entity: <span id="point"></span></p>
  <p>She said &quot;Hello.&quot;</p>
</body>
</html>
Try It Yourself

How It Works

1. Named: &quot; is the preferred HTML5 entity for U+0022 — especially useful inside attributes.

2. Hex: U+0022 → &#x22; in HTML. Same glyph as the named form.

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

4. Direct: type " in a UTF-8 body text node. Inside double-quoted attributes, escape with &quot;.

5. CSS: use padded \0022 in content so a following digit is not absorbed into the escape.

Pitfalls & Tips

Common mistakes when working with this punctuation entity.

Attributes

Escape quotes in attributes

Inside attr="…", a literal " ends the value. Use &quot; or switch to single-quoted attributes.

Curly

Straight ≠ curly

&quot; is ASCII ". Typographic quotes are &ldquo; / &rdquo;. Do not mix them in code or URLs.

Code

Keep straight quotes in code

Smart-quote substitution can break JavaScript, JSON, and HTML attributes. Prefer U+0022 in source code.

CSS pad

Prefer \0022

Short escapes like \22 can swallow the next hex digit. Pad to four digits: \0022.

CSS vs HTML

Do not mix escapes

\0022 belongs in CSS. &quot; / &#x22; belong in HTML.

UTF-8

Declare charset

If you paste quotes directly, serve the page as UTF-8 with <meta charset="UTF-8">.

Browser Support

Quotation mark (U+0022) and its entity forms (&quot;, &#x22;, &#34;, CSS \\0022) are supported in all mainstream browsers — it is core ASCII.

✓ Universal support

Quotation Mark (&quot;)

Prefer &quot; when escaping, or type " / encode with hex, decimal, or CSS escape — same glyph everywhere.

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+0022 / &quot; Full support

Bottom line: Prefer &quot; for attribute escaping. Type " in body text when safe. Use \\0022 only inside CSS content.

Key Takeaways

  • Unicode: quotation mark is U+0022 (decimal 34), Basic Latin / ASCII.
  • HTML: prefer &quot; for escaping — or &#x22; / &#34;.
  • CSS: use padded \0022 inside content.
  • Meaning: straight ASCII quote — not curly &ldquo; / &rdquo;.

One line: U+0022 → &quot; / &#x22; / CSS \0022.

Frequently Asked Questions

Prefer &quot; (named). You can also use &#x22; (hex), &#34; (decimal), type " in UTF-8 text, or the CSS escape \0022 in content.
U+0022 (QUOTATION MARK). Hex 22, decimal 34. It belongs to Basic Latin (ASCII) and is the straight double quote.
Use &quot; inside double-quoted HTML attribute values, in generated markup, and anywhere explicit encoding prevents parser errors. In normal body text you can usually type " directly.
&quot; is U+0022 (straight ASCII quote). Curly / smart quotes are different characters — for example &ldquo; (U+201C) and &rdquo; (U+201D).
HTML entities (&quot;, &#34;, or &#x22;) go in markup. The CSS escape \0022 is used in stylesheets (usually in the content property of ::before/::after). Prefer the padded form \0022 so the next digit is not swallowed.
If the attribute is delimited with double quotes, escape the inner quote with &quot; (e.g. title="She said &quot;Hi&quot;"). Or delimit the attribute with single quotes and keep a literal " inside.

Did you know?

Quotation mark (") is Unicode U+0022 (decimal 34) — QUOTATION MARK in Basic Latin (ASCII). HTML5 named entity: &quot;. Prefer &quot; when escaping quotes inside attribute values. It is the straight double quote — not curly &ldquo; / &rdquo;.

Next: Radioactive Sign

Learn the HTML entity for the radioactive sign — the next character in this entity sequence.

Radioactive Sign 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