Need to encode your html code? Use our free tool Html Encoder to encode your html code. Simply copy the html code into the following box and click the Encode Html button. Do not forget to check our HTML decoder tool.
The reason why we need to do HTML encoding is to make sure that text is displayed correctly in browser and not interpreted by browser as html text. The significant example is the sign < and >, the browser will consider those tags as the opening and closing of HTML tag.
How to encode in C# .Net?
To decode in C# .Net, you can use the following code.
HttpUtility.HtmlEncode("html text"); //Another option Server.HtmlEncode("html text");
The following characters are reserved by HTML tags. Therefore those characters need to be encoded first in order they can be displayed properly.
How to decode the html encoding?
You can easily decode the html encoding text by using our HTML Decoding tool.