HTML Entity for Comma (,)

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

What You'll Learn

How to display the Comma (,) in HTML using numeric references, the named entity, and CSS escapes. This character is U+002C (COMMA) in the Basic Latin block (ASCII). It separates items in lists, thousands in numbers (locale-dependent), fields in CSV, and arguments in programming syntax.

You can use the named entity ,, hex ,, decimal ,, or CSS \2C. You can usually type , directly on the keyboard; entities help when escaping or referencing explicitly. Do not confuse , with Colon U+003A (:) or combining comma diacritics U+0312–U+0326.

⚡ Quick Reference — Comma

Unicode U+002C

Basic Latin / ASCII

Hex Code ,

Hexadecimal reference

HTML Code ,

Decimal reference

Named Entity ,

Standard HTML entity

Reference Table
Name           Value
────────────   ──────────
Unicode        U+002C
Hex code       ,
HTML code      ,
Named entity   ,
CSS code       \2C
1

Complete HTML Example

This example demonstrates the Comma (,) using hexadecimal code, decimal HTML code, the named entity ,, and a CSS content escape:

html
<!DOCTYPE html>
<html>
<head>
 <style>
  #point:after{
   content: "\2C";
  }
 </style>
</head>
<body>
<p>Comma using Hexa Decimal: &#x2C;</p>
<p>Comma using HTML Code: &#44;</p>
<p>Comma using HTML Entity: &comma;</p>
<p id="point">Comma using CSS Entity: </p>
</body>
</html>
Try it Yourself

🌐 Browser Support

U+002C is universally supported in all browsers:

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

👀 Live Preview

See the Comma in common contexts:

Lists apples, bananas, oranges
Numbers 1,000,000   42,195
CSV-style name,value,status
Named entity Use &comma; in escaped HTML docs
Monospace refs &#x2C; &#44; &comma; \2C

🧠 How It Works

1

Hexadecimal Code

&#x2C; references code point U+002C using hex digits 2C.

HTML markup
2

Decimal HTML Code

&#44; is the decimal equivalent (44) for the same character.

HTML markup
3

Named HTML Entity

&comma; is the standard named entity for U+002C—readable when escaping punctuation in HTML.

HTML markup
4

CSS Entity

\2C is the CSS escape for U+002C, used in the content property of ::before or ::after.

CSS stylesheet
=

Same visual result

All four methods produce the Comma glyph: ,. Unicode U+002C is basic ASCII punctuation.

Use Cases

The Comma (,) commonly appears in:

📄 Lists

Inline lists, series, and enumerated items in prose.

🔢 Numbers

Thousands separators in many locales (e.g. 1,000,000).

📊 CSV & data

Field separators in CSV, TSV, and tabular data formats.

💻 Programming

Function arguments, arrays, and object literals in code examples.

📄 Generated HTML

Programmatic output when the character must be escaped.

🔤 References

Punctuation and character entity glossaries.

♿ Accessibility

Screen readers treat commas as pauses in natural sentence flow.

💡 Best Practices

Do

  • Type , directly for normal prose and lists
  • Use &comma; when escaping in tutorials or generated HTML
  • Keep entity style consistent when using references
  • Use \2C only inside CSS content
  • Respect locale rules for number formatting (comma vs period)

Don’t

  • Confuse punctuation comma (,) with colon (:) or semicolon (;)
  • Confuse with combining comma marks (U+0312–U+0326)
  • Over-escape every comma when plain typing works fine
  • Put CSS escape \2C in HTML text nodes
  • Mix entity styles randomly in one file

Key Takeaways

1

Named entity for escaping

&comma;
2

Numeric references also render ,

&#x2C; &#44;
3

For CSS stylesheets, use the escape in the content property

\2C
4

U+002C COMMA (ASCII punctuation)

5

Four methods, one glyph — universally supported

❓ Frequently Asked Questions

Use &comma; (named entity), &#x2C; (hex), &#44; (decimal), or \2C in CSS content. You can also type , directly on the keyboard.
U+002C (COMMA). Basic Latin / ASCII. Hex 2C, decimal 44.
When escaping the comma in attributes or generated content, when documenting CSV or code, or when you want an explicit character reference. For normal text and lists, typing the character is usually fine.
HTML entities (&comma;, &#44;, or &#x2C;) go directly in markup. The CSS escape \2C is used in stylesheets, typically in the content property of pseudo-elements.
Yes. &comma; is the named entity for U+002C in HTML5. It is well supported and easy to remember when you need to escape the punctuation comma.

Explore More HTML Entities!

Discover 1500+ HTML character references — math operators, symbols, arrows, 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