Free Tool

Hex to Decimal
Converter

Convert between hexadecimal, decimal, binary, and octal. Supports color hex codes with RGB breakdown.

How It Works

Step 01

Enter a Value

Type a hex or decimal number in either input field.

Step 02

See All Bases

Instantly view the value in hex, decimal, binary, and octal.

Step 03

Copy & Use

Copy any representation to your clipboard with one click.

Convert hex to decimal online and switch between hexadecimal, decimal, binary, and octal in a single view. ConverterUp's number base converter is a quick reference for embedded developers, low-level programmers, and students working through assembly or networking exercises. Type a value in any base and the other three update instantly, with optional support for color hex codes that also display the matching RGB triplet. Calculations run in your browser, so values never leave your machine and the tool works offline once the page is cached.

Where base conversion shows up day-to-day

Debugging is the most common case. Stack traces show memory addresses in hex (0x7ffee5b3c000), registers in hex, flags as bitmasks. Translating to decimal helps spot patterns: a register holding 0x10000000 is bit 28 set, which often matches a flag definition in the source.

Networking and protocols use hex constantly: MAC addresses (00:1A:2B:3C:4D:5E), IPv6 (2001:db8::1), protocol numbers, port flags, MTU sizes, TCP flag bits. Wireshark dumps and packet captures are essentially walls of hex; conversion is required to interpret them.

CSS and design live in hex (#2DD4BF), occasionally in decimal-RGB (rgb(45, 212, 191)). A designer handing off a color and a developer reading the same color use different bases for the same value; conversion is part of the handoff.

Embedded and assembly work touches every base: hex for opcodes and memory, binary for bit manipulation, octal for legacy Unix permissions (chmod 755 is rwxr-xr-x = 111101101 binary = 0o755 octal). Mixing the bases without fluency is a recipe for off-by-one bugs.

ToolSeo.hex-to-decimal.section1.p5

Two's complement and signed integers

Modern CPUs represent signed integers using two's complement. To negate a number, flip every bit and add 1. In 8-bit, the value 0xFF is 255 unsigned but -1 signed; 0x80 is 128 unsigned but -128 signed. This is why an 8-bit signed integer ranges from -128 to +127 (not -127 to +127): the negative range has one more value.

When converting hex to decimal, you must know the bit width and signedness of the source. 0xFFFFFFFF is 4 294 967 295 as a 32-bit unsigned int, but -1 as a 32-bit signed int. ConverterUp lets you pick the width (8, 16, 32, 64) and signed/unsigned interpretation; default is unsigned because that matches how most hex literals are written in C and Go.

The sign bit is always the most significant bit. In hex, that means the high nibble: a 32-bit hex value starting with 0x8… through 0xF… is negative when interpreted as signed. 0x7FFFFFFF is the maximum 32-bit signed int (2 147 483 647); add 1 and you wrap to 0x80000000, which is the minimum (-2 147 483 648).

When debugging integer overflow, switch to binary view to see the exact bit pattern. Overflow in two's complement is silent — the CPU does not raise an exception, the bits just wrap. A web form accepting a number into a 32-bit signed field will accept 2 billion and store 2 billion as expected; it will silently corrupt anything above ~2.1 billion.

ToolSeo.hex-to-decimal.section2.p5

IEEE-754 floats and color hex codes

Floating-point numbers in memory are not a simple base conversion of the decimal value. IEEE-754 single precision (32-bit float) splits 1 sign bit, 8 exponent bits, and 23 mantissa bits. 1.0 in IEEE-754 is 0x3F800000; 0.1 is 0x3DCCCCCD — the famously inexact representation that causes 0.1 + 0.2 !== 0.3 in JavaScript.

ConverterUp's float mode accepts a decimal float and returns its exact IEEE-754 hex representation (single and double precision), and vice versa. Useful when debugging serialized numbers in shaders, ML model weights, or binary protocols where you have a hex dump and need to know what float it represents.

Color hex codes are a different and simpler beast: 3 bytes (RGB) or 4 bytes (RGBA), each in 00-FF. #2DD4BF means R=45, G=212, B=191. The 8-digit form (#2DD4BFCC) appends alpha. Modern CSS also supports the relative-color notation, but hex remains the most compact and most universally supported.

ToolSeo.hex-to-decimal.section3.p4

ToolSeo.hex-to-decimal.section3.p5

ToolSeo.hex-to-decimal.section4.heading

ToolSeo.hex-to-decimal.section4.p1

ToolSeo.hex-to-decimal.section4.p2

ToolSeo.hex-to-decimal.section4.p3

ToolSeo.hex-to-decimal.section4.p4

ToolSeo.hex-to-decimal.section4.p5

ToolSeo.hex-to-decimal.section5.heading

ToolSeo.hex-to-decimal.section5.p1

ToolSeo.hex-to-decimal.section5.p2

ToolSeo.hex-to-decimal.section5.p3

ToolSeo.hex-to-decimal.section5.p4

ToolSeo.hex-to-decimal.section5.p5

Frequently asked questions

Does the converter handle negative numbers?

Yes. Negative decimals are converted using two's complement at 8, 16, 32, or 64 bits, which you can pick in the options. This matches how negative integers appear in C, Go, and most low-level languages.

What is the maximum value supported?

JavaScript safely handles integers up to 2^53 - 1. For larger values switch to BigInt mode, which supports arbitrary precision but rounds floating-point input to the nearest integer.

Can I convert color codes?

Yes. Enter a hex like #2E5C55 and the tool shows the matching RGB(46, 92, 85) and HSL values, plus a color preview swatch. The reverse direction also works from RGB to hex.

Are floating-point numbers supported?

Yes. Floats convert across decimal, binary scientific notation, and IEEE-754 hex representation, useful for debugging serialized numbers in network protocols or shaders.

Does the tool accept the <code>0x</code> prefix or <code>0b</code> notation?

Yes. Hex input accepts <code>0x</code>, <code>#</code>, or no prefix. Binary input accepts <code>0b</code> or no prefix. Octal accepts <code>0o</code> (modern style) or <code>0</code> (legacy C/Unix style). Whitespace, underscores, and commas inside the number are stripped — <code>0xFF_FF_FF_FF</code> works the same as <code>0xFFFFFFFF</code>.

How are bitwise operations handled?

Enable the bitwise panel to AND, OR, XOR, NOT, and shift two values across any base. The result appears in all four bases simultaneously, which makes it easy to verify flag manipulations and permission masks without leaving the page.

ToolSeo.hex-to-decimal.q7

ToolSeo.hex-to-decimal.a7

ToolSeo.hex-to-decimal.q8

ToolSeo.hex-to-decimal.a8