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.
Text ⇄ Hex Encoder / Decoder
Convert plain text to its hexadecimal byte representation, or decode hex bytes back to text.
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
| Character | ASCII Decimal | Hexadecimal | Binary |
|---|---|---|---|
| A | 65 | 0x41 | 01000001 |
| a | 97 | 0x61 | 01100001 |
| 0 | 48 | 0x30 | 00110000 |
| Space | 32 | 0x20 | 00100000 |
| ! | 33 | 0x21 | 00100001 |
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); // 255Python
hex_val = 0xFF # 255
hex(255) # '0xff'
int('FF', 16) # 255C / C++
int hex = 0xFF; // 255
printf("%X", 255); // FF
int val = strtol("FF", NULL, 16);Related Converters
Hex to Decimal
Full positional-notation breakdown of hex to decimal.
Hex to Binary
4-bit grouping method for hex to binary.
Decimal to Hex
Convert decimal numbers to hexadecimal.
Binary to Hex
Convert binary numbers to hexadecimal.
Binary Converter
Broad binary conversion hub.
Two's Complement Calculator
Represent negative numbers in binary or hex at a fixed bit width.
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.
Related Tools
You might also find these tools useful
Base Converter
Convert whole numbers between binary, octal, decimal, hex, and custom bases 2-36 in one hub.
Binary Converter
Convert text, UTF-8 bytes, and binary values without focusing only on readable messages.
Binary Calculator
Add, subtract, multiply, and divide binary numbers for math and computer science exercises.
Binary to Decimal
Turn base-2 numbers into decimal values for programming, networking, and study notes.
Binary to HEX
Compress long binary strings into hexadecimal groups for code, memory, and color checks.
Decimal to Binary
Convert everyday base-10 numbers into binary with clear fixed-width output.