Original Gravity (OG); Original Extract (OE)[edit]
The Original Gravity is the specific gravity measured before fermentation. From it the analyst can compute the Original Extract which is the mass (grams) of sugar in 100 grams of wort (°P) by use of the Plato scale. The symbol will denote OE in the formulas which follow.
--wikipedia
I have created a simple tool, and made the source code open source, that will allow you to calculate original gravity. I also created a blog post saying how I did it.
Original Gravity Tool
http://rootsdistillery.com/original_gravity.html
Original Gravity Howto Blog Post
http://rootsdistillery.wordpress.com/2014/01/30/jquery-original-gravity-tool/