Inspired by this question: Would granting every PC the choice of a feat or a cantrip be unbalancing?
Some classes get cantrips, some don't. Some races get a free cantrip (such as via the high elf's "Cantrip" racial feature or via the tiefling's "Infernal Legacy" feature), and some don't.
What would be the consequences regarding balance of giving every PC a free cantrip at level 1, regardless of their race or class? In each case, it would be restricted to a relevant spell list (e.g. druid spell list for wood elves, wizard spell list for rock gnomes, etc), where "relevant" is defined as "what arbitrarily makes sense to the DM" (i.e. what makes sense to me), which I'm not going to explore in this question (beyond the above example).
Also, for races that already get a cantrip (since some classes get an arguably less useful cantrip, such as an Aasimar who gets light), let's say that they can choose a different one from a related spell list (cleric in this case) if they wish (they don't get 2 cantrips "for free"; if they want more, they can pick a spellcasting class and get more that way). Furthermore, I don't care about if a variant human picks Magic Initiate to start with 3 cantrips, since they burned their level 1 feat to get those extra cantrips.
Although this was inspired by another question, I'm already doing something similar on a smaller scale in my home games; all elves get the "Cantrip" racial feature, not just high elves (unless they have a cantrip already, such as drow and their "Drow Magic" feature; also note that, unlike my above suggestion, I haven't been giving the option of swapping that out, so drow are stuck with dancing lights, for example), so I thought it might be worth asking this question to see what the effects of what I'm already doing are (although I can say that, because my players' elves tend to be spellcasters, and on reflection they tend to be high elves as well, so far the effects of my houserule haven't really been very noticeable to us).
Best Answer
It's only slightly more powerful than normal, but would make existing spellcasters less special.
To begin with, you're giving every character something else on top of their race, class and background abilities. This is by definition going to make them more powerful or versatile than standard, if only slightly.
How much more powerful? Not hugely. Cantrips are already available to a 1st-level party and elves already get one wizard cantrip for free, so it's not entirely beyond the range of capabilities of a 1st-level character.
In terms of effectiveness, assuming the players will naturally choose optimal spells:
All in all, this isn't massively overpowered (but beware of of other sourcebooks, which may add spells intended for a wizard that are overpowered in the hands of a fighter).
The main issue here is that you're handing out other classes' abilities, which makes spellcasters less special. A wizard at 1st level has only two 1st level spells per day and his main utility after that consists of three cantrips. If you give everyone a cantrip, you're breaking the separation of party roles and making the party's arcane spellcasters less important.