The aim of this study was to evaluate, for the first time, the antifungal efficacy of nanocapsules and nanoemulsions containing Melaleuca alternifolia essential oil (tea tree oil) in an onychomycosis model. The antifungal activity of nanostructured formulations was evaluated against Trichophyton rubrum in two different in vitro models of dermatophyte nail infection. First, nail powder was infected with T. rubrum in a 96-well plate and then treated with the formulations. After 7 and 14 days, cell viability was verified. The plate counts for the samples were 2.37, 1.45 and 1.0 log CFU mL(-1) (emulsion, nanoemulsion containing tea tree oil and nanocapsules containing tea tree oil, respectively). A second model employed nails fragments which were infected with the microorganism and treated with the formulations. The diameter of fungal colony was measured. The areas obtained were 2.88 ± 2.08 mm(2), 14.59 ± 2.01 mm(2), 40.98 ± 2.76 mm(2) and 38.72 ± 1.22 mm(2) for the nanocapsules containing tea tree oil, nanoemulsion containing tea tree oil, emulsion and untreated nail, respectively. Nail infection models demonstrated the ability of the formulations to reduce T. rubrum growth, with the inclusion of oil in nanocapsules being most efficient.