This from the help on Val(), implying that you can just do the conversion with one command.
BIG EDIT - this command works just as expected. In fact, it is not limited to hex, binary, octal or decimal. Try it in base 5, or whatever. Neat.
+ Code Snippeta$ ="20"
do
print(val(a$, 8))
print(val(a$, 10))
print(val(a$, 16))
print(val(a$, 5))
Sync()
loop
"