To boil eggs in the microwave, first boil the water in the microwave or on the stove. While the water boils, cover the eggs in aluminum foil and place them in a microwave-safe container. Pour the boiling water over them, then heat in the microwave to finish cooking.
Boil enough water to cover each egg by an inch or so. Each egg needs to be wrapped individually in foil. For hard-boiled eggs, cook on high power for six minutes. If you prefer softer boiled eggs, cook on high for three minutes. Run them under cool water as soon as they are done to help prevent unsightly discoloration, though the discoloration is not dangerous.
Never cook an egg in the microwave without foil or piercing the shell. If you do, the egg explodes and can damage the microwave. Piercing the shell may introduce bacteria to the egg, so is also less safe. When you wrap the egg in foil, try to make it as smooth as possible to ensure that the entire surface is covered. This prevents the microwave from cooking the egg directly, allowing the water to boil it. Make sure the egg stays covered with water to prevent sparking or other damage from the aluminum foil.