Pular para o conteúdo principal

bin2hex

Converta dados binários para strings hexadecimais e hex de volta para binário no nível de byte — como bin2hex() e hex2bin() do PHP.

Input
0 chars | 0 bytes
Encode
Output
0 chars | 0 bytes

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.

Como usar bin2hex online

  1. 1

    Cole entrada hexadecimal ou binária

    Cole uma string hexadecimal para ver a representação de bytes binários, ou cole bytes codificados em hex para visualizar como um dump hexadecimal formatado.

  2. 2

    Inspecione dados no nível de byte

    Cada byte é mostrado como dois dígitos hexadecimais. A ferramenta avisa automaticamente se um número ímpar de caracteres hexadecimais for inserido e preenche com um zero à esquerda.

  3. 3

    Copie o resultado

    Copie a saída hexadecimal ou binária para uso em código, depuração de protocolo ou desafios 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 que usar o FileCrank bin2hex?

  • ✓ Conversão hexadecimal no nível de byte correspondendo ao comportamento de bin2hex() / hex2bin() do PHP.
  • ✓ Avisa e corrige automaticamente entradas hexadecimais de comprimento ímpar.
  • ✓ Útil para payloads de protocolo, saída criptográfica e desafios CTF.
  • ✓ Funciona inteiramente no seu navegador — nenhum dado é enviado a qualquer servidor.

Recursos e Especificações

Tamanho máx. do arquivo
Até 100 MB
Privacidade
Arquivos excluídos após cerca de uma hora
Preço
Grátis, sem cadastro
Processamento
100% no cliente
Seus dados nunca saem do seu navegador — todo o processamento é local.Nenhuma conta ou cadastro necessário.Gratuito sem limites de uso.

Perguntas frequentes

Qual a diferença entre bin2hex e o conversor hexadecimal?

O conversor hexadecimal converte strings de texto legíveis de e para hexadecimal. bin2hex converte dados de bytes brutos — payloads de protocolo binário, bytes de arquivo, saída criptográfica — que podem não formar texto válido. Use bin2hex para inspeção no nível de byte.

O que a função bin2hex() do PHP faz e posso replicá-la aqui?

A função bin2hex() do PHP pega uma string binária e retorna uma string hexadecimal onde cada byte é representado como dois dígitos hexadecimais. Essa ferramenta replica esse comportamento. A string 'A' (ASCII 65 = 0x41) codifica para 41.

Por que inserir um número ímpar de caracteres hexadecimais gera um aviso?

A codificação hexadecimal sempre representa bytes completos — cada byte tem exatamente dois caracteres hexadecimais. Um número ímpar significa que o primeiro byte está incompleto. A ferramenta preenche com um 0 à esquerda e mostra um aviso.

Essa ferramenta é útil para desafios CTF?

Sim. Muitos desafios CTF envolvem dumps hexadecimais, payloads binários e camadas de codificação. Essa ferramenta trata conversão hexadecimal no nível de byte rapidamente no navegador sem precisar de ferramentas locais.

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.

O FileCrank bin2hex converte entre dados binários e strings hexadecimais no nível de byte, replicando as funções bin2hex() e hex2bin() do PHP, inteiramente no seu navegador.

Advertisement

Ad