0
0
HtmlHow-ToBeginner · 3 min read

How to Add Euro Symbol in HTML: Simple Syntax & Examples

To add the euro symbol in HTML, use the character entity €, the numeric entity €, or directly type the symbol if your file encoding supports it. These methods ensure the euro sign displays correctly in browsers.
📐

Syntax

There are three main ways to add the euro symbol in HTML:

  • Named character entity: € - a readable code for the euro sign.
  • Numeric character entity: € - uses the Unicode number for euro.
  • Direct symbol: - type the symbol directly if your file uses UTF-8 encoding.

All three will show the euro symbol (€) in the browser.

html
<p>&amp;euro; or &#8364; or €</p>
Output
€ or € or €
💻

Example

This example shows a simple HTML page displaying the euro symbol using all three methods.

html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Euro Symbol Example</title>
</head>
<body>
  <p>Named entity: &amp;euro;</p>
  <p>Numeric entity: &#8364;</p>
  <p>Direct symbol: €</p>
</body>
</html>
Output
Named entity: € Numeric entity: € Direct symbol: €
⚠️

Common Pitfalls

Common mistakes when adding the euro symbol include:

  • Not using UTF-8 encoding, causing the direct symbol to show as a question mark or strange character.
  • Forgetting to escape the ampersand in &euro;, which breaks the symbol.
  • Using incorrect numeric codes like &#128; which may not render properly in all browsers.

Always ensure your HTML file uses <meta charset="UTF-8"> and use the correct entities.

html
<!-- Wrong: missing ampersand escape -->
<p>&euro;</p>

<!-- Right: escaped ampersand -->
<p>&amp;euro;</p>
Output
Wrong: shows text '&euro;' not symbol Right: shows '€' symbol
📊

Quick Reference

MethodCodeDescription
Named entity&euro;Standard readable code for euro symbol
Numeric entityUnicode number for euro symbol
Direct symbolType symbol directly with UTF-8 encoding

Key Takeaways

Use &euro; or € to reliably show the euro symbol in HTML.
Ensure your HTML file uses UTF-8 encoding to support direct euro symbol input.
Always escape ampersands in entities to avoid display errors.
Avoid incorrect numeric codes that may not render consistently.
Test your page in a browser to confirm the euro symbol displays correctly.