One Half Fraction HTML entity ½

½ is the HTML entity for One Half Fraction ½ (U+00BD). Copy the decimal ½ and hex ½ codes plus CSS, JavaScript, Python and URL escapes.

Entity
½
Also written
½
Legacy form
&frac12 (no semicolon)
Code point
U+00BD
Unicode name
VULGAR FRACTION ONE HALF
Block
Latin-1 Supplement
Category
Other number (No)
Since
Unicode 1.1
Defined in
HTML 4.01 and HTML5

Codes to copy

HTML named½Works in HTML; in XML only & < > " ' are predefined.
HTML decimal½Works in HTML and XML.
HTML hex½Works in HTML and XML.
CSScontent: "\BD";In a stylesheet, for ::before and ::after.
JavaScript"\u00BD"Also valid in JSON.
Python"\u00bd"Python 3 string literal.
Python by name"\N{VULGAR FRACTION ONE HALF}"Readable alternative using the Unicode name.
URL%C2%BDPercent-encoded UTF-8 bytes, for a path or query value.
UTF-8 bytesC2 BD2 bytes.
UTF-1600BD1 code unit, which is what JavaScript length counts.

When to use it

One of the three fractions in HTML 4 (&frac12;, &frac14;, &frac34;). HTML5 names thirds, fifths, sixths and eighths too, and any other fraction can be built with <sup>, <sub> and the fraction slash &frasl;. &half; is an alias.

The name dates from HTML 4, so it works in every browser and in old email clients.

Browsers also accept the legacy form &frac12 without a semicolon, for compatibility with old pages; new HTML should always end the reference with a semicolon.

More letterlike symbols, numbers and fractions

All letterlike symbols, numbers and fractions · Every HTML entity · Encode or decode text

Source: the WHATWG HTML Standard list of named character references and the Unicode Character Database (Unicode 18.0).