Herramientas Guías
developer Gratis Sin registro

Conversor de unidades

Convierta texto sin formato a binario, hexadecimal, octal o decimal — y viceversa — con un desglose por carácter.

Cargando la herramienta…

Acerca de esta herramienta

Escriba cualquier texto y vea al instante su representación binaria (8 bits), hexadecimal, octal o decimal (código ASCII). Cambie entre cuatro pestañas de dirección: Texto → Binario, Texto → Hex, Texto → Octal y Texto → Decimal. Una tabla de desglose carácter por carácter muestra cada letra junto a su código en la base seleccionada. Toda la conversión es en tiempo real mientras escribe, y un botón de copiar le permite capturar la salida al instante.

Cómo usar

  1. 1 Seleccione una pestaña de conversión: Binario, Hexadecimal, Octal o Decimal.
  2. 2 Escriba o pegue texto en el área de entrada para ver la salida codificada al instante.
  3. 3 O pegue valores codificados en el área de salida para decodificar de vuelta a texto.
  4. 4 Use el botón Copiar para copiar el resultado y la tabla de desglose para detalles por carácter.

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.

Preguntas frecuentes

{# 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.) #}