An [a, b]-factor of a graph G is a spanning subgraph H such that a ≤ d H (v) ≤ b for each v ∈ V (G). In this paper, we provide spectral conditions for the existence of an odd [1, b]-factor in a connected graph with minimum degree δ and the existence of an [a, b]-factor in a graph, respectively. Our results generalize and improve some previous results on perfect matchings of graphs. For a = 1, we extend the result of O [30] to obtain an odd [1, b]-factor and further improve the result of Liu, Liu and Feng [27] for a = b = 1. For n ≥ 3a + b − 1, we confirm the conjecture of Cho, Hyun, O and Park [6]. We conclude some open problems in the end.