Hex Converter

Hexadecimal (hex) is base 16, using digits 0-9 and letters A-F, where each digit represents exactly 4 bits. Enter a hex number below to get its decimal, binary, and octal equivalents, or use the text tool to convert plain text to hex bytes and back. For example, hex 2A₁₆ = decimal 42₁₀ = binary 101010₂ = octal 52₈.

Hex Number Converter

Convert a hexadecimal integer to decimal, binary, and octal.

Digits 0-9 and letters A-F only, without a 0x prefix. Uppercase and lowercase are both accepted.

Try an example:

Text ⇄ Hex Encoder / Decoder

Convert plain text to its hexadecimal byte representation, or decode hex bytes back to text.

Mode
Output Format
0 characters
Quick Examples

About Hexadecimal

Hexadecimal is a base-16 number system using the digits 0-9 and letters A-F (A=10 through F=15). It is widely used in computing because each hex digit maps to exactly 4 bits, making it a compact, human-readable stand-in for binary. To convert a plain decimal number straight into hex, use the Decimal to Hex Converter. To go from binary to hex directly, see Binary to Hex.

ASCII to Hex Examples

CharacterASCII DecimalHexadecimalBinary
A650x4101000001
a970x6101100001
0480x3000110000
Space320x2000100000
!330x2100100001

Common Use Cases

  • Memory addresses: RAM and pointer addresses (0x7FFF0000)
  • Web colors: CSS/HTML colors such as #FF5733
  • MAC addresses: Network hardware IDs (00:1A:2B:3C:4D:5E)
  • File signatures: Magic numbers, e.g. PNG = 89 50 4E 47
  • Hashes and keys: Cryptographic digests and keys are usually shown in hex

Hex in Programming Languages

JavaScript / TypeScript

const hex = 0xFF;        // 255
(255).toString(16);      // "ff"
parseInt("FF", 16);      // 255

Python

hex_val = 0xFF   # 255
hex(255)         # '0xff'
int('FF', 16)    # 255

C / C++

int hex = 0xFF;               // 255
printf("%X", 255);            // FF
int val = strtol("FF", NULL, 16);

Frequently Asked Questions

What formats does this hex converter support?

It converts a hexadecimal integer to decimal, binary, and octal using exact BigInt arithmetic, and separately converts plain text to its hexadecimal byte representation and back. For a step-by-step positional-notation breakdown of one conversion, see the Hex to Decimal or Hex to Binary converters.

Are hex letters case-sensitive?

No. Hexadecimal letters A-F are not case-sensitive — FF, ff, and Ff all represent the same value, 255. This tool accepts either case and displays results in uppercase.

What does the 0x prefix mean?

The 0x prefix is a programming convention (used in JavaScript, Python, C, and others) that marks the following digits as hexadecimal rather than decimal. The number converter above expects hex digits without the prefix; the text/hex tool accepts 0x as a per-byte separator when decoding.

How do hex color codes like #FF5733 work?

A 6-digit hex color splits into three byte pairs for red, green, and blue. In #FF5733, FF (255) is red, 57 (87) is green, and 33 (51) is blue.

Can this tool convert negative hex values?

Not directly. A minus sign in front of a hex number, like -A, is not how computers represent negative values — that requires a fixed bit width and a format such as two's complement. Use the Two's Complement Calculator, linked below, for signed conversions.