Chile gained independence from Spain in 1818.
The independence declaration was drafted during the Chilean War of Independence and formally approved by Supreme Director Bernardo O’Higgins in February 1818. The public proclamation and oath took place on 12 February 1818, making that year the standard answer to the question.
Chile’s break with Spain was a process rather than a single event. The movement began with the formation of a governing junta in 1810, followed by the Patria Vieja, the Spanish Reconquista and the Patria Nueva. Chilean forces regained momentum after the patriot victory at the Battle of Chacabuco in 1817.
The year 1810 is therefore associated with the beginning of the independence process, not the formal declaration. The final military struggle continued after 1818, and Spain did not formally recognize Chilean independence until 1844. The dates 1821 and 1825 belong to independence milestones elsewhere in Spanish America.