That racism and ignorance will forever get confused. So here's an difference.
Example:
Person 1: Is sitting in a room full of black people (this person is not black). The people around them are cracking jokes about how another black person's hair is uncombed, everyone takes it lightly and laughs (this is amongst the black people). Person 1 chimes in and refers to the black person's hair as "nappy" in an attempt to make a similar joke. This is ignorance because they are trying to make something that is highly offensive into a joke without understanding how it can affect the people around them or what it really means.
Person 2: Is driving down the highway(this person is not black) and gets cut off by what just so happens to be a black person. The person proceeds to correlate the person's driving with their race and insulting their completion. On top of this, the person responds like this often, calling black people all kinds of names and pinning stereotypes on them. This is racism because they know what they're saying and how it is disrespectful to a whole race of people. Though they know this, they proceed to say it anyway.