The exact cause of canker sores is still unknown. They happen when your immune system reacts to attack the lining of your mouth. This may be triggered by mechanical irritation or trauma, as an allergic reaction to something you ate, or exposure to chemicals in toothpaste or mouthwash. In some cases, certain types of bacteria or viruses are responsible for the painful mouth sores.

Women statistically suffer from canker sores more often than men. Canker sores are typically seen in people between the ages of 10 and 40, although they have been known to show up at any age.

Causes

Canker sores are thought to be caused by or triggered by these factors:

Trauma to the Mouth

Injuries to the mouth, as seen frequently by contact sports players Accidentally biting the inside of the cheek or lip Hot food or drink burning the inside of the mouth​​ Broken teeth are often sharp and may rub on the oral tissues to produce painful canker sores. Broken restorations may also cause a similar effect on the oral tissues. Poor-fitting complete or partial dentures may cause canker sores in the area of the mouth where the denture may rubbing on the tissue. The development of a canker sore is often one of the first signs that indicate the need for a denture adjustment by your dentist or denturist. Orthodontic brackets, bands, and various other orthodontic attachments will often cause canker sores to develop in an area of the mouth where there is constant friction on the oral tissues. This is common when orthodontic treatment first begins and may occur after each subsequent adjustment, throughout each stage of treatment.

Irritation From Food, Drink, Tobacco, and Chemicals

Spicy or acidic foodsThe use of chewing (smokeless) tobacco will often cause a canker sore to develop in the area of the mouth where the tobacco is held. This may be due to the irritating chemicals found in the addictive product. Sodium lauryl sulfate is a common ingredient in toothpaste and had been associated with the development of canker sores. 

Allergic and Immune Reactions

Allergic reactions and sensitivities to certain foods may cause a canker sore to develop. Allergic reaction to certain types of bacteria found in the mouth may also result in this type of mouth ulcer. Allergies to metals such as nickel may become evident in the mouth of a person wearing orthodontic devices necessary to move the teeth. Canker sores may begin to appear adjacent to the metal attachments. This is often referred to as contact dermatitis. People with celiac disease may experience canker sores. Gluten may be associated with the development of canker sores in those with celiac disease. 

Miscellaneous Causes

Emotional stress has been identified as a possible trigger that may cause the development of canker sores. Bacteria responsible for peptic ulcers has been linked to canker sore occurrence. Vitamin deficiencies, specifically vitamin B12, folate (folic acid), and iron may trigger canker sore development.  Hormonal changes, notably during menstruation, pregnancy, and menopause, have been linked to canker sores. Canker sores often run in families. Genetics may be a factor.  Information associated with inflammatory bowel disease (IBD) often will list canker sores as a complication associated with Crohn’s disease and ulcerative colitis. Mouth sores are a common occurrence observed in immunosuppressed patients, such as those with HIV/AIDS. Behcet’s disease

Treatment 

Treatment is generally not necessary for most canker sores as they tend to heal quickly on their own. If canker sores persist for longer than two weeks, see the dentist.

See your dentist immediately if canker sores:

Become unusually larger than normalAre extremely painful, interfering with eating, drinking, and talkingBegin to appear more frequently than normalDo not heal after 14 daysAre accompanied by a high feverAppear to become infected