The formula is dB = 20*log10(voltage ratio).
For what it's worth, a decibel is (of course) a tenth of a Bel. (The Bel in named for Alexander Graham Bell.) A Bel is the base-ten logarithm of a power ratio, so every Bel represents a ten-times increase in power. Power is proportional to voltage squared, so a Bel is the log10 of a voltage ratio squared, or twice the log10 of a voltage ratio. All very logical if you know the whole history of it, but confusing as heck if you don't.