The ontological argument was originally written by a Benedictine monk named Anselm, the Archbishop of Canterbury, in his book Proslogion in 1078. Ontology is the branch of metaphysics that deals with the nature of being and existence. The argument is based on the greatest idea, God, must exist because it is greater to exist than to not exist.
Even Anselm's contemporaries recognized its flaws; another monk, Guanilo of Marmoutiers, is remembered for using Anselm's reasoning to "prove" that the perfect island exists in On Behalf of the Fool.
There is a lesser known ontological argument by Descartes.
The classic ontological argument for the existence of God runs as follows:
- I have an idea of God as the greatest conceivable being.
- A being can exist merely as an idea or as an idea and in reality.
- It is greater to exist in reality too rather than just as an idea.
- If I think of this greatest conceivable being as existing merely as an idea, then I can think of a greater being, i.e. a being that exists in reality too.
- This greatest conceivable being must exist in reality too, i.e. God exists.
In this argument, existence is given as one of God's attributes as part of the definition: if X is God, then X has the property of existence. This is logically equivalent to "if X does not exist, then X is not God." It does not prove that there are any entities that actually match the definition.
Existence is not an attribute or predicate
The argument treats existence as an attribute of a maximally great being. However, existence can hardly ever be considered as an attribute by philosophers, as something non-existent cannot have attributes.  Therefore, making conclusions about existence of an entity based on its properties is not logically sound. In short, this argument boils down to "show me a god, and I'll show you an existing god." It is a form of circular reasoning because the existence is built into the assumptions. The flaw was first identified by Immanuel Kant.
Here are some examples of this proof that highlight the fallacy.
- Let us define a unicorn as a magical equine being that has one horn, and that exists.
- By that definition, such a being must necessarily exist.
- Therefore unicorns exist.
- Shangri-La is the greatest place on earth.
- A place that exists is greater than one that doesn't.
- Therefore, Shangri-La exists.
- Hercules is the greatest warrior in history.
- A warrior that existed is greater than one that did not.
- Therefore, Hercules existed.
Assumption that existence is greater than non-existence
Assuming that existence and non-existence can actually be properties of something, there is no logical justification for existence being greater than non-existence. This is an unsupported assertion.
- Main Article: Which God?
No specific God or religion is supported by the argument.
- A being that contains all the parts of another plus one extra part is the greater being.
- There cannot exist any part that is not a part of the greatest possible being.
- Therefore, the greatest possible being encompasses the entire universe -- hence Pantheism.
- If 1. is false, there is no reason to believe that the greatest possible being encompasses anything -- the greatest possible being is indistinguishable from nothing.
- If 1. is false and 4. is false because the greatest possible being is the one that encompasses all intrinsically positive things and no intrinsically negative things, then "a being that exists is greater than one that does not" is not true unless existence is intrinsically good.
Affirming the consequent
The argument also contains a converse error. The second premise amounts to "If a thing exists then it has greatness," while the conclusion assumes the reverse: "If a thing (the god) has greatness then it exists."
Another problem with the classical version of the argument is that it is invalid. So even if the premises are true, the conclusion is not guaranteed to be true. The fourth premise is supposed to show that there is a contradiction in supposing the greatest conceivable being merely exists as an idea. This, at most, would show that when thinking of this being one would have to suppose this being exists. So even if there are no other problems with the argument, it only proves that I must think of God existing; it does not prove that there is a being actually out there that fits my idea.
An argument for the Devil
An ontological argument can be used to prove the existence of the Devil.
- I have an idea of the Devil as the worst conceivable being.
- A being can exist merely as an idea or as an idea and in reality.
- It is worse for the worst conceivable being to exist in reality too rather than just as an idea.
- If I think of this worst conceivable being as existing merely as an idea, then I can think of a worse being, i.e. a being that exists in reality too.
- This worst conceivable being must exist in reality too, i.e. the Devil exists.
A piece of parody for the non-existence of god is as follows: 
- The creation of the universe is the greatest achievement imaginable.
- The merit of an achievement consists of its intrinsic greatness and the ability of its creator.
- The greater the handicap to the creator, the greater the achievement (would you be more impressed by Turner painting a beautiful landscape or a blind one-armed dwarf?)
- The biggest handicap to a creator would be non-existence
- Therefore if we suppose that the universe is the creation of an existing creator, we can conceive a greater being — namely, one who created everything while not existing.
- Therefore, God does not exist.
Proof by logic
- Main Article: Proof by logic
The argument effectively defines God into existence without considering factual evidence.
The concept God is equated with the greatest conceivable being. This confuses two separate issues: "If compared to every other object, God is greater" and "the greatest thing is arbitrarily labelled God". Of course, one could argue that a "greatest object" must necessarily exist. However, the argument changes the usage of "God" to the former definition. The argument therefore commits the use-mention error. 
Can we actually conceive of this being?
This argument requires us to actually conceive of an infinite being. This is arguably beyond human capability as we are only conceiving of approximations of perfection. Also, if this conception of God has internal contradictions, then no being could distinctly conceive of it. Many religious traditions hold that God is beyond human conception. Just because we can conceive of a perfect circle, this does not imply a perfect circle exists in reality. Perhaps perfection and existence are incompatible attributes. 
Descartes' existence is a perfection argument
- "But if the mere fact that I can produce from my thought the idea of something entails that everything which I clearly and distinctly perceive to belong to that thing really does belong to it, is not this a possible basis for another argument to prove the existence of God? Certainly, the idea of God, or a supremely perfect being, is one that I find within me just as surely as the idea of any shape or number. And my understanding that it belongs to his nature that he always exists is no less clear and distinct than is the case when I prove of any shape or number that some property belongs to its nature"
- My conception of God is of a perfect being
- My conception of God includes existence since this is more perfect than non-existence.
- I cannot conceive of God not existing.
- Therefore, God exists.
This essentially is wishful thinking.
Modal ontological argument
This is a version of the argument defended by such apologists as Alvin Plantinga. The argument is as follows:
- P(1): God is defined as a being with maximal greatness, including necessary existence in all possible worlds (i.e. God is not contingent).
- P(2): It is possible that God exists.
- P(3): If it is possible that God exists, then God exists in some possible worlds.
- P(4): If God exists in some possible worlds, then God (necessarily) exists in all possible worlds.
- P(5): If God exists in all possible worlds, then God exists in the actual world.
- P(6): If God exists in the actual world, then God exists.
- C(1): Therefore, God exists.
The Modal Ontological Argument is a deductive argument, which means that in order to deny the conclusion of the argument one must show the form of the argument to be invalid, that at least one of the premises are false, or that the argument commits some other fallacy.
As a way to show the argument contains a fallacy, one could substitute something like a necessarily existing unicorn into the argument instead of God.
- P(1)': Let use define a unicorn as an equine necessarily existent being with one horn.
- P(2)': It is possible that a necessarily existent unicorn exists.
- P(3)': If it is possible that a necessarily existing unicorn exists, then a necessarily existing unicorn exists in some possible worlds.
- P(4)': If a necessarily existing unicorn exists in some possible worlds, then a necessarily existing unicorn exists in all possible worlds.
- P(5)': If a necessarily existing unicorn exists in all possible worlds, then a necessarily existing unicorn exists in the actual world.
- P(6)': If a necessarily existing unicorn exists in the actual world, then a necessarily existing unicorn exists.
- C(1)': Therefore, a necessarily existing unicorn exists.
Of course, P(2)' claiming "a necessarily existent being that possibly exists" begs the question; it builds in necessary existence into the being in question from the beginning. The same fallacy is in P(2). In the original argument the question begging is, maybe, not quite as obvious, but the necessity of the existence of God is what causes P(4) to be purportedly true.
Another way to debunk the argument could be to attempt to show that "it is possible that God exists" in P(2) is false, or its truth cannot be determined. Since the apologist has defined God with a very particular set of properties, including necessarily existing, we cannot be sure this type of entity is possible at all. The burden of proof is on the apologist and such a proof probably would make this argument redundant. No evidence has been presented that a god as defined in this argument possibly exists. Another way to argue against this premise is the argument from incompatible attributes and the related omnipotence paradox.
Another problem is the argument claims "X is possible" then follows logic to "X is so". This is not logically coherent because the possible existence of an entity cannot tell us about its actual existence. In other words, modal logic is being misapplied when used with necessarily existent beings. Only contingent things can be said to "possibly exist" and the apologist has defined God to be non-contingent.
Another way to debunk the argument would be to point out that the argument relies upon equivocation between different definitions of "possible". Modal logic (which is used in P(3), P(4), and P(5)) refers to subjunctive possibility, while P(2) refers to epistemic possibility, which is not used in modal logic.
This is also a proof by logic which cannot demonstrate anything about actual existence.
"Our verdict on these reformulated versions of St. Anselm's argument must be as follows. They cannot, perhaps, be said to prove or establish their conclusion. But since it is rational to accept their central premise, they do show that it is rational to accept that conclusion"
- — Alvin Plantinga
Also, the argument uses a definition of God that could be incorrect. Although not traditionally accepted, God could be contingent or a brute fact.
Reverse modal ontological argument
The Modal Ontological argument depends upon the innocence of the first premise. One might be inclined to accept that it is merely possible that God exists but then be surprised you've agreed to too much. Modal logic cuts both ways though. An equally innocent premise can lead to the opposite conclusion:
- P(1) It is possible that God does not exist, i.e. there is some possible world where God does not exist.
- P(2) God is defined as a necessary being, i.e. exists in all possible worlds.
- P(3) If there is one possible world where God does not exist, then there is no possible world in which God exists in all possible worlds.
- P(4) If there is no possible world in which God exists in all possible worlds, then it is impossible that God exists.
- C(1) It is impossible that God exists.
P(1) is the innocent enough premise, that God might not exist. P(2) is the definition of God borrowed from the theist. P(3) follows from S5 modal logic where all worlds are accessible to each other, so if something is possible in one world, it is possible in all worlds. Logical possibility and necessity is generally thought to be captured by S5 modal logic. It is also the simplest modal logic and most often encountered. The Modal Ontological Argument above depends upon S5 as well. P(4) is just a translation: "No possible world" means "is impossible", and "exists in all possible worlds" means "exists", at least according to P(2).
- ↑ 1.0 1.1 Stanford Encyclopaedia of Philosophy, Ontological Arguments, substantive revision Jul 15 2011 
- ↑ Gasking's Proof 
- ↑ 
- ↑ 
- ↑ 
- ↑