Decimal to Hex Converter
Convert a decimal number to hexadecimal and hex back to decimal, with binary and octal shown for reference.
Conversion
Converted live as you type. Everything runs in your browser, nothing is uploaded.
Hex format
Result
How to convert decimal to hex
Choose a direction
Pick decimal to hex, or hex to decimal, to set which way the conversion runs.
Type the number
Enter a decimal integer or a hex value; a leading 0x prefix and inner spaces are accepted and cleaned up.
Read and copy
The result updates live with binary and octal shown too, and each value has its own copy button.
Why use this tool
Both directions
Decimal to hex and hex to decimal live in one place. A mode toggle switches which value you type and which one you get back.
0x prefix and case control
Add or drop the conventional 0x prefix and switch hex digits between uppercase and lowercase so the output drops straight into code.
Binary and octal for reference
Every number is also shown in binary and octal, which is handy when decoding colors, masks, memory addresses, or flag registers.
No size limit
Conversion uses arbitrary-precision integers, so there is no 32-bit or 64-bit ceiling. Numbers hundreds of digits long convert exactly, and negatives are supported.
Clear validation
A digit that is not valid for the chosen base shows an inline message instead of a wrong answer, so a typo never slips through.
Runs entirely in your browser
Everything happens on your device. Nothing you type is uploaded, logged, or stored.
About this tool
This converter turns a decimal integer into hexadecimal and reads hexadecimal back into decimal, updating the moment you type. Switch direction with the mode toggle: decimal to hex takes a base-10 number and shows its base-16 form, while hex to decimal accepts values with or without a 0x prefix and returns the plain decimal. For hex output you can add the conventional 0x prefix and choose uppercase or lowercase digits, so the result fits straight into code or documentation.
Alongside the main result, the same value is shown in binary and octal for reference, which is useful when you are decoding a color, a memory address, a permission mask, or a register full of flags. Conversion uses arbitrary-precision integers, so there is no 32-bit or 64-bit ceiling and numbers hundreds of digits long convert exactly without rounding. Whitespace inside the input is ignored and a leading minus sign is carried through to every base.
Everything is computed on your device and nothing you type is sent anywhere. To move between more than two bases at once, the number base converter shows binary, octal, decimal, and hex side by side, and to turn text into its byte values instead of a single number, try text to hex.
Frequently asked questions
- How do I convert decimal to hex?
- Keep the mode on decimal to hex, type your base-10 number, and the hexadecimal result appears instantly. You can add a 0x prefix and switch between uppercase and lowercase digits.
- Does it accept a 0x prefix on hex input?
- Yes. In hex to decimal mode you can paste values with or without a leading 0x prefix, and any spaces inside the value are ignored, so pasting straight from code works.
- Can it handle very large or negative numbers?
- Yes. Conversions use arbitrary-precision integers, so there is no 32-bit or floating-point limit and numbers with hundreds of digits stay exact. A leading minus sign is kept in every base.
- What do the binary and octal values show?
- They show the same number you entered in base 2 and base 8. They are provided for reference so you can read a value in decimal, hex, binary, and octal at a glance.
- Is my data uploaded anywhere?
- No. Everything runs in your browser; nothing is sent to a server. The numbers you type never leave your device.
Related tools
Number Base Converter
Convert a number between binary, octal, decimal, and hexadecimal, all four shown at once.
Text to Hex Converter
Convert text to hexadecimal and hex back to text, with your choice of separator, live.
RGB to Hex Converter
Enter red, green, and blue values with an optional alpha and copy the matching HEX, 8-digit HEX, and HSL, next to a live swatch.
Angle Converter
Convert an angle between degrees, radians, gradians, turns, arcminutes and arcseconds, with a degrees-minutes-seconds breakdown.
Area Converter
Convert area between metric and imperial units instantly.
Binary to Decimal Converter
Convert a binary number to its decimal value, with hexadecimal and octal readouts.