On the physical LED, the longer lead (or leg) of the LED is the anode. The cathode is marked on the rim of the LED body with a flat area shown in the diagram. Another way to tell which lead is the anode and which is the cathode is to look at the two plates at the end of the leads inside the body of the LED.

