Freemasonry as we know it today, has been in existence since the early eighteenth century, when four Masonic lodges in London united to form a Grand Lodge to charter new groups and coordinate their activities.
The system practiced by those lodges is called Speculative Masonry as opposed to Operative Masonry, the craft of stonemasons. Freemasonry combines concepts from the building trade with a myth based on King Solomon's building of the holy temple in Jerusalem. It is thus a “system of morality, veiled in allegory and illustrated by symbols.” Freemasonry is not a religion but includes persons of all religious traditions, as well as those who have no religious affiliation.
Freemasonry looks farther back, however, through the Rosicrucians of the Renaissance, the guilds of cathedral builders in the Middle Ages, along with the Troubadours, Albigensians, and Templars, to the ancient Mysteries of Orpheus, Isis, and Eleusis. It has symbolic links with other similar initiatory orders throughout human history, being the chief modern form of the ancient Mysteries.
In its outer form, Freemasonry is an organization of persons for study, for charitable and social cooperation and betterment, and for mutual support. In its inner form, however, it seeks, through the working of ancient rituals, to develop and integrate the individual Freemason in a balanced way, to bring about an inner realization of the link we each have with the Life force of the universe, to form a working unit for the evolution of humanity as a whole, and generally to serve the well being of the planet and our fellows.
Freemasonry has no doctrine.
It is a system of symbols with implications for a way of living that leads to self-improvement through service to the world. As such, it is compatible with a variety of worldviews and religious or philosophical traditions, without being itself limited to any one of them.