HTML Entity for Colon (:)

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

What You'll Learn

How to display the Colon (:) in HTML using numeric references, the named entity, and CSS escapes. This character is U+003A (COLON) in the Basic Latin block (ASCII). It is used for punctuation, time notation (12:30), ratios (16:9), labels, and markup syntax.

You can use the named entity :, hex :, decimal :, or CSS \3A. You can usually type : directly on the keyboard; entities help when escaping or referencing explicitly. Do not confuse : with Colon Equals U+2254 (≔) or Colon Sign U+20A1 (₡, Costa Rican currency).

⚡ Quick Reference — Colon

Unicode U+003A

Basic Latin / ASCII

Hex Code :

Hexadecimal reference

HTML Code :

Decimal reference

Named Entity :

Standard HTML entity

Reference Table
Name           Value
────────────   ──────────
Unicode        U+003A
Hex code       :
HTML code      :
Named entity   :
CSS code       \3A
1

Complete HTML Example

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

html
<!DOCTYPE html>
<html>
<head>
 <style>
  #point:after{
   content: "\3A";
  }
 </style>
</head>
<body>
<p>Colon using Hexa Decimal: &#x3A;</p>
<p>Colon using HTML Code: &#58;</p>
<p>Colon using HTML Entity: &colon;</p>
<p id="point">Colon using CSS Entity: </p>
</body>
</html>
Try it Yourself

🌐 Browser Support

U+003A 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 Colon in common contexts:

Time 12:30   09:00   24:00
Labels Name: John   Status: Active
Ratio Aspect ratio 16:9
Named entity Use &colon; in escaped HTML docs
Monospace refs &#x3A; &#58; &colon; \3A

🧠 How It Works

1

Hexadecimal Code

&#x3A; references code point U+003A using hex digits 3A.

HTML markup
2

Decimal HTML Code

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

HTML markup
3

Named HTML Entity

&colon; is the standard named entity for U+003A—readable when escaping punctuation in HTML.

HTML markup
4

CSS Entity

\3A is the CSS escape for U+003A, used in the content property of ::before or ::after.

CSS stylesheet
=

Same visual result

All four methods produce the Colon glyph: :. Unicode U+003A is basic ASCII punctuation.

Use Cases

The Colon (:) commonly appears in:

⏰ Time notation

Schedules, timetables, and time pickers (12:30, 24:00).

📐 Ratios

Technical specs and education (16:9, 4:3).

🏷️ Labels

Key-value pairs in forms, lists, and data display.

💻 Code & markup

CSS pseudo-elements (::before), docs, and escaped examples.

📄 Generated HTML

Programmatic output when the character must be escaped.

🔤 References

Punctuation and character entity glossaries.

♿ Accessibility

Use clear structure for time and ratios so screen readers parse meaning correctly.

💡 Best Practices

Do

  • Type : directly for normal prose and time
  • Use &colon; when escaping in tutorials or generated HTML
  • Keep entity style consistent when using references
  • Use \3A only inside CSS content
  • Structure labels clearly (e.g. visible text before/after the colon)

Don’t

  • Confuse punctuation colon (:) with Colon Equals (≔) or currency ₡
  • Over-escape every colon when plain typing works fine
  • Use U+003A notation incorrectly—standard form is U+003A
  • Put CSS escape \3A in HTML text nodes
  • Mix entity styles randomly in one file

Key Takeaways

1

Named entity for escaping

&colon;
2

Numeric references also render :

&#x3A; &#58;
3

For CSS stylesheets, use the escape in the content property

\3A
4

U+003A COLON (ASCII punctuation)

5

Four methods, one glyph — universally supported

❓ Frequently Asked Questions

Use &colon; (named entity), &#x3A; (hex), &#58; (decimal), or \3A in CSS content. You can also type : directly on the keyboard.
U+003A (COLON). Basic Latin / ASCII. Hex 3A, decimal 58.
When escaping the colon in attributes or generated content, when documenting code, or when you want an explicit character reference. For normal text and time notation, typing the character is usually fine.
HTML entities (&colon;, &#58;, or &#x3A;) go directly in markup. The CSS escape \3A is used in stylesheets, typically in the content property of pseudo-elements.
Yes. &colon; is the named entity for U+003A. It is well supported and easy to remember when you need to escape the punctuation colon.

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