Hex
mid 19th century (as a verb): from Pennsylvanian German hexe (verb), Hex (noun), from German hexen (verb), Hexe (noun).
wiktionary
First attested about 1830, from Pennsylvania German hexe(“to practice witchcraft”), from German hexen (compare Hexe(“witch”)). [1] The noun appeared later, in the 1850s. [2] Cognate to Norwegian Bokmål heks(“witch”) and Dutch heks(“witch”), Dutch beheksen(“to bewitch”), Old English hægtesse(“witch, hag”). Doublet of hag.
Short for hexadecimal.
Short for hexagon.
etymonline
hex (v.)
1830, American English, from Pennsylvania German hexe "to practice witchcraft," from German hexen "to hex," related to Hexe "witch," from Middle High German hecse, hexse, from Old High German hagazussa (see hag). Noun meaning "magic spell" is first recorded 1909; earlier it meant "a witch" (1856). Compare Middle English hexte "the devil" (mid-13c.), perhaps originally "sorcerer," probably from Old English haehtis.