Graphene has drawn tremendous attention as a promising candidate for electronic and optoelectronic applications owing to its extraordinary properties, such as broadband absorption and ultrahigh mobility. Nevertheless, the absence of a bandgap makes graphene unfavorable for digital electronic or photonic applications. Although patterning graphene into nanostructures with the quantum confinement effect is able to open a bandgap, devices based on these graphene nanostructures generally suffer from low carrier mobility and scattering losses. In this paper, we demonstrated that encapsulation of an atomic layer deposited high-quality HfO2 film will greatly enhance the carrier mobility and decrease the scattering losses of graphene nanoribbons, because this high-k dielectric layer weakens carrier coulombic interactions. In addition, a photodetector based on HfO2 layer capped graphene nanoribbons can cover broadband wavelengths from visible to mid-infrared at room temperature, exhibiting ∼10 times higher responsivity than the one without a HfO2 layer in the visible regime and ∼8 times higher responsivity in the mid-infrared regime. The method employed here could be potentially used as a general approach to improve the performance of graphene nanostructures for electronic and optoelectronic applications