Melanocytes are primarily located in the basal layer of the epidermis, which is the deepest part of the outer skin layer. They are also found in hair follicles, mucous membranes, and some internal organs such as the uvea of the eye, inner ear, meninges, bones, and heart. These cells produce melanin, the pigment responsible for skin color, and play a role in protecting the skin from UV radiation by transferring melanin to neighboring keratinocytes.