단위 변환기
일반 텍스트를 이진수, 16진수, 8진수 또는 10진수로 변환하고 반대로도 변환합니다 — 문자별 분류 포함.
이 도구에 대해
텍스트를 입력하면 즉시 이진수(8비트), 16진수, 8진수 또는 10진수(ASCII 코드) 표현을 볼 수 있습니다. 네 가지 방향 탭 간에 전환하세요: 텍스트 → 이진수, 텍스트 → 16진수, 텍스트 → 8진수, 텍스트 → 10진수. 문자별 분류 표에 각 문자와 선택한 진법의 코드가 나란히 표시됩니다. 모든 변환은 입력과 동시에 실시간으로 이루어지며 복사 버튼으로 출력을 즉시 가져갈 수 있습니다.
사용 방법
- 1 변환 탭을 선택하세요: 이진수, 16진수, 8진수 또는 10진수.
- 2 입력 영역에 텍스트를 입력하거나 붙여넣으면 즉시 인코딩된 출력이 표시됩니다.
- 3 또는 출력 영역에 인코딩된 값을 붙여넣어 텍스트로 다시 디코딩하세요.
- 4 복사 버튼으로 결과를 복사하고, 분류 표로 문자별 세부 정보를 확인하세요.
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
| Base | Digits used | H (code 72) becomes | Why it's used |
|---|---|---|---|
| Binary (2) | 0–1 | 01001000 | How hardware actually stores data |
| Octal (8) | 0–7 | 110 | Compact in older Unix systems |
| Decimal | 0–9 | 72 | Human-readable code points |
| Hexadecimal (16) | 0–9, A–F | 48 | Two 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 =01001000i→ 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
110means 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
0100100001101001with 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
fromCharCodeon 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.