# Can I convert hex to decimal using the calculator app?

How can we convert a hexadecimal value into decimal by using calculator (I know by using general formula we can do ,but is there any short key or button to do this)?

(I tried but didn't found any option )

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

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

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.

• This does not actually convert the number, but rather just displays it in the tool, making it impossible to use the number for further calculations. Commented Oct 6, 2016 at 7:09
• I managed to convert, but it is in exponential notation (while preview shows it normally): 161d64aaf4d88eaa -> 1,593540529×10¹⁸ (while 1593540528574074538 is expected as shown in preview) Commented Jun 30, 2020 at 18:30

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.

• I do not like it at all. You don't get instant representation of hex,bin values like Calculator in accepted answer. Commented Oct 2, 2016 at 4:10

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