Decimal to Hex Converter
Hex shows up every time you touch colors, memory addresses, Unicode code points or file checksums. This converter takes a decimal integer and returns its base-16 representation instantly, in uppercase. Negative numbers come out as 64-bit two’s complement, the form compilers and debuggers use.
How to convert decimal to hex
-
1
Enter a decimal integer
Type a positive or negative whole number, up to the 64-bit range. Fractional parts are ignored, so enter only what you want converted.
-
2
Read the hex output
The uppercase hexadecimal value appears instantly. No prefix is added; the tool outputs the bare digits.
-
3
Check negative values
Negative integers come out as 64-bit two's complement, so -1 becomes FFFFFFFFFFFFFFFF, the pattern a 64-bit register stores.
-
4
Use the result
Copy the value into your code, config file or terminal, adding 0x yourself where the target language requires it.
How base-16 works
Hexadecimal uses digits 0-9 and letters A-F, where A equals 10, B equals 11, up to F equals 15. Each hex digit encodes exactly four bits, which is why hex is the natural companion to binary for programmers: one hex character replaces four binary digits with no loss.
Common conversion landmarks
| Decimal | Hex | Notes |
|---|---|---|
| 10 | A | First digit that uses a letter |
| 16 | 10 | Place value wraps after F |
| 255 | FF | Max value of one unsigned byte |
| 256 | 100 | First value that needs three digits |
| 4,095 | FFF | Max 12-bit unsigned |
| 65,535 | FFFF | Max value of two bytes |
| 16,777,215 | FFFFFF | Max RGB color value |
Negative integers and two’s complement
Negative inputs are converted to 64-bit two’s complement, the bit pattern a 64-bit register actually holds. Enter -1 and you get FFFFFFFFFFFFFFFF; -42 becomes FFFFFFFFFFFFFFD6. The tool reports the raw bit pattern, not an algebraic form such as -2A, so compare with what the system you are feeding expects.
Tips
- Color codes need 6 hex digits. A CSS hex color is three bytes (6 digits), one per RGB channel. The converter returns FF for 255; add the missing zeros yourself when you build a color such as 0000FF.
- Memory addresses use 0x. The
0xprefix signals “what follows is hex” in C, Python, JavaScript and most disassemblers. This converter does not add it; type it yourself when the target language requires it. - Case does not change the value.
0xFFand0xffare identical. This converter always outputs uppercase.
Frequently Asked Questions
The converter works with whole numbers only. A value like 3.14 is truncated to 3 before conversion. Remove the fractional part first, or use a tool that handles hex fractions.
It is a syntactic marker introduced by the C language so the parser knows the digits that follow are base 16. Without it, 10 could be base 10, 2, 8 or 16; with 0x10 it is unambiguously 16 decimal. This converter does not accept 0x input, so type the plain digits.
Negative integers are shown as 64-bit two’s complement, the pattern a 64-bit register stores. -1 becomes FFFFFFFFFFFFFFFF rather than -1, because that is the value your computer actually holds.
The number you enter is sent to the calculator each time you type so it can compute the hex value. It is not stored after you close the page and it is never shared.
Related Tools
ASCII Table Reference
Full ASCII table from 0 to 127 with decimal, hex, octal, binary, standard names and HTML numeric-reference notation, including NUL, LF and DEL.
Color Palette Generator
Generate monochromatic, analogous, complementary, triadic or tetradic color palettes from a base HEX color and export copy-ready CSS variables.
HEX Color Picker
Pick or enter a HEX colour and get RGB, HSL, approximate CMYK, relative luminance and contrast ratios against white and black.
HTML Character Reference
Searchable list of HTML entities, their named and numeric codes, and a one-click copy for special characters and symbols.
JSON Formatter
Paste JSON to pretty-print with 2 or 4 spaces, minify it to compact output, or run a quick syntax check before copying the result.
Phone Validator
Validate phone numbers by country, detect the region and type, and normalize valid numbers to E.164, international, national and RFC 3966 formats.
Tool available in other languages
- 10진수 → 16진수 변환기 [KO]
- Chuyển đổi từ thập phân sang thập lục phân [VI]
- Decimaal naar hexadecimaal converter [NL]
- 十进制到十六进制转换器 [ZH]
- Dezimal zu Hex-Konverter [DE]
- Konverter Desimal ke Heksadesimal [ID]
- Decimal till hexadecimal omvandlare [SV]
- Konwerter dziesiętny na szesnastkowy [PL]
- محول العشري إلى الست عشري [AR]
- เครื่องแปลงทศนิยมเป็นเลขฐานสิบหก [TH]
- Convertidor de Decimal a Hex [ES]
- Convertisseur Décimal en Hexadécimal [FR]
- Conversor de Decimal para Hex [PT]
- 10進数から16進数への変換ツール [JA]
- Ondalıktan On Altılığa Dönüştürücü [TR]
- Convertitore da Decimale a Esadecimale [IT]
- Конвертер из десятичной в шестнадцатеричную [RU]