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>&euro; or € 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: &euro;</p> <p>Numeric entity: €</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
€, which breaks the symbol. - Using incorrect numeric codes like
€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>€</p> <!-- Right: escaped ampersand --> <p>&euro;</p>
Output
Wrong: shows text '€' not symbol
Right: shows '€' symbol
Quick Reference
| Method | Code | Description |
|---|---|---|
| Named entity | € | Standard readable code for euro symbol |
| Numeric entity | € | Unicode number for euro symbol |
| Direct symbol | € | Type symbol directly with UTF-8 encoding |
Key Takeaways
Use € 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.