Here is a link to a website that has a JavaScript calculator for this: Arto's String Calculator. The only problem is it only works for solid (not wound) strings and you have to know the density of the string material - although he gives that for the more common materials such as nylon.