Hex to Decimal Converter

Convert a hexadecimal number into a decimal number or vice-versa.

advertisement

Conversion Explanation

This converter applies a simple algorithm to convert a hex number into a decimal number, and to generate a decimal number from a hex number.
A hexadecimal number is just like a decimal number, except that it uses 16 symbols instead of 10. These are: {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f}. Decimal and hexadecimal are both examples of [numeral systems].(https://en.wikipedia.org/wiki/Numeral_system)
This same algorithm is used to convert hex colours to RGB colours.

JavaScript Snippet

The JavaScript code that is used on this page is very simple. For the converting decimal to hexadecimal, the following code is used:
> var decimal = parseInt(hex, 16);
And for reversing the translation, this code is used:
> var hex = decimal.toString(16);

LingoJam © 2025 Home | Terms & Privacy