Decimal to Hex Converter: Decimal to Hexadecimal
Convert base-10 decimal numbers to base-16 hexadecimal values.
Privacy First: 100% Client-Side Processing
Processed in your browser. Files are never uploaded.
How to Use the Decimal to Hex Converter: Decimal to Hexadecimal
- 1Enter a decimal integer into the input box.
- 2Select bit-width formatting (auto, 8-bit, 16-bit, 32-bit, or 64-bit).
- 3View uppercase and lowercase hex results with '0x' prefix.
- 4Copy the formatted hex string.
Formula & How It Works
Decimal to Hex Algorithm
Repeated division by 16 recording remainders (0-9, A-F), or BigInt.toString(16).
Worked Examples
Standard Value
Input: 255
Explanation: 255 in base 16 is FF (15*16 + 15).
Negative 32-bit
Input: -1 (32-bit)
Explanation: Two's complement representation of -1 in 32 bits.
Memory Offset
Input: 4096
Explanation: 4096 = 16^3 = 0x1000.
Frequently Asked Questions
How do you convert decimal to hex manually?▼
Divide by 16 repeatedly, recording each remainder from bottom to top (10=A, 11=B, 12=C, 13=D, 14=E, 15=F).
What is 255 in hex?▼
255 in hexadecimal is FF (or 0xFF).
What is 16 in hex?▼
16 in hexadecimal is 10 (or 0x10).
Why does hex use letters A through F?▼
Base 16 needs 16 single digits: 0-9 represent values 0-9, and A-F represent values 10-15.
Does this handle negative numbers?▼
Yes, select a bit width (e.g. 32-bit) to calculate exact two's complement hex.
Can I convert large numbers?▼
Yes, our converter uses JavaScript BigInt to handle arbitrarily large integers.
Quick Reference & Conversion Table
| Decimal | Hexadecimal | Binary (8-bit) | Octal |
|---|---|---|---|
| 0 | 0x00 | 00000000 | 0 |
| 15 | 0x0F | 00001111 | 17 |
| 16 | 0x10 | 00010000 | 20 |
| 128 | 0x80 | 10000000 | 200 |
| 255 | 0xFF | 11111111 | 377 |
⚠️ Common Pitfalls to Avoid
- •Failing to account for two's complement representation when converting negative integers.
- •Confusing little-endian and big-endian byte order in binary data streams.
💡 Practical Real-World Uses
- •Debugging memory addresses and register values in low-level C/C++ development.
- •Calculating color channel byte values for web design.
- •Writing reverse engineering assembly payloads.
Related Online Tools
Explore complementary calculators and converters with instant client-side execution
Hex to RGB Converter: Hex Color Code to RGB & HSL
Convert hexadecimal color codes to RGB, RGBA, and HSL values.
Character Counter: Count Letters, Words & Bytes Online
Count characters, words, sentences, paragraphs, and UTF-8 byte length.
HTML Formatter: Beautify & Minify HTML Code Online
Beautify, format, or minify HTML code with custom indentation.
Email Extractor: Extract Email Addresses from Text Online
Extract, deduplicate, and export email addresses from unformatted text.
Alphabetical Order Tool: Sort Lists A to Z Online
Sort lists alphabetically from A to Z or Z to A with custom sorting rules.
Invisible Character Tool: Copy Blank Unicode Spaces
Copy blank invisible characters and zero-width spaces with one click.
Explore Other Tool Categories
Browse our full collection of 50 free web utilities
Unit Converters
Exact metric & imperial conversions for weight, length, temperature & volume.
Math & Education
Percentage changes, fractions, square roots, geometry & statistics.
Date & Time
Calendar arithmetic, business day intervals, stopwatch & multi-counter.
Home & Construction
Paint coverage, pool volume, topsoil, roof pitch, square footage & materials.