Anomalous diffusion occurs in many physical and biological phenomena, when the growth of the mean squared displacement (MSD) with time has an exponent different from one. I will show that recurrent neural networks (RNN) can efficiently characterize anomalous diffusion by determining the exponent from a single short trajectory, outperforming the standard estimation based on the MSD when the available data points are limited, as is often the case in experiments. I will also present how the RNN can handle more complex tasks, for which there are no standard approaches. These consist in determining the anomalous diffusion exponent from a trajectory sampled at irregular times, and estimating the switching time and anomalous diffusion exponents of an intermittent system that switches between different kinds of anomalous diffusion. The method I will present is validated on experimental data obtained from sub-diffusive colloids trapped in speckle light fields and super-diffusive microswimmers.