What a board foot is
A board foot is a volume: 144 cubic inches, the same as a board 12" wide, 12" long and 1" thick. Hardwood is sold by the board foot because the boards come in random widths and lengths, and volume is the only fair way to price a stack of them.
The formula
Board feet = thickness × width × length ÷ 144
All three are in inches. For several boards the same size, multiply by how many you have.
Say you're buying an 8/4 walnut board 6" wide and 8 feet long. That's 2 × 6 × 96 ÷ 144 = 8 board feet. At $14 a board foot, it costs $112. If you'd rather keep the length in feet, divide by 12 instead: 2 × 6 × 8 ÷ 12 gives the same 8.
Nominal vs actual thickness
Rough hardwood is sold in quarters of an inch: 4/4 is 1", 5/4 is 1 1/4", 6/4 is 1 1/2" and 8/4 is 2". Those are rough sizes. Many dealers still bill surfaced boards at the rough thickness, so 4/4 planed down to 13/16" is priced as if it were 1" thick.
Softwood works the same way with nominal sizes. A 2×4 measures 1 1/2" × 3 1/2", but the yard tallies it as 2" × 4". Enter the thickness you're billed for, not what your calipers say. This calculator uses exactly what you type, with no rounding.
When to buy extra
Board feet tell you what's in the pile, not what you'll get out of it. Planing, ripping to width, cutting around knots and checks, and matching grain all turn wood into shavings and offcuts.
Most woodworkers buy 15 to 20% more than the finished parts need when the stock is already surfaced, and 25 to 30% for rough lumber or a panel where the grain has to match. Add more for figured wood, which is hard to find again once the stack is gone. A little extra now costs less than a second trip for a board that doesn't match.