Can I convert hex to decimal using the calculator app?

You can use Ubuntu's default calculator in programming mode.

Open the dash and search for Calculator, then select : Mode > Programming Mode.

screenshot

Enter the value to convert, then press equal =. The entered value will get bolded. Then you may select the target Base from the drop-box to have the value converted.


And if you want something you can do from the command line, you can use trusty old bc

echo "obase=16; 255" | bc

produces FF


When I need to convert to hex from command line, I do this:

printf  "%x\n" 255

and when I need to convert from hex, it get simpler:

echo $((0xff))

Tags:

Calculator