Hyphen-minus Alt Code and Symbol

The Alt code for Hyphen-minus is 45. Hold Alt, type 45 on the numeric keypad, then release Alt. Hyphen-minus also has the Unicode codepoint U+002D, so you can type it with Alt+45 on Windows, search for U+002D in macOS's Character Viewer, use - in HTML, or \002D in CSS. If your keyboard has no numeric keypad, use the Character Viewer, the HTML entity, or copy the character directly — the Alt key method requires a physical numpad. Copy the Hyphen-minus character from this page when you need it in a form, chat message or document that does not accept Alt codes. Hyphen-minus has no named HTML entity, so use the numeric escape - or the hex escape -.

Codes for this symbol

Copy any value by clicking it.
MethodValue
Legacy Alt code
Alt + decimal
Alt + X hex
HTML decimal
HTML hex
CSS escape
Python escape
JavaScript escape
UTF-8 bytes
Unicode codepoint
Unicode block
Unicode category

Not available for this symbol: macOS Option shortcut, named HTML entity.

How to type hyphen-minus on Windows

  1. Turn Num Lock on so the numeric keypad is active.
  2. Hold the left Alt key.
  3. Type 4 5 on the numeric keypad.
  4. Release Alt. The Hyphen-minus character (-) appears.

If your keyboard has no numeric keypad, see how to type symbols without a numpad.

How to type hyphen-minus on macOS

There is no direct Option shortcut for Hyphen-minus. Open the Character Viewer with ⌃⌘Space, search for "Hyphen-Minus" and click the character to insert it.

How to use hyphen-minus in code

  • HTML: or
  • CSS: content:"\002D"; ()
  • Python: \u002D or chr(0x2D)
  • JavaScript: \u002D or String.fromCodePoint(0x2D)
  • JSON: "\u002D"

Frequently asked questions

What is the Alt code for Hyphen-minus?

The legacy Alt code for Hyphen-minus is 45. Hold Alt, type 4 5 on the numeric keypad, then release Alt.

How do I type - without a numpad?

Use the Windows Character Viewer (Win+.), the macOS Character Viewer (⌃⌘Space), an HTML entity such as -, or copy the character directly from this page.

Why does Alt+45 not work?

Alt+45 only works on a keyboard with a physical numeric keypad. It also requires the application to accept the numeric-keypad input path. Laptops without a numpad need an alternative method.

What is the Unicode for Hyphen-minus?

The Unicode codepoint for Hyphen-minus is U+002D. You can use this value in HTML as -, in CSS as \002D, and in Word with Alt+X.

How do I type - on a Mac?

Open the Character Viewer with ⌃⌘Space and search for the character name or U+002D, then click it.