Police said they are trying to determine if Thursday night's shootings in the neighboring suburbs of Osasco and Barueri, on the western outskirts of Sao Paulo, are related.
The mayor of Osasco, Jorge Lapas, told the Globo TV network the killings may have been in reprisal for the recent shooting deaths of two police officers.
At least 10 of the dead were shot at a bar after hooded men got out of a car and opened fire.
Other shootings took place at five other locales.
Witnesses told the Folha de S.Paulo newspaper that in at least two instances the gunmen arrived and asked who had criminal histories. Those who said they did were shot.