Where does the outlet have to be in a bathroom?
At least one receptacle is required within 36 inches of the outside edge of each bathroom sink basin (IRC E3901.6).
Every bathroom must have at least one wall receptacle, and it has to be located within 36 inches of the outside edge of each lavatory (sink) basin.
It is normally installed on the wall or the side of the cabinet next to the basin, and it must be GFCI-protected under E3902.
This keeps a grounded, shock-protected outlet within easy reach of the sink for items such as razors and hair dryers.
Related answers
Need this scoped to your jurisdiction?
Adopted edition and local amendments vary by city and county. Ask Donnie checks your jurisdiction and cites the exact adopted section.
Ask Donnie →General information based on the International Residential Code (a model code). This is AI assistance to verify — not legal advice. Confirm the adopted edition and any local amendments with your local building department (AHJ) and a licensed professional before you build.