The ontological argument is an argument for God’s existence based entirely on reason. According to this argument, there is no need to go out looking for physical evidence of God’s existence; we can work out that he exists just by thinking about it. Philosophers call such arguments a priori arguments.
There clearly are certain claims that we can tell are false without even having to look into them to find out. The claim to have made a four-sided triangle, and the claim to be over six feet tall but less than five, for example, are both claims that are obviously false. We know that triangles have three sides. We know that being over six feet tall means being over five feet tall too. No one that understands what the words in these claims mean would think that they might be true. There’s no need to spend time looking for four-sided triangles or tall short people in order to know that there aren’t any.
The ontological argument claims that the idea that God doesn’t exist is just as absurd as the idea that a four-sided triangle does. According to the ontological argument, we can tell that the claim that God doesn’t exist is false without having to look into it in any detail. Just as knowing what “triangle” means makes it obvious that a four-sided triangle is impossible, the argument suggests, knowing what “God” means makes it obvious that God’s non-existence is impossible. The claim that God does not exist is self-contradictory.

The Definition of “God” Includes Perfection
There are many things that something would have to be in order to be properly called “God”. For instance, it would have to be all-powerful, because a part of what “God” means is “all-powerful”. To call something that isn’t all-powerful God would be like calling a shape that doesn’t have three sides a triangle; to anyone who understands the words involved it just wouldn’t make sense. Another part of what “God” mean is “perfect”; something can’t properly be called God unless it is perfect. This is the key idea behind the ontological argument.

God is “That Than Which No Greater Can Be Conceived”
If something is perfect, then it couldn’t possibly be better than it is; there can’t be anything better than perfection. This means that if a thing is perfect then it is impossible to imagine it being better than it is; there is nothing better than it is to imagine.
If we think of God as being perfect—and perfection, remember, is part of the concept of God—then we must therefore think of God as a being that cannot be imagined to be better than he is. As St Anselm, the inventor of the ontological argument, put it, God is “that than which no greater can be conceived.”
It is therefore impossible to conceive either of there being anything greater than God or of it being possible to imagine God being better than he already is.

Atheists Are Therefore Confused
If we were to think of God as not existing, though, then we would be able to imagine him being better than he is; we would be able to imagine him existing, and a God that exists is clearly better than a God that doesn’t. To think of God as not existing, then, is to think of God as being imperfect, because a God that doesn’t exist could be better than he is.
The idea of an imperfect God, though, we have already said, is just as absurd as the idea of a four-sided triangle; “perfect” is part of what “God” means, just as “three-sided” is part of what “triangle” means. As the idea that God doesn’t exist implies his imperfection, therefore, the idea that God doesn’t exist is just as absurd, just as obviously false, as the idea that a four-sided triangle does. God’s non-existence is therefore impossible.

What the Ontological Argument Proves
Whether this argument is successful is controversial. There are a number of objections to the ontological argument, which many, though not all, accept as decisive. If the ontological argument is successful, then it must be the case that God, “God” meaning “perfect being”, exists.
This would establish a lot of what the monotheistic religions say about God to be true—if God is perfect then he is also omniscient, omnipotent, eternal, etc., just as the monotheistic religions say—but not all of it. It would show that there exists a God that is perfect in every way, but it would not demonstrate much about the relationship between that God and us.
The remaining arguments, in contrast, if they are successful, tell us less about what God is like but more about how he relates to us. The first of them is the first cause argument, which seeks to establish the existence of a Creator.

http://www.existence-of-god.com/ontological-argument.html