Decimal to Hex Converter
Turn decimal integers into hexadecimal, with byte grouping, a 0x prefix and fixed-width two’s complement for negative values.
Processed locally in your browser· Your data stays in your browser.
What is Decimal to Hex Converter?
Hexadecimal uses sixteen digits (0-9 and A-F) and packs four bits into each character, which makes it the everyday notation for memory addresses, colours, byte values and hashes. Decimal 255 is FF and 4096 is 1000.
This converter handles integers of any size exactly. For negative numbers you can keep a minus sign or choose two’s complement at 8, 16, 32 or 64 bits, so −1 becomes FF, FFFF, FFFFFFFF or FFFFFFFFFFFFFFFF. Options add a 0x prefix, group digits by bytes or words, change letter case and pad to whole bytes.
How does it work?
- Paste one decimal integer per line.
- Choose how negative numbers are shown: minus sign or two’s complement width.
- Set the 0x prefix, uppercase, digit grouping and padding to 1, 2, 4 or 8 bytes.
- Copy the result; a single number also shows binary, octal and the byte count.
Common use cases
- Converting decimal port, error or status codes to the hex values in documentation.
- Writing colour channel values or offsets as hex literals in code and CSS.
- Showing the hex bytes of a negative int32 as it is stored in memory.
- Padding IDs or counters to fixed-width hex fields.
Examples
Try this input in the tool above:
255 4096 -1
FF 1000 -1
Privacy
Decimal to Hex Converter runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.
Limitations
Two’s complement modes require the number to fit the chosen width (−2^(N−1) up to 2^N−1). Fractions are not supported here; use the Base Converter for those.
Frequently asked questions
What is −1 in hexadecimal?
It depends on the width: FF in 8 bits, FFFF in 16, FFFFFFFF in 32. With a plain minus sign it is simply −1. Choose the two’s complement width you need.
How do I get 0x prefixes and uppercase?
Enable “Add 0x prefix” and “Uppercase A–F”. Both apply to every line of output.
Can I convert a huge number?
Yes. Any integer size converts exactly, for example 2^128 is 1 followed by 32 zeros in hex.
Related tools
Hex to Decimal Converter
Read hexadecimal values as decimal numbers, unsigned or as signed two’s complement integers of 8 to 64 bits.
Developer Tools
Decimal to Binary Converter
Turn decimal integers into binary, including negative numbers as two’s complement at the bit width you need.
Developer Tools
Binary to Hex Converter
Turn bit patterns into hexadecimal digit by digit, keeping every leading zero so the width of the value is preserved.
Developer Tools
Base Converter (Base 2 to 36)
Type a number, pick its base and the base you want, and get an exact result with a quick view in binary, octal, decimal, hexadecimal and base 36.
Developer Tools
Text to Hex Converter
See the exact bytes behind any text, from a quick "Hello" to emoji, formatted the way your code or debugger expects.
Encoding & Decoding
Hex to Binary Converter
Expand hexadecimal values into their exact bit patterns, four bits per digit, with optional grouping and padding.
Developer Tools
Decimal to IP Converter
Turn a decimal, 0x hexadecimal or 0b binary integer into the IPv4 or IPv6 address it represents.
Network Tools