Ferramentas Guias
developer Gratuito Sem cadastro

Conversor de unidades

Converta texto simples para binário, hexadecimal, octal ou decimal — e vice-versa — com uma análise por caractere.

Carregando ferramenta…

Sobre esta ferramenta

Digite qualquer texto e veja instantaneamente sua representação em binário (8 bits), hexadecimal, octal ou decimal (código ASCII). Alterne entre quatro abas de direção: Texto → Binário, Texto → Hex, Texto → Octal e Texto → Decimal. Uma tabela de análise caractere por caractere mostra cada letra ao lado de seu código na base selecionada. Toda a conversão é em tempo real enquanto você digita, e um botão de cópia permite capturar a saída instantaneamente.

Como usar

  1. 1 Selecione uma aba de conversão: Binário, Hexadecimal, Octal ou Decimal.
  2. 2 Digite ou cole texto na área de entrada para ver a saída codificada instantaneamente.
  3. 3 Ou cole valores codificados na área de saída para decodificar de volta para texto.
  4. 4 Use o botão Copiar para copiar o resultado, e a tabela de análise para detalhes por caractere.

How text becomes numbers

Computers store no letters — only numbers. Text is turned into numbers by a character encoding, a lookup table that assigns each character a numeric code. The capital letter H is code 72, lowercase i is 105, a space is 32. This tool reads each character's code with the browser's charCodeAt function and then expresses that code in whichever base you choose: binary (base 2), hexadecimal (base 16), octal (base 8), or plain decimal. Converting "text to binary" is really two steps: text to numbers via the character table, then numbers to binary digits.

The four bases, and why each exists

BaseDigits usedH (code 72) becomesWhy it's used
Binary (2)0–101001000How hardware actually stores data
Octal (8)0–7110Compact in older Unix systems
Decimal0–972Human-readable code points
Hexadecimal (16)0–9, A–F48Two digits per byte, compact

Hexadecimal is popular because one byte (eight bits) maps neatly to exactly two hex digits, so 48 is far easier to read and type than 01001000. Octal groups bits in threes, which suited early word sizes. Binary is the underlying truth; the others are just shorter ways of writing the same value.

Why binary outputs are padded to 8 digits

The number 72 in binary is 1001000 — only seven digits. But this tool pads every binary byte to eight digits, producing 01001000, because a byte is by definition eight bits. The leading zero carries no value mathematically, yet it keeps every character the same width so a decoder can slice the stream into clean 8-bit chunks. Hexadecimal is padded to two digits and octal to three for the same reason: fixed-width fields are unambiguous to read back. Decimal is left unpadded because its values are separated by spaces, not by position.

A worked example: encoding "Hi"

Type Hi and switch to Binary mode. The tool processes each character in turn:

  • H → code 72 → in binary 64 + 8 = 01001000
  • i → code 105 → in binary 64 + 32 + 8 + 1 = 01101001

The output is 01001000 01101001, space-separated. The character breakdown table below shows each character, its numeric code, and its encoded form side by side, so you can see exactly where each group of bits comes from. Switch the same input to hex and you get 48 69; to octal, 110 151; to decimal, 72 105.

Decoding back to text

Press the swap button to reverse direction. Now the tool reads space-separated tokens, parses each one in the chosen base with parseInt, and feeds the resulting code into String.fromCharCode to recover the character. Paste 01001000 01101001 in binary mode, swapped to decode, and you get Hi back. If a token is not valid in the current base — say you paste a 2 while in binary mode — the tool reports the offending token rather than producing silent garbage.

Common mistakes

  • Mixing up the base. The string 110 means 6 in binary, 72 in octal, and 110 in decimal. Always decode in the same base the data was encoded in. The tool's tab must match the format you are pasting.
  • Dropping the spaces. Decoding relies on whitespace to separate one character's code from the next. Pasting 0100100001101001 with no spaces leaves the decoder unable to find the byte boundaries.
  • Expecting it on big numbers. This is a character converter, not a general number-base converter. It turns text into the codes of its characters, so feeding it a single large number will encode each digit as a character, not convert the number itself.
  • Forgetting non-ASCII limits. Decoding uses fromCharCode on each token, which works cleanly for standard ASCII (codes 0–127). Characters outside the basic range can involve multi-unit encodings that a simple per-token decode does not reassemble.

Where this is useful

  • Learning how encoding works. Seeing "Hi" expand into bits demystifies what "everything is just ones and zeros" really means.
  • Puzzles and CTFs. Capture-the-flag challenges and escape-room clues frequently hide messages as binary or hex strings.
  • Quick debugging. Spotting a stray control character by inspecting the decimal codes of a short string.
  • Teaching number bases. The breakdown table is a ready-made worksheet showing the same value across four representations.

All conversion happens in your browser with built-in JavaScript functions — nothing you type is uploaded, so the tool works offline and your text stays on your device.

Perguntas frequentes

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}