This quote is commonly seen on social media, and it’s a genuine scriptural quotation. It’s from verse 5 of the Dhammapada.
In Buddharakkhita’s translation this is:
Hatred is never appeased by hatred in this world. By non-hatred alone is hatred appeased. This is a law eternal.
In Thanissaro’s version this is:
Hostilities aren’t stilled through hostility, regardless.
Hostilities are stilled through non-hostility: this, an unending truth.
Narada Thera has:
Hatreds never cease through hatred in this world; through love alone they cease. This is an eternal law.
You can see that they’re all basically very similar.
In Pali this is:
Na hi verena verāni sammantīdha kudācanaṃ
Averena ca sammanti esa dhammo sanantano.
Very literally this is:
Not (na) indeed (hi) by means of hatred (verena) hatreds (verāni) appeased (sammanti) here (idha) at any time (kudācanaṃ).
By means of non-hatred (averena) and (ca — acts to connect this sentence with the one before) are they stilled (sammanti). This (esa) truth/law (dhammo) eternal (sanantano).
Our quotation uses the more conceptually positive word “love” rather than the strictly correct but conceptually negative “non-hatred,” but sometimes translators feel (quite justifiably in my opinion) to make such changes for the sake of accessibility. “Non-hatred” is of course a much broader term than “love,” and can encompass not just love and compassion, but even calm, mindfulness, and patience, which are all “non-hateful” qualities that promote inner peace.
The original translator was Eknath Easwaran, who rendered this verse as:
For hatred does not cease by hatred at any time: hatred ceases by love. This is an unalterable law.
Eknath’s initial “for” has been dropped, and “by” has twice been changed to “through” by some unknown transmitter of the quotation.