Calculadora Hexadecimal
Convierte entre hexadecimal, decimal y binario
Hex Calculator
Convert between decimal and hexadecimal
Enter a decimal integer
Divide by 16 repeatedlyWhat is a Hex Calculator?
A Hex Calculator is a tool for working with hexadecimal numbers (also called hex), which use base 16 instead of base 10. Hexadecimal uses sixteen symbols: 0–9 and A–F, where A = 10, B = 11, C = 12, D = 13, E = 14, and F = 15.
Hex is widely used in computing because it's a compact way to represent binary data. Since 1 hex digit equals 4 binary bits, long binary values can be written much shorter in hex. For example: binary 1111 = hex F, and binary 10101100 = hex AC.
This Calculator Supports Multiple Conversions
- Decimal → Hexadecimal -- convert base-10 numbers to base-16
- Decimal → Binary -- convert base-10 numbers to base-2
Hex calculators are useful for converting between hex, decimal, and binary, working with colors in web design (e.g., #FF0000 for red), and understanding memory addresses, machine code, and other low-level computing concepts.
How to Use This Hex Calculator
- Enter a decimal number -- type any integer into the input field (e.g., 255)
- Click "Calculate" -- to convert the number
- Review both outputs -- the result shows the hexadecimal (base 16) and binary (base 2) representations simultaneously
- Try other values -- explore common values like 16, 128, 255, 256, or any decimal you need to convert
Tips:
- Hex values often appear with a prefix like 0x (example: 0xFF). This calculator displays the raw hex digits without a prefix.
- Hex uses only 0–9 and A–F. If you see an error, check for invalid characters.
- Leading zeros (like 00FF) don't change the value, but can be useful when you want a fixed byte length.
Hex Formulas
Hex Place Value (Base 16)
Hex works like decimal place value, but with powers of 16:
value = Σ dᵢ × 16ⁱ (i = 0 to k)
Where each digit dᵢ can be 0–15 (0–9 or A–F)
Example: 1A₁₆ = 1×16¹ + 10×16⁰ = 16 + 10 = 26₁₀
Converting Decimal to Hex
Repeatedly divide by 16 and record remainders:
- Divide the number by 16
- Record the remainder (0–15, using A–F for 10–15)
- Divide the quotient by 16 and repeat until the quotient is 0
- Read the remainders from bottom to top
Hex to Binary Conversion Table
Each hex digit maps directly to a 4-bit binary group:
0
0000
1
0001
2
0010
3
0011
4
0100
5
0101
6
0110
7
0111
8
1000
9
1001
A
1010
B
1011
C
1100
D
1101
E
1110
F
1111
Hex Addition (Concept)
Hex addition follows the same idea as decimal addition, but carries happen at 16 instead of 10. If a digit sum is 16 or more, write the remainder and carry 1 to the next place.
Example Calculations
Example 1: Convert Hex to Decimal
Convert: 1A₁₆ to decimal
Calculation: 1×16 + 10 = 26
Result: 1A₁₆ = 26₁₀
Example 2: Convert Hex to Binary
Convert: 2F₁₆ to binary
Steps:
- 2 = 0010
- F = 1111
Result: 2F₁₆ = 00101111₂
Example 3: Convert Decimal to Hex
Convert: 255₁₀ to hex
Steps:
- 255 ÷ 16 = 15 remainder 15
- 15 in hex = F, remainder 15 = F
Result: 255₁₀ = FF₁₆
Example 4: Hex Addition
Add: A5₁₆ + 1C₁₆
Verify via decimal:
- A5₁₆ = 10×16 + 5 = 165
- 1C₁₆ = 1×16 + 12 = 28
- 165 + 28 = 193
- 193 ÷ 16 = 12 remainder 1 → C1
Result: A5₁₆ + 1C₁₆ = C1₁₆
Frequently Asked Questions
Why is hexadecimal used in computing?
Hex is a compact way to represent binary. Since 1 hex digit equals 4 bits, it's much easier to read and write than long binary strings, especially for memory addresses and machine data.
What do the letters A–F mean in hex?
They represent values 10 through 15: A = 10, B = 11, C = 12, D = 13, E = 14, F = 15.
What's the difference between hex and binary?
Binary is base 2 (0 and 1). Hex is base 16 (0–9 and A–F). Hex is often used as a shorthand for binary because it compresses 4 bits into 1 character.
What does "0x" mean in front of a number?
"0x" is a common prefix used in programming to indicate a hexadecimal number. For example, 0xFF means FF in hex (255 in decimal).
Why do hex values appear in colors like #FF0000?
In web design, colors are commonly represented as three hex pairs for Red, Green, and Blue (RGB). Each pair ranges from 00 to FF (0 to 255 in decimal). For example, #FF0000 is full red, no green, no blue.
Want to add this hex calculator to your website? Get a custom embed code that matches your site's design and keeps visitors engaged.
¿Qué es el sistema hexadecimal?
El sistema hexadecimal (base 16) usa los dígitos 0–9 y las letras A–F, donde A=10, B=11, C=12, D=13, E=14 y F=15. Es compacto por diseño: un solo dígito hex representa exactamente 4 bits binarios, lo que lo hace ideal para expresar datos binarios de forma legible para los humanos. Lo encontrarás en programación, direcciones de memoria, código máquina y en cualquier lugar donde valores binarios grandes necesiten mantenerse legibles sin ocupar demasiado espacio.
Esta calculadora convierte entre hex, decimal y binario al instante, y también realiza aritmética hexadecimal como suma y resta. Es una herramienta esencial para diseñadores web que trabajan con códigos de color #RRGGBB, programadores que depuran direcciones de memoria o valores de registros, y cualquier persona que realice operaciones a nivel de bits. Ya sea que estés leyendo un volcado de registros de CPU o eligiendo el color de fondo de un sitio web, el hexadecimal es el lenguaje que necesitas.
Cómo usar la calculadora hexadecimal
- Ingresa un número hexadecimal usando dígitos 0–9 y letras A–F, o un número decimal para convertir desde base 10.
- Selecciona la dirección de conversión: hex a decimal, decimal a hex, o hex a binario.
- Haz clic en Calcular para procesar la conversión o la aritmética.
- Lee las tres representaciones en base lado a lado: hexadecimal, decimal y binario.
Fórmulas de conversión hexadecimal
Hex a Decimal: multiplica cada dígito por 16^posición
1A3₁₆ = 1×16² + 10×16¹ + 3×16⁰ = 256 + 160 + 3 = 419
Decimal a Hex: divide entre 16, recoge los restos
255 ÷ 16 = 15 resto 15 (F), entonces 255₁₀ = FF₁₆
Dígitos hex: 0-9 = 0-9, A=10, B=11, C=12, D=13, E=14, F=15
Códigos de color: #RRGGBB — dos dígitos hex para Rojo, Verde, Azul (0-255)Cada dígito hexadecimal corresponde exactamente a 4 bits binarios (un "nibble"). Dos dígitos hex forman un byte, que va de 00 a FF — es decir, de 0 a 255 en decimal. Por eso cada canal de color en #RRGGBB va de 00 (0) a FF (255).
Ejemplos resueltos
FF₁₆ = 255₁₀ — El valor máximo de un byte
FF en hexadecimal es el mayor valor que cabe en un solo byte (8 bits). En color RGB, FF significa intensidad máxima, por lo que #FFFFFF es blanco puro (los tres canales al máximo) y #000000 es negro puro (todos los canales en 0).
Decodificando un código de color hex: #1A2B3C
Se divide en tres pares: R = 1A₁₆ = 26₁₀, G = 2B₁₆ = 43₁₀, B = 3C₁₆ = 60₁₀. Entonces #1A2B3C es un azul-gris oscuro con rojo=26, verde=43, azul=60. Así es exactamente como funcionan los selectores de color CSS por debajo.
1000₁₀ = 3E8₁₆
Para convertir 1000 a hex: 1000 ÷ 16 = 62 resto 8, luego 62 ÷ 16 = 3 resto 14 (E), luego 3 ÷ 16 = 0 resto 3. Leyendo los restos de abajo hacia arriba: 3E8. Así, mil en decimal es 3E8 en hexadecimal.