Formula for cyanide?

The cyanide ion is CN-

It is commonly found in hydrogen cyanide (HCN)

also known as hydrocyanic acid, and potassium cyanide (KCN).