Encode / Decode HTML Entities

Have you ever wondered how to post code snippets on your site to demonstrate an example? I have to admit myself that I’ve tried myself to use <pre> or <code> tags, hoping that it would solve my frustration. After few trial and errors, some research, I found out that that you need to encode the html entities, like the ‚Äú<‚Äù by replacing them with their html code equivalents.

HTML Code Browser View HTML Code Browser View HTML Code Browser View HTML Code Browser View HTML Code Browser View
&copy; © &#33; ! &#95; _ &#157; ? &#219; Û
&reg; ® &#34; &#96; ` &#158; ž &#220; Ü
&nbsp; &#35; # &#97; a &#159; ≈∏ &#221; √ù
&quot; &#36; $ &#98; b &#160; &#222; √û
&amp; & &#37; % &#99; c &#161; ¡ &#223; ß
&lt; < &#38; & &#100; d &#162; ¢ &#224; à
&gt; > &#39; &#101; e &#163; £ &#225; á
&Agrave; À &#40; ( &#102; f &#164; ¤ &#226; â
&Aacute; Á &#41; ) &#103; g &#165; ¥ &#227; ã
&Acirc; Â &#42; * &#104; h &#166; ¦ &#228; ä
&Atilde; Ã &#43; + &#105; i &#167; § &#229; å
&Auml; Ä &#44; , &#106; j &#168; ¨ &#230; æ
&Aring; Å &#45; &#107; k &#169; © &#231; ç
&AElig; Æ &#46; . &#108; l &#170; ª &#232; è
&Ccedil; Ç &#47; / &#109; m &#171; « &#233; é
&Egrave; È &#48; 0 &#110; n &#172; ¬ &#234; ê
&Eacute; É &#49; 1 &#111; o &#173; ­ &#235; ë
&Ecirc; Ê &#50; 2 &#112; p &#174; ® &#236; ì
&Euml; Ë &#51; 3 &#113; q &#175; ¯ &#237; í
&Igrave; Ì &#52; 4 &#114; r &#176; ° &#238; î
&Iacute; Í &#53; 5 &#115; s &#177; ± &#239; ï
&Icirc; Î &#54; 6 &#116; t &#178; ² &#240; ð
&Iuml; Ï &#55; 7 &#117; u &#179; ³ &#241; ñ
&ETH; Ð &#56; 8 &#118; v &#180; ´ &#242; ò
&Ntilde; Ñ &#57; 9 &#119; w &#181; µ &#243; ó
&Otilde; Õ &#58; : &#120; x &#182; ¶ &#244; ô
&Ouml; Ö &#59; ; &#121; y &#183; · &#245; õ
&Oslash; Ø &#60; < &#122; z &#184; ¸ &#246; ö
&Ugrave; √ô &#61; = &#123; { &#185; ¬π &#247; √∑
&Uacute; Ú &#62; > &#124; | &#186; º &#248; ø
&Ucirc; Û &#63; ? &#125; } &#187; » &#249; ù
&Uuml; Ü &#64; @ &#126; ~ &#188; ¼ &#250; ú
&Yacute; Ý &#65; A &#127; ? &#189; ½ &#251; û
&THORN; Þ &#66; B &#128; € &#190; ¾ &#252 ü
&szlig; ß &#67; C &#129; ? &#191; ¿ &#253; ý
&agrave; à &#68; D &#130; ‚ &#192; À &#254; þ
&aacute; á &#69; E &#131; ƒ &#193; Á &#255; ÿ
&aring; å &#70; F &#132; „ &#194; Â
&aelig; æ &#71; G &#133; … &#195; Ã
&ccedil; ç &#72; H &#134; † &#196; Ä
&egrave; è &#73; I &#135; ‡ &#197; Å
&eacute; é &#74; J &#136; ˆ &#198; Æ
&ecirc; ê &#75; K &#137; ‰ &#199; Ç
&euml; ë &#76; L &#138; Š &#200; È
&igrave; ì &#77; M &#139; ‹ &#201; É
&iacute; í &#78; N &#140; Œ &#202; ?
&icirc; î &#79; O &#141; ? &#203; Ë
&iuml; ï &#80; P &#142; Ž &#204; Ì
&eth; ð &#81; Q &#143; ? &#205; Í
&ntilde; ñ &#82; R &#144; ? &#206; Î
&ograve; ò &#83; S &#145; ‘ &#207; Ï
&oacute; ó &#84; T &#146; ’ &#208; Ð
&ocirc; ô &#85; U &#147; “ &#209; Ñ
&otilde; õ &#86; V &#148; ” &#210; Ò
&ouml; ö &#87; W &#149; • &#211; Ó
&oslash; ø &#88; X &#150; – &#212; Ô
&ugrave; ù &#89; Y &#151; — &#213; Õ
&uacute; ú &#90; Z &#152; ˜ &#214; Ö
&ucirc; û &#91; [ &#153; ™ &#215; ×
&yacute; ý &#92; \ &#154; š &#216; Ø
&thorn; þ &#93; ] &#155; › &#217; Ù
&yuml; ÿ &#94; ^ &#156; œ &#218; Ú

If you feel a little overwhelmed by trying type up all those characters when you find yourself in need of using it, you might enjoy a Encode/Decode HTML entities tool at centricle.com. You can paste in your code snippet and convert it into ACII characters just by one click. Enjoy! 🙂