Boil the eggs thoroughly and peel off the shells.
Mash the boiled eggs into appropriate-sized pieces.
Add mayonnaise, chopped onion, salt, and pepper to the eggs and mix well.
If desired, add chopped pickles and mix.
Transfer to a salad bowl and serve.