Solar activity is controlled by the magnetic field, which also causes the variability of the solar irradiance that in turn is thought to influence the climate on Earth. The magnetic field manifests itself in the form of structures of largely different sizes. This thesis concentrates on two types of the smallest known magnetic features: The first part studies the properties of umbral dots, dotlike bright features in the dark umbra of a sunspot. The obtained umbral dot properties provide a remarkable confirmation of the results of recent magneto-hydrodynamical simulations. Observations as well as simulations show that umbral dots differ from their surroundings mainly in the lowest photospheric layers, where the temperature is enhanced and the magnetic field is weakened. In addition, the interior of the umbral dots displays strong upflow velocities which are surrounded by weak downflows. This qualitative agreement further strengthens the interpretation of umbral dots as localized columns of overturning convection. The second part of the thesis investigates bright points, which are smallscale brightness enhancements in the darker intergranular lanes of the quiet Sun produced by magnetic flux concentrations. Observational data obtained by the balloon-borne solar telescope SUNRISE are used in this thesis. For the first time contrasts of bright points in the important ultraviolet spectral range are determined. A comparison of observational data with magnetohydrodynamical simulations revealed a close correspondence, but only after effects due to the limited spectral and spatial resolution were carefully included. 98% of the synthetic bright points are found to be associated with a nearly vertical kilo-Gauss field.