From the Sanskrit tradition
In Mahābhārata, the ancient epic of India, there is a discourse in which sage Brihaspati tells the king Yudhishthira the following about dharma, a philosophical understanding of values and actions that lend good order to life:
One should never do something to others that one would regard as an injury to one's own self. In brief, this is dharma. Anything else is succumbing to desire.
— Mahābhārata 13.114.8
The Mahābhārata is usually dated to the period between 400 BCE and 400 CE.
In Chapter 32 in the Book of Virtue of the Tirukkuṛaḷ (c. 1st century BCE to 5th century CE), Valluvar says:
Do not do to others what you know has hurt yourself.
— Kural 316
Why does one hurt others knowing what it is to be hurt?
— Kural 318
And from the Sefer ha-Torah:
A rule of altruistic reciprocity was stated positively in a well-known Torah verse (Hebrew: ואהבת לרעך כמוך):
You shall not take vengeance or bear a grudge against your kinsfolk. Love your neighbor as yourself: I am the LORD.
— Leviticus 19:18
Hillel the Elder (c. 110 BCE – 10 CE), used this verse as a most important message of the Torah for his teachings. Once, he was challenged by a gentile who asked to be converted under the condition that the Torah be explained to him while he stood on one foot. Hillel accepted him as a candidate for conversion to Judaism but, drawing on Leviticus 19:18, briefed the man:
What is hateful to you, do not do to your fellow: this is the whole Torah; the rest is the explanation; go and learn.
— Babylonian Talmud
"Do to no one what you yourself dislike."
— Tobit 4:15
"Recognize that your neighbor feels as you do, and keep in mind your own dislikes."
— Sirach 31:15
Two passages in the New Testament quote Jesus of Nazareth espousing the positive form of the Golden rule:
Do to others what you want them to do to you. This is the meaning of the law of Moses and the teaching of the prophets.
— Matthew 7:12
And as ye would that men should do to you, do ye also to them likewise.
— Luke 6:31
A similar passage, a parallel to the Great Commandment, is Luke 10:25.
The Golden Rule is the principle of treating others as one wants to be treated. It is a maxim that is found in most religions and cultures. It can be considered an ethic of reciprocity in some religions, although different religions treat it differently.
The maxim may appear as a positive or negative injunction governing conduct:
Treat others as you would like others to treat you (positive or directive form)
Do not treat others in ways that you would not like to be treated (negative or prohibitive form)
What you wish upon others, you wish upon yourself (empathetic or responsive form)
The idea dates at least to the early Confucian times (551–479 BCE), according to Rushworth Kidder, who identifies the concept appearing prominently in Buddhism, Christianity, Hinduism, Islam, Judaism, Taoism, Zoroastrianism, and "the rest of the world's major religions".
143 leaders of the world's major faiths endorsed the Golden Rule as part of the 1993 "Declaration Toward a Global Ethic". According to Greg M. Epstein, it is "a concept that essentially no religion misses entirely", but belief in God is not necessary to endorse it.Simon Blackburn also states that the Golden Rule can be "found in some form in almost every ethical tradition".
The Golden Rule: https://en.wikipedia.org/wiki/Golden_Rule