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))

Well, I don't do it often but, when I do, I just use Galculator. Why do I use Galculator? It is fast, light, and feature rich. It does everything I need it to do, these days.

If you're looking to convert then simply enter the information and then click on the appropriate button (DEC HEX OCT BIN) and it converts it for you all nice and easy like. Most of all, it's pretty small and easy to work with - I like small and simple and I also like a GUI for some things.

If you want to install it then sudo apt-get install galculator and follow the prompts.


dc(1)

Desktop Calculator, absolutely:

> dc <<< '16i FF p'
255
  • 16i is for input base16
  • p for print

PS Other useful conversions:

> dc <<< '16o 255 p'   # decimal2hex
FF
> dc <<< '2o 16i EF p' # hex2binary
11101111
> dc <<< '2o 7 p'      # decimal2binary
111

@see http://wiki.bash-hackers.org/howto/calculate-dc