bin2hex
Convierte datos binarios a cadenas hexadecimales y hexadecimal de vuelta a binario a nivel de byte — como las funciones bin2hex() y hex2bin() de PHP.
The `bin2hex` operation — converting raw binary bytes to their hexadecimal string representation — is a fundamental operation in systems programming, cryptography, and network protocol work. It is how you print a byte array in a debugger, how you display a cryptographic hash, and how you serialise binary data for storage in a text field or transmission in a JSON payload.
This tool converts binary data (entered as raw text, where each character is treated as its byte value) to a hex string, and reverses the process to convert a hex string back to binary. It operates at the byte level, making it the right tool for working with file signatures, hash values, binary protocol fields, and any situation where you need to inspect or construct the exact byte-level content of a value.
Cómo usar bin2hex online
- 1
Pega entrada hex o binaria
Pega una cadena hex para ver la representación binaria de bytes, o pega bytes codificados en hex para verlos como un volcado hex formateado.
- 2
Inspecciona datos a nivel de byte
Cada byte se muestra como dos dígitos hexadecimales. La herramienta avisa automáticamente si se introduce un número impar de caracteres hex y rellena con un cero a la izquierda.
- 3
Copia el resultado
Copia la salida hex o binaria para usar en código, depuración de protocolos o desafíos CTF.
How bin2hex Conversion Works
At the byte level, bin2hex is straightforward: each input byte is formatted as exactly two hex digits, zero-padded on the left if necessary, and the results are concatenated. The byte value 0 becomes `00`, 10 becomes `0a`, and 255 becomes `ff`. The output length is always exactly twice the input length in bytes — a predictable property that makes hex strings easy to work with programmatically: you can always extract byte N from a hex string by taking characters at positions `2N` and `2N+1`.
The reverse operation (hex-to-binary) splits the hex string into two-character groups, parses each as a base-16 integer, and emits the corresponding byte. Error handling is important: an odd-length hex string, a character outside `0-9a-fA-F`, or a value above `0xFF` in a group all indicate malformed input that must be rejected rather than silently truncated.
¿Por qué usar bin2hex de FileCrank?
- ✓ Conversión hex a nivel de byte que coincide con el comportamiento de PHP bin2hex() / hex2bin().
- ✓ Avisa y corrige automáticamente la entrada hex de longitud impar.
- ✓ Útil para cargas útiles de protocolo, salida criptográfica y desafíos CTF.
- ✓ Funciona completamente en tu navegador, sin enviar datos a ningún servidor.
Características y Especificaciones
Preguntas frecuentes
¿Cuál es la diferencia entre bin2hex y el conversor hex?
El conversor hex convierte cadenas de texto legibles por humanos hacia y desde hex. bin2hex convierte datos de bytes crudos — cargas útiles de protocolo binario, bytes de archivo, salida criptográfica — que pueden no formar texto válido. Usa bin2hex para inspección a nivel de byte.
¿Qué hace la función bin2hex() de PHP y puedo replicarla aquí?
La función bin2hex() de PHP toma una cadena binaria y devuelve una cadena hexadecimal donde cada byte se representa como dos dígitos hexadecimales. Esta herramienta replica ese comportamiento. La cadena 'A' (ASCII 65 = 0x41) se codifica como 41.
¿Por qué ingresar un número impar de caracteres hex provoca una advertencia?
La codificación hex siempre representa bytes completos — cada byte es exactamente dos caracteres hex. Un número impar significa que el primer byte está incompleto. La herramienta rellena con un 0 a la izquierda y muestra una advertencia.
¿Es esta herramienta útil para desafíos CTF?
Sí. Muchos desafíos CTF involucran volcados hex, cargas útiles binarias y capas de codificación. Esta herramienta maneja la conversión hex a nivel de byte rápidamente en el navegador sin necesidad de herramientas locales.
bin2hex vs. xxd vs. Python binascii
Python's `binascii.hexlify()` and `bytes.hex()` are the idiomatic in-code solution but require a script or REPL. The `xxd` command produces a formatted hex dump with address offsets and ASCII representation in columns — excellent for file inspection but verbose for extracting a single hex value. A browser-based bin2hex tool is the fastest option when you have a short binary string or hash value and need its hex form (or vice versa) right now, without writing code or opening a terminal.
Herramientas relacionadas
Convertidor Hexadecimal
Convierte cadenas hexadecimales a texto, decimal y binario — o codifica texto a hexadecimal — en tu navegador.
Codificar / Decodificar Base64
Codifica texto o datos binarios a Base64 y decodifica cadenas Base64 a texto plano, al instante en tu navegador.
Convertidor ASCII
Busca códigos ASCII por carácter, decimal, hexadecimal, binario u octal — ve todas las representaciones a la vez.
bin2hex de FileCrank convierte entre datos binarios y cadenas hexadecimales a nivel de byte, replicando las funciones bin2hex() y hex2bin() de PHP, completamente en tu navegador.
Advertisement