Independent sets play a key role into the study of graphs and important problems arising in graph theory reduce to them. We define the monomial ideal of independent sets associated to a finite simple graph and describe its homological and algebraic invariants in terms of the combinatorics of the graph. We compute the minimal primary decomposition and characterize the Cohen--Macaulay ideals. Moreover, we provide a formula for computing the Betti numbers, which depends only on the coefficients of the independence polynomial of the graph.