Mistake and error mean something that is done incorrectly or wrong. Thus, they are synonyms. But the difference between these two words is in the context that they are used in.
1. Mistake is usually a choice that turns out to be wrong.
Mistakes are usually accidental. You know it’s wrong. In other words, mistakes are performance based, and can be self-corrected. Mistake is less formal than error, and is usually used in daily speech.
Coming to this place was a big mistake. We only wasted our time.
2. Errors are usually made due to the lack of knowledge. So, the action was wrong because it was different from the rules, model or specific code. Error is a more formal word than mistake.
In sports, the violation of rules will be called an error.
You cannot say, “I does my homework” – that’s an error! You have to say, “I do my homework”.
你不能说，“I does my homework”—那是个错误!你必须说，“I do my homework”。