Hexadecimal (hex, hex numbers, or base-16) is a number system that uses a base of 16 as opposed to the standard decimal system, which is base 10. When representing a number, both number systems share the first ten digits, 0-9. However, for hexadecimal, the remaining digits 10-15 are represented by the letters A-F (not case sensitive)
Power Of 2
Hexadecimal, as well as binary (base 2) and octal (base 8), have bases that are powers of two, making it easy to convert between one another.
A hexadecimal number is prefixed with
0x in many computer languages to identify it as a base 16 number.
Hex numbers are often used to represent colors (hex colors) and are specified in the following way:
#RRGGBB(red, green, and blue). One example of a hex color is
#0000FF which represents the color blue. This is because red and green are set to their lowest value,
00, and blue is set to its highest value,
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.