Xenophobia refers to extreme dislike or fear of the unknown. It involves having a distaste for that which is different from you. Specifically, it could include the fear of other cultures and beliefs. Racism relates that any race determines the traits of humans and their capacity making them more superior than any their competition.
The roots of xenophobia can be traced back to a person's upbringing, or enforced isolation from something or someone different from you. The origins of racism can be attributed to the history of slavery and colonization.
Racism is a common expression that is used to explain that someone is judgmental against someone’s race. They may be making comments or acting that way towards someone based on their race. Any word that has the ending “phobia” on it refers to someone who has a fear of something. Right off the bat, there is a difference there.
Xenophobia is a fear of someone being different, whereas racism is not. The unknown plays a big part in xenophobia and disliking the unknown about a person. Racism hates the whole race. Racism is a term that has been around for many years and has been used for many years. Xenophobia is a term that is only being used recently.