In 2007, I calculated the cost to Google to answer one query to be approximately 0.3 cents, which has probably decreased a bit since then. By my calculations Google earns about 27 cents per search/answer from the ads placed around its answers, so it can easily afford to give its answers away for free.

