Greek letters are simple to represent in HTML and TeX. In both systems, the code for a letter is essentially its name. The letter name is capitalized to get the capitalized form. HTML surrounds the letter name with an ampersand and semicolon. TeX prefixes the name with a backslash. For example, in HTML, λ is
λ and Λ is
Λ. In TeX these are
HTML and Unicode distinguish between Roman letters and Greek letters that look similar. For example, the English letter “A” has Unicode value x41, but the Greek letter Alpha has Unicode value x391. TeX, however, only provides symbols for Greek letters that do not look like their English counterparts. TeX also has alternate versions of some Greek letters .
See note below about representing Greek letters in XML .
Capital Greek letters
Note that the Unicode numbers above are consecutive with one exception: there is no Unicode character x3A2 between Ρ and Σ. The reason is given below. 
Lower-case Greek letters
 TeX also has several variations on Greek letters that are commonly used in mathematics: \varepsilon, \vartheta, \varpi, \varrho, and \varphi.
 HTML entities are illegal in XML and but legal in XHTML. XML applications require a numeric encoding of Greek letters. (You can simply put Unicode characters directly into your HTML page provided you set your content-type correctly. However, character entities and hexadecimal encodings allow you to represent non-ASCII symbols using only ASCII characters.) You can create an XML numeric encoding from a Unicode character by adding
&# on the left and
; on the right, such as
Γ for Γ, Unicode value x393.
 The Unicode value of a lower-case Greek letter is the value of its upper-case counterpart plus x20. However, there is one complication. Greek has two forms of the lower-case sigma: ς used only as the final letter of a word and the more familiar σ used everywhere else. That’s why there is no upper-case character x3A2 corresponding to the lower-case x3C2. The letter ς is an exception to the rule that HTML entities and TeX command sequences simply use the name of the Greek letter.
See also Common math symbols in HTML, XML, TeX, and Unicode.