HTML Entities

HTML Entities

HTML entities are special codes used to display characters that are reserved in HTML or not available on the keyboard.
They start with & and end with ;.


Why Use HTML Entities

  • To display reserved characters like <, >, &.

  • To display special symbols like ©, ®, €, ™.

  • To prevent HTML parsing errors when using symbols in text.


Common HTML Entities

Character Entity Name Entity Number
< &lt; &#60;
> &gt; &#62;
& &amp; &#38;
" &quot; &#34;
' &apos; &#39;
© &copy; &#169;
® &reg; &#174;
&euro; &#8364;
&trade; &#8482;

Example Code


 


Output Preview

  • Reserved characters appear as: < > &

  • Special symbols appear as: © ® ™ €


Key Points

  • Always use entities for reserved HTML characters to prevent errors.

  • Use named entities for readability (&copy;) or numeric entities (&#169;).

  • Essential for special symbols, mathematical symbols, and accented letters in web pages.

CodeCapsule

Sanjit Sinha — Web Developer | PHP • Laravel • CodeIgniter • MySQL • Bootstrap Founder, CodeCapsule — Student projects & practical coding guides. Email: info@codecapsule.in • Website: CodeCapsule.in

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *