The solar atmosphere presents a wealth of dynamics due to a constant interplay between the plasma flows and magnetic fields. Twisted flux tubes are an essential magnetic structure, believed to be driven by the rotational surface's motions and linked to plasma heating, jets, and eruptive phenomena. Despite extensive investigations, twisted magnetic flux tubes lack a proper mathematical definition, precluding their automatic detection. This work addresses this issue by defining them as magnetic vortices and introduces a formal definition that is based on a recently developed magnetic vortex detection technique, the integrated averaged current deviation method. We applied this method and a kinetic vortex identification technique to realistic magnetoconvection simulations obtained from the MURaM code. The preferential site for these two types of vortices is the intergranular downflow, but while the magnetic vortices are found mostly in the small areas where plasma-β > 1, the rotational flow structures (the kinetic vortices), were detected in locations where plasma-β < 1. The magnetic vortices locally concentrate the magnetic field's vertical components and current, lasting, on average, around a minute. Two types of magnetic vortices are introduced based on their magnetic-to-kinetic energy ratio. For the first type, the magnetic energy prevails, and the magnetic vortices are mostly vertical. The second type of magnetic vortex presents distinct shapes and a lower magnetic-to-kinetic energy ratio. We have found that magnetic vortices may appear if two conditions are simultaneously present: (i) shear flow and (ii) plasma-β > 1. The presence of rotational motion is not necessary.