Alkaloids are a class of naturally occurring chemical compounds that mostly contain basic nitrogen atoms. This group also includes some related compounds with neutral and even weakly acidic properties. Some synthetic compounds of similar structure are also termed alkaloids. In addition to carbonhydrogen and nitrogen, alkaloids may also contain oxygensulfur and, more rarely, other elements such as chlorinebromine, and phosphorus.