Minus sign (−) in HTML
The minus sign is a distinct character from the hyphen. Its named reference is − and its code point is U+2212, drawn at the same width and height as a plus sign.
At a glance
- Character
- −
- Named entity
- −
- Decimal reference
- −
- Hex reference
- −
- Unicode code point
- U+2212
- Unicode name
- MINUS SIGN
- In the entity reference
- Math
In detail
The character on your keyboard is the hyphen-minus at U+002D, a compromise inherited from typewriters that has to serve as a hyphen, a minus and a dash. It is drawn short and low so it works inside a hyphenated word. The real minus sign is longer, sits at the same optical height as the crossbar of a plus, and has the same advance width as a plus or an equals, which is what makes a column of positive and negative numbers align.
That alignment is the strongest reason to use it. In a table of figures set with tabular numerals, a hyphen leaves the negative values a fraction narrower than the positives, and the decimal points drift. Swapping in the real minus sign fixes the column without touching the layout.
It also changes what is announced. Screen readers generally read the real minus sign as minus and the hyphen as nothing at all or as a pause, so a negative figure written with a hyphen can be read aloud as a positive one. In financial or scientific content that is a correctness issue rather than a typographic nicety.
The cost is copy and paste. A value copied from a page and pasted into a spreadsheet, a code editor or a search box will not parse if it carries the real minus sign, because every programming language and most spreadsheet importers expect the ASCII hyphen. Use the real character in prose and rendered tables, and keep the ASCII one in anything meant to be copied and run.
Examples
<td class="num">1,204.00</td>
<td class="num">−318.25</td>
.num {
font-variant-numeric: tabular-nums;
text-align: right;
}const delta = -318.25; // U+002D hyphen-minus, parses fine
Number("-318.25"); // -318.25
Number("\u2212318.25"); // NaN, because the real minus sign is not ASCIIRender the true minus sign in prose and tables. Emit the ASCII hyphen anywhere a value will be parsed.
Things that catch people out
- A value with the real minus sign fails Number parsing in JavaScript and returns NaN, so never emit it into JSON or a data attribute that will be read back.
- Search will not match a query typed with a hyphen against content stored with the real minus. Normalise on the way into your index.
- Some fonts draw the two characters at nearly the same length, so a visual check will not tell you which one a page is using. Check the code point.
Try it: HTML Entity Reference
Search 152 entities across 9 categories, switch the copy format between the character, the name, the decimal form and the hex form, and copy in one click.
HTML Entity Reference
LOCAL · Browser-OnlySearchable reference of 150+ HTML entities with one-click copy in any format
152 entities across 9 categories
Commonly Used
→Arrows(13)
±Math(35)
$Currency(8)
…Punctuation(21)
©Symbols(24)
πGreek(30)
½Fractions(6)
●Geometric(7)
æLatin Special(8)
Click any entity card to copy it in your chosen format. All data is embedded in the page and works offline.
Related HTML entities
All html entities →Multiplication sign (×) in HTML
The multiplication sign at U+00D7, its entity forms, why image dimensions should not use a letter x, and the other cross characters it is confused with.
En dash (–) in HTML
The en dash at U+2013 joins ranges and paired terms. Its entity forms, how wide it really is, and how to stop spreadsheets turning your ranges into dates.
Plus minus sign (±) in HTML
The plus minus sign at U+00B1, its entity forms, how it reads in a tolerance versus a measurement uncertainty, and the minus plus character that reverses it.
Not equal to sign (≠) in HTML
The not equal to sign at U+2260, its entity forms, why the composed and combining versions differ, and how it compares to the operators used in code.
Less than or equal (≤) and greater than or equal (≥)
The inequality signs at U+2264 and U+2265, their entity forms, the slanted variants used in some traditions, and when to keep the ASCII operators instead.
Approximately equal to (≈) in HTML
The almost equal to sign at U+2248 with its entity forms, and how it differs from the congruent, asymptotic and identical to signs it is confused with.
Tools for this
- HTML Entity Reference Free online HTML entity reference - search and copy HTML entities with live preview
- HTML Entity Encoder Free online HTML entity encoder - encode or decode HTML entities to prevent XSS and display issues