Error messages are part of the user experience. When done right, they help users understand what's wrong and how to fix it. But when done poorly, they confuse users and frustrate developers.
Inspired by Google’s error message guidelines, this guide will help you write better, clearer error messages.
🔧 General Rules for Writing Good Error Messages
❌ Don’t Hide Errors
Always show a clear message when something fails. Silent failures are a big problem:
- Users get confused.
- Developers have no clue what went wrong from logs.
✅ Do this:
Couldn’t save your changes. Please check your internet connection and try again.
✅ Tell the User What Went Wrong
Be direct and specific. Avoid vague phrases like “Something went wrong.”
🚫 Don’t:
Error occurred.
✅ Do:
We couldn’t upload the file. The file format is not supported.
🧭 Help the User Fix It
An error message should tell users what they can do next.
🚫 Don’t:
Invalid input.
✅ Do:
Password must be at least 8 characters and include a number.
👤 Write for Humans, Not Machines
Avoid technical jargon or internal error codes in the message. Logs are for developers — messages are for users.
🚫 Don’t:
500: Internal Server Error – NullReferenceException
✅ Do:
Sorry, something went wrong on our side. Please refresh the page or try again later.
🔤 Use Simple and Friendly Language
Keep your language easy to understand. No need to sound robotic.
🚫 Don’t:
Access denied due to authentication failure.
✅ Do:
You need to sign in to view this page.
📱 Make Messages Clear on All Screens
Keep it short and meaningful — especially on mobile. Users might be reading it on small screens.
✅ Good:
No internet connection. Try again.
🧪 Bonus Tips
- Don’t blame the user. Be polite and respectful.
- Use consistent terms. If you say “sign in” in one place, don’t say “log in” elsewhere.
- Don’t use “please” everywhere. Use it only when asking the user to do something.
- Use humor only when it’s helpful. Never joke about data loss or serious errors.
✨ A Few Templates You Can Use
Situation | Message Example |
---|---|
Required field is empty | This field can’t be empty. |
Invalid email format | Enter a valid email address. |
Server error | Something went wrong. Try again later. |
Action requires login | Please sign in to continue. |
No internet connection | You’re offline. Check your connection. |
🧵 Final Thoughts
A good error message doesn’t just explain what went wrong. It speaks like a human, not a robot.
It’s clear, helpful, and makes users feel supported, not stuck.
These small messages can make a big difference in how people experience your product.
Want to dive deeper? Check out the full guide by Google.