I know there are HTML entities for 1/2, 1/4, and 3/4, but are there others? Like 1/3 or 1/8? Is there a good way to encode arbitrary fractions?
8 Answers
how about 15⁄16? (<sup>15</sup>⁄<sub>16</sub>)

- 12,855
- 13
- 54
- 80

- 66,919
- 31
- 85
- 96
1/2 → ½ or ½
1/4 → ¼ or ¼
3/4 → ¾ or ¾
1/8 → ⅛ or ⅛
3/8 → ⅜ or ⅜
5/8 → ⅝ or ⅝
7/8 → ⅞ or ⅞
1/3 → ⅓
2/3 → ⅔
1/5 → ⅕
2/5 → ⅖
3/5 → ⅗
4/5 → ⅘
1/6 → ⅙
5/6 → ⅚
...but you could also encode them as decimals: 15/16 = 0.9375 ;)

- 12,012
- 3
- 28
- 33
-
2The equivalent decimal codes do, however, appear to work for ⅛ to ⅞ in IE. I'll update my answer to include them. – scronide Feb 28 '12 at 17:49
For the existing fractions as Unicode codepoints (which are mapped to by HTML entities), search for "vulgar fraction" in the Unicode Character Names Index.
Now, for generic fractions, which work in HTML but also work in plain text, use the super- and subscript digits (see Unicode Codepoint Chart, search for "Superscripts") separated by the fraction slash character.
Your example implemented as above:
¹⁵⁄₁₆

- 92,761
- 29
- 141
- 204
Isn't just 15/16ths alright? Or even 15/16ths (15/16<sup>ths</sup>
)?

- 142,451
- 95
- 218
- 261
-
7There's no need to spell out the "ths". 15/16 is pronounced "fifteen sixteenths". – Bill the Lizard Oct 06 '08 at 17:45
For more complex scenarios there is also MathML. The support for this is slowly getting better. Internet Explorer seems to lag behind with this as well.

- 8,266
- 29
- 36
This would depend on your exact needs and audience. For most purposes many methods would be appropriate. 15/16, 15 parts of 16, 93.75%, 15/16 all mean the same, you might even use symbols like ++++++++++++++-
For some more complex scenarios you will need more complex solutions more like LaTeX than html. I believe there are also server side components that take LaTeX descriptions and create images that are browser compatible, such as described here: http://www.fauskes.net/nb/htmleqII/

- 1,695
- 2
- 23
- 31

- 10,347
- 17
- 101
- 151
There is also a standard called MathML. But is for XML unfortunately. However if you have more expressions you might consider switching to basic XML.

- 68,043
- 8
- 59
- 60
In HTML, this can be done with Unicode code 2044, preceded by &#x and ending with a semicolon. The whole thing is placed between the numerator and the denominator.
For instance, with this solution, 15 divided by 16 in HTML is rendered like this: 15⁄16
This works for combinations of integers acting as numerators and denominators.

- 934
- 2
- 13
- 28

- 1
- 1