In spite of the worldwide occurrence of domestic cats and dogs, and their close relationship with humans, the number of published papers on free-ranging cats Felis catus and dogs Canis familiaris, is small. The diet of both species was estimated in a suburban and rural environment in July 2002 and January 2003. Visual observations and scat collection of both species were accomplished along a 10 km transect line in the Campus ‘Luiz de Queiroz’, University of São Paulo, Piracicaba, south-eastern Brazil. The diet of both species was determined by analysis of sterilized, washed, dried and sorted scats. Estimated abundances of free-ranging cats and dogs in the sampled area were 81 (±4.32) and 42 (±2.96), respectively. Cats and dogs were more abundant in the suburban than in the rural environment (t=3.78, P<0.001, N=55; t=8.38, P<0.001, N=55, respectively) and cats were more abundant than dogs in the suburban environment (t=6.76, P<0.001, N=55), even though there was no significant difference between the abundance of both species in the rural environment (t=0.82, P=0.46, N=55). Invertebrates were the most commonly consumed item by both species, followed by mammals (cats: 63.24 and 20.51%; dogs: 57.05 and 25.15%, respectively). Niche breadth was 0.4892 for cats and 0.4463 for dogs. Niche overlap was almost complete (0.97108). The consumption of mammals was estimated to be between 16.76 and 25.42 kg individual−1year−1 for dogs and between 2.01 and 2.9 kg individual−1year−1 for cats. These data might be useful to establish a management program to minimize the predation pressure of free-ranging cats and dogs on wildlife.