We consider the problem of revenue maximization in online auctions, that is, auctions in which bids are received and dealt with one-by-one. In this note, we demonstrate that results from online learning can be usefully applied in this context, and we derive a new auction for digital goods that achieves a constant competitive ratio with respect to the best possible (offline) fixed price revenue. This substantially improves upon the best previously known competitive ratio [3] of O(exp( √ log log h)) for this problem. We apply our techniques to the related problem of online posted price mechanisms, where the auctioneer declares a price and a bidder only communicates his acceptance/rejection of the price. For this problem we obtain results that are (somewhat surprisingly) similar to the online auction problem. We are primarily concerned with auctions for a single good available in unlimited supply, often described as a digital good, though our techniques may also be useful for the case...