Back
Asciify Logo
Asciify

Hyphen-Minus

- (Hyphen-Minus) is ASCII code point 45 (0x2D), Unicode U+002D, and a printable punctuation character. It joins compound words ("well-known"), separates syllables at line breaks, and doubles as the minus sign in everyday arithmetic — three roles crammed into one glyph because early character sets couldn't afford the luxury of separate symbols. In programming, - subtracts, negates, and decorates. It's the subtraction and unary negation operator everywhere, the arrow -> for pointer member access in C and return type annotation in Python, and the flag prefix for command-line options (ls -la). YAML uses it to introduce list items, and Markdown turns a line of --- into a horizontal rule. The character's most insidious programming trap involves CLI argument parsing: a filename beginning with a hyphen, like -report.txt, gets interpreted as an option flag instead of a file operand, and rm -report.txt throws an "invalid option" error rather than deleting anything. The conventional fix — rm -- -report.txt — uses the double-hyphen sentinel to say "everything after here is a filename, not a flag." ASCII conflated hyphen and minus into a single code point because teletype machines had limited character budgets. Proper typography distinguishes at least three marks: hyphen, en dash, and minus sign. UTF-8 encodes it as a single byte 0x2D. Unicode classifies it as Pd (Punctuation, Dash) with the name HYPHEN-MINUS. The true minus − (U+2212) and en dash – (U+2013) are the characters typographers wish everyone used instead, but decades of habit keep 0x2D firmly entrenched.

Symbol

Technical Details

Code Example

</>
int neg = -45; // '-' makes a number negative
int diff = 10 - 3; // subtraction operator
char opt = '-'; // ASCII 45 literal in code

Frequently Asked Questions

  • The hyphen-minus (ASCII 45) is on your keyboard. The en-dash (–, U+2013) is for ranges (pages 1–10). The em-dash (—, U+2014) is for parenthetical statements. Only the hyphen-minus exists in ASCII — the others are Unicode. Word processors auto-correct -- to —, but code editors don't.

  • ASCII only has one character (code 45) for both purposes. The typographic minus (−, U+2212) is actually wider and vertically centered differently than the hyphen-minus. In code, there's no distinction — the hyphen-minus handles subtraction, negative numbers, and CLI flags alike.

  • Double dash signals 'end of options' — everything after it is treated as arguments, not flags. This prevents a filename like '-rf' from being interpreted as flags: rm -- -rf safely deletes the file named '-rf'. It's essential for handling user-provided filenames securely.

  • CSS identifiers follow specific rules: they can start with a letter, underscore, or hyphen, but a hyphen can't be followed by a digit (-.5class is invalid). This prevents ambiguity with negative numbers in property values. Use a letter after the hyphen: .my-1col works.

@workani&@alexluthor
Privacy & legal

Privacy

No accounts, no ads, no tracking cookies, and no cross-site tracking. The only analytics we keep are faceless — anonymous, aggregated counts of pages and searches, never tied to you. We store no IP addresses, set no tracking cookies, and build no profiles. Cloudflare hosts the site and handles requests for delivery and security.

Full privacy policy·Extension privacy·legal@asciify.dev

Attributions & licenses

Twemoji
© Twitter, Inc and other contributors · CC-BY 4.0
Noto Color Emoji
© Google · Apache 2.0
Fluent UI Emoji
© Microsoft · MIT
OpenMoji
© HfG Schwäbisch Gmünd · CC-BY-SA 4.0
Toss Face
© Viva Republica (Toss) · SIL OFL 1.1
JoyPixels
© JoyPixels Inc. · Free Limited Use License
SerenityOS Emoji
© The SerenityOS Developers · BSD-2-Clause
EmojiTwo
© EmojiTwo contributors · CC-BY 4.0
Apple Color Emoji
© Apple, Inc.
Facebook Emoji
© Meta Platforms, Inc.

Apple and Facebook emoji styles are proprietary and shown here solely for reference and comparison — a common-sense application of nominative-use / fair-use principles. asciify is not affiliated with, endorsed by, or sponsored by Apple, Inc., Meta Platforms, Inc., or any other rights holder listed above. If a rights holder requests removal of their emoji style from this site, it will be removed.

All other vendor emoji are reproduced for reference and comparison under their respective open licenses listed above.

Character names and code points from the Unicode® Standard. Unicode® and the Unicode Logo are registered trademarks of Unicode, Inc.

Privacy
© asciify.dev 2025-2026