The bill was signed by Governor Jerry Brown on Sunday and will come into effect on 1 January.
State senator Ted Lieu, who sponsored the bill, said youngsters needed to be protected from the "lethally dangerous" radiation used in sunbeds.
Many states regulate the use of sunbeds, but California is the first to ban their use for most teenagers.
The US Indoor Tanning Association told the Associated Press that under 18s made up between 5% to 10% of its customers and the new law would hurt businesses.
Governor Brown's office said the bill was part of a cluster of legislation he had signed designed to "improve the health and well-being of Californians".
Continue reading the main story
If everyone knew the true dangers of tanning beds, they'd be shocked"
California state senator
Under current law in California, children under the age of 14 are already banned from using sunbeds but those aged between 15 and 17 can use them with permission from their parents.