How to write usable error messages

Have you ever come across a bad error message? If you have used a computer or any piece of technology, you may have seen them. What makes an error message bad? A bad error message is an error or dialog box that only makes sense to the person who wrote it in the first place. It doesn’t tell you what the error is, what caused it or how to approach solving it.
How To Write Usable Error Messages

How do you write good or usable error messages?

A good error message has three parts: what is the error, what caused the problem and how the user can fix it.

What is the error

Be Descriptive. Your error message should answer the five w’s: Who, What, Why, When and Where. An error message like “Invalid Entry” doesn’t answer the 5 w’s. A better message is “Your email address is empty. Please enter your email address.” It tells you what the error is, where the problem is located and how to fix it.

Make sure your error message focuses on the user. It should use simple and jargon-less words to describe the problem Your error message should be short and direct. No extra words. If you think it has too many words, cut out the extra ones.

What Caused the Problem

You want to explain what caused the problem. Was it a data entry error? Did they forget to fill something out? Was it something beyond their control like a lost database connection? Let them know in simple and easy to understand terms.

How can the user can fix it

Your error message should also have a way to fix the problem. If they forgot the fill out a field, tell them which field. Make it easy to figure out the problem.

Additionally, your error message should also be visible. Your error message should be displayed prominently so the user can see it and know that an error has occurred.


Why do you want to do this? Remember, you are not writing error messages for yourself. You are writing for the person who may be annoyed, doesn’t understand the code and just wants to get a task done. That person may be you.

Need more tips on writing usable error messages? Check out these 7 tips on writing friendly error messages.