Greek Letters in HTML and JavaScript

JavaScript FAQ | JavaScript Strings and RegExp FAQ  

Question: Can I display Greek letters on my page as part of JavaScript output?

Answer: You can include Greek letters in JavaScript strings and/or display Greek letters on your webpage using several representations:

  • hexadecimal codes \uXXXX in JavaScript strings; e.g. small alpha (α) is \u03B1
  • numeric HTML entities; for example, small alpha is α
  • HTML entities; for example, small alpha is α
  • unescape with a suitable argument; e.g. small alpha is unescape('%u03B1')
  • decodeURI with a suitable argument; e.g. small alpha is decodeURI('%CE%B1')
    Here is a simple test for the Greek letter pi (π):
    document.write('C = 2\u03C0R')      // 
    document.write('C = 2πR')      // 
    document.write('C = 2πR')        // 
    document.write(unescape('%u03C0'))  // 
    document.write(decodeURI('%CF%80')) // 

    To display Greek letters in a JavaScript alert message or a confirm dialog box, use hexadecimal codes, for example:

    alert('\u03A9 is the last letter of the alphabet.') //Try it!

    The following table lists HTML entities, character codes, and URL-encodings for Greek letters in alphabetical order. Some letter variants do not have HTML entities; for example, ϓ (ϓ) or ϕ (ϕ). These letter variants are omitted.

    chr \uXXXX  Numeric  HTML entity escape(chr) encodeURI(chr)
    Α\u0391Α Α %u0391 %CE%91
    Β\u0392Β Β %u0392 %CE%92
    Γ\u0393Γ Γ %u0393 %CE%93
    Δ\u0394Δ Δ %u0394 %CE%94
    Ε\u0395Ε Ε %u0395 %CE%95
    Ζ\u0396Ζ Ζ %u0396 %CE%96
    Η\u0397Η Η %u0397 %CE%97
    Θ\u0398Θ Θ %u0398 %CE%98
    Ι\u0399Ι Ι %u0399 %CE%99
    Κ\u039AΚ Κ %u039A %CE%9A
    Λ\u039BΛ Λ %u039B %CE%9B
    Μ\u039CΜ Μ %u039C %CE%9C
    Ν\u039DΝ Ν %u039D %CE%9D
    Ξ\u039EΞ Ξ %u039E %CE%9E
    Ο\u039FΟ Ο %u039F %CE%9F
    Π\u03A0Π Π %u03A0 %CE%A0
    Ρ\u03A1Ρ Ρ %u03A1 %CE%A1
    Σ\u03A3Σ Σ %u03A3 %CE%A3
    Τ\u03A4Τ Τ %u03A4 %CE%A4
    Υ\u03A5Υ Υ %u03A5 %CE%A5
    ϒ\u03D2ϒ ϒ %u03D2 %CF%92
    Φ\u03A6Φ Φ %u03A6 %CE%A6
    Χ\u03A7Χ Χ %u03A7 %CE%A7
    Ψ\u03A8Ψ Ψ %u03A8 %CE%A8
    Ω\u03A9Ω Ω %u03A9 %CE%A9
    α\u03B1α α %u03B1 %CE%B1
    β\u03B2β β %u03B2 %CE%B2
    γ\u03B3γ γ %u03B3 %CE%B3
    δ\u03B4δ δ %u03B4 %CE%B4
    ε\u03B5ε ε %u03B5 %CE%B5
    ζ\u03B6ζ ζ %u03B6 %CE%B6
    η\u03B7η η %u03B7 %CE%B7
    θ\u03B8θ θ %u03B8 %CE%B8
    ϑ\u03D1ϑ ϑ %u03D1 %CF%91
    ι\u03B9ι ι %u03B9 %CE%B9
    κ\u03BAκ κ %u03BA %CE%BA
    λ\u03BBλ λ %u03BB %CE%BB
    μ\u03BCμ μ %u03BC %CE%BC
    ν\u03BDν ν %u03BD %CE%BD
    ξ\u03BEξ ξ %u03BE %CE%BE
    ο\u03BFο ο %u03BF %CE%BF
    π\u03C0π π %u03C0 %CF%80
    ϖ\u03D6ϖ ϖ %u03D6 %CF%96
    ρ\u03C1ρ ρ %u03C1 %CF%81
    ς\u03C2ς ς %u03C2 %CF%82
    σ\u03C3σ σ %u03C3 %CF%83
    τ\u03C4τ τ %u03C4 %CF%84
    υ\u03C5υ υ %u03C5 %CF%85
    φ\u03C6φ φ %u03C6 %CF%86
    χ\u03C7χ χ %u03C7 %CF%87
    ψ\u03C8ψ ψ %u03C8 %CF%88
    ω\u03C9ω ω %u03C9 %CF%89
    Alphabetical order differs from the character code order for these letters:
    ϑ\u03D1ϑ ϑ %u03D1 %CF%91
    ϒ\u03D2ϒ ϒ %u03D2 %CF%92
    ϖ\u03D6ϖ ϖ %u03D6 %CF%96

    See also:

  • How do I convert a string to URL-encoding?
  • Special and Mathematical Symbols
  • Accented Characters and Ligatures
  • W3C Character Entity References in HTML 4 (


    Copyright © 1999-2011,