The main difference between Alex and Alec is that the Alex is a unisex given name and Alec is a male given name
Alex (Aleck or Alec is the Scottish form) may be a diminutive of the male given name Alexander, or its female equivalent Alexandra or Alexandria, or a given name in its own right. Alexander is derived from the Greek “Ἀλέξανδρος” (Aléxandros).
The East European male name Alexey (Aleksei, Alexis, Aleksa) is also sometimes shortened to Alex. It is a commonly used nickname in Spanish for Alejandro, Alexandro, Alejandrino and Alexandrino, and related names like Alexa and Alexis.
Alec or Aleck is a Scottish form of Alex. It may be a diminutive of the given name Alexander or a given name in its own right. Notable people with the name include:
An anchovy or herring, especially pickled or dried.
A sauce made from alecs; alec sauce.