How Do You Get Toenail Fungus: Causes and Risk Factors

Toenail fungus starts when microscopic fungi, usually picked up from warm, damp surfaces or trapped inside your own shoes, find a way into or under the nail. It affects up to 20% of adults at some point in their lives, making it the single most common nail disorder. Understanding exactly how the infection takes hold can help you figure out where yours came from and how to keep it from spreading.

The Fungi Behind the Infection

Several types of fungus can infect a toenail, but one group dominates. Dermatophytes, a family of fungi that feed on the protein keratin in skin, hair, and nails, cause roughly 36% of cases. The single most common species is Trichophyton rubrum, which also causes athlete’s foot. Yeasts (including Candida species) and environmental molds each account for about 28% of infections, with the remainder being mixed infections involving more than one organism.

This matters because toenail fungus isn’t one disease with one cause. The fungus living on a gym shower floor is likely a dermatophyte, while the mold growing in a garden pot is a completely different organism, and both can end up in your nail.

How Fungus Gets Into the Nail

In the most common pattern, fungus doesn’t burrow through the top of the nail. Instead, it enters from the skin around the tip of your toe, slipping into the gap where the nail meets the nail bed underneath. From there, it spreads backward toward the cuticle, causing the nail to thicken, discolor, and lift away from the bed as inflammation builds. This is why early toenail fungus often shows up first at the free edge of the nail rather than near the base.

Less commonly, fungus can invade directly through the surface of the nail plate, creating white, chalky patches on top. In rare cases, it enters from the cuticle end, working its way into the deeper layers of the nail near the root. Each route produces a slightly different appearance, but they all start with the same basic requirement: the fungus needs a point of entry.

Why Small Injuries Matter

Repetitive micro-trauma to the toenail is one of the biggest enablers of infection. Every time a tight shoe jams your toe, a heavy object clips your nail, or you stub your foot during a run, it can create tiny separations between the nail and the nail bed. These invisible gaps give fungi a direct path inside. Runners, hikers, and anyone who spends long hours on their feet in snug shoes are particularly vulnerable for this reason.

Where You Pick It Up

Toenail fungus spreads from person to surface to person. The fungi thrive in warm, moist environments, so any communal area where people walk barefoot is a hotspot. Gym showers, pool decks, locker room floors, and shared dorm bathrooms are classic sources. Fungal spores shed from an infected person’s feet can survive on these surfaces, and all it takes is walking across that same floor with bare feet.

Your own home can be a source too. If someone in your household has toenail fungus or athlete’s foot, the fungi shed onto bathroom floors, shared towels, bath mats, and even bed sheets. Sharing nail clippers or other grooming tools is another common route, since a contaminated clipper can introduce spores directly into micro-cuts around the nail. Keeping personal grooming tools separate and avoiding shared towels reduces this risk significantly.

Your Shoes Create the Perfect Environment

Fungi need moisture and warmth to grow, and a shoe provides both in abundance. Your feet have roughly 250,000 sweat glands, and when that sweat gets trapped inside a tight, non-breathable shoe for hours, the environment inside becomes ideal for fungal growth. Synthetic materials and poorly ventilated designs make this worse. Socks compound the issue if they stay damp throughout the day.

This is why toenail fungus is far more common than fingernail fungus. Your hands dry out constantly throughout the day, while your toes sit in a dark, warm, humid enclosure for 8 to 12 hours at a stretch. People who wear steel-toed boots, rubber work shoes, or athletic cleats for long shifts face a higher risk simply because of how little air circulation those shoes allow. Alternating between pairs of shoes so each has time to dry out, choosing breathable materials, and changing socks when they get sweaty all work against the conditions fungi need.

Medical Conditions That Raise Your Risk

Certain health conditions make toenail fungus significantly more likely, and harder to clear once it takes hold. Diabetes is the most well-studied example. Chronically elevated blood sugar weakens the immune system’s ability to fight off fungal invaders, and people with diabetes face nearly three times the risk of developing toenail fungus compared to people without it. When diabetes also causes nerve damage in the feet, the problem deepens: you may not feel the small injuries and pressure points that create entry routes for fungi, so infections can progress unnoticed.

Poor circulation in the legs and feet, whether from peripheral vascular disease or other causes, slows the delivery of immune cells to the toes and limits how quickly damaged tissue heals. This gives fungi more time to establish themselves. Conditions that suppress the immune system more broadly, such as HIV or immunosuppressive medications, also raise vulnerability. Even aging itself is a major factor. Toenail fungus is most common in people over 60, partly because nails grow more slowly with age (giving fungi more time to take hold) and partly because circulation naturally declines.

Athlete’s Foot Is Often the Starting Point

One of the most overlooked pathways to toenail fungus is an untreated case of athlete’s foot. Both conditions are frequently caused by the same dermatophyte species. Athlete’s foot infects the skin between and around your toes, and if left untreated, the fungus can migrate from the surrounding skin into the nail bed. Many people treat the itching and flaking of athlete’s foot with over-the-counter creams but stop treatment before the fungus is fully eliminated, allowing it to quietly spread to the nail.

Because toenail fungus progresses slowly, often taking months before it becomes visibly obvious, you may not connect the two conditions. Treating athlete’s foot promptly and completely is one of the most effective ways to prevent toenail fungus from developing in the first place.

How Doctors Confirm It’s Actually Fungus

Thickened, discolored toenails aren’t always fungal. Nail psoriasis, physical trauma, and other conditions can look almost identical. Lab confirmation matters because antifungal treatments are unnecessary (and ineffective) if the problem isn’t actually fungus. The most common test involves dissolving a nail clipping in a chemical solution and examining it under a microscope. This is quick, inexpensive, and highly specific: if it’s positive, there’s a 96% chance it’s truly fungal.

If that test comes back negative but the nail still looks suspicious, a fungal culture can identify the exact species involved, though results take weeks. A nail biopsy with special staining is another option with strong accuracy. Knowing the specific organism can help guide treatment choices, since dermatophytes, yeasts, and molds don’t all respond to the same medications.

Reducing Your Exposure

Most prevention comes down to limiting contact with fungi and denying them the conditions they need to grow. Wear sandals or shower shoes in gym showers, pool areas, and hotel bathrooms. Dry your feet thoroughly after bathing, paying attention to the spaces between toes. Choose shoes that allow air to circulate around your feet, and give each pair at least 24 hours to dry out between wearings. Swap to fresh socks midday if your feet tend to sweat heavily.

At home, don’t share towels, socks, or nail clippers with anyone who has a known fungal infection. If you get regular pedicures, confirm that the salon sterilizes its instruments between clients. Keep your nails trimmed straight across and not too short, since very short nails expose more of the nail bed to potential invasion. None of these steps guarantee you’ll never get toenail fungus, but together they remove most of the opportunities fungi rely on to reach your nails in the first place.