기본·수학

진법 변환 계산기

2진·8진·16진수를 상호 변환

진법 변환 계산기란?

진법(radix)은 숫자를 표현하는 기수 체계입니다. 일상에서 쓰는 10진법 외에 컴퓨터 분야에서 자주 쓰이는 2진법(binary)·8진법(octal)·16진법(hex)을 이 계산기로 자유롭게 상호 변환할 수 있습니다.

사용 방법

입력값과 원본 진법을 선택하고, 대상 진법을 고른 뒤 변환하기를 누릅니다. ↔ 버튼으로 원본·대상 진법을 즉시 맞바꿀 수 있으며, 결과는 2·8·10·16진법 네 가지로 동시에 표시됩니다.

공식·참고표

원본 진법 문자열을 정수로 해석(parseInt(str, from))한 뒤, 대상 진법 문자열로 다시 표현(toString(to))합니다. 16진수는 결과를 대문자로 표시합니다.

예시
2진8진10진16진
10101210A
11111111377255FF
컴퓨터가 2진수를 쓰는 이유 · 16진수 색상 코드 실례

컴퓨터 회로는 전압이 있음(켜짐)없음(꺼짐), 딱 두 가지 상태만 안정적으로 구별합니다. 만약 10가지 전압 수준으로 10진수를 직접 표현하려 하면 잡음이나 미세한 전압 변화만으로도 다른 숫자로 잘못 읽힐 위험이 커집니다. 반면 2진수는 0과 1, 단 두 상태만 구별하면 되므로 오류 확률이 훨씬 낮아 모든 디지털 회로의 기본 표현 방식이 되었습니다.

16진수는 이 2진수를 사람이 읽기 편하게 압축한 표기입니다. 2진수 4자리(0000~1111)가 정확히 16진수 한 자리(0~F)에 대응하기 때문입니다. 웹 색상 코드가 대표적인 예로, #FF0000은 빨강·초록·파랑(RGB) 채널을 각각 16진수 두 자리로 나타낸 것입니다. 이 계산기에 255를 원본 10진법에서 16진법으로 변환하면 FF가 나오는데(255 = 15×16+15), 이는 빨강 채널이 낼 수 있는 최댓값을 의미하고, 초록·파랑이 00(=0)이므로 순수한 빨간색이 됩니다.

8진수로 표기하는 리눅스 파일 권한 chmod 755

리눅스·유닉스 파일 권한은 읽기(r=4)·쓰기(w=2)·실행(x=1) 세 비트의 합으로 표현되며, 이 합이 0~7 사이의 값이 되기 때문에 8진수로 표기합니다. chmod 755에서 첫째 자리 7은 소유자 권한으로 4+2+1(rwx, 읽기·쓰기·실행 모두 허용)이고, 둘째·셋째 자리 5는 그룹·기타 사용자 권한으로 4+1(r-x, 읽기·실행만 허용, 쓰기 제외)을 뜻합니다. 이 계산기의 원본 진법을 8, 대상 진법을 10으로 두고 755를 변환하면 493이 나오는데, 이는 세 자리 각각을 8진수 한 자리로 독립적으로 다룰 때와 결과가 다르므로, 파일 권한을 해석할 때는 755의 각 숫자를 개별 8진수 자리로 읽어야 합니다.

What is the Radix Converter?

A radix (base) is a number system's counting base. Besides everyday decimal (base 10), this tool freely converts between binary, octal, and hexadecimal, which are common in computing.

How to use it

Enter a value, choose its from base, choose a to base, then press Convert. The ↔ button instantly swaps the from/to bases, and the result is shown simultaneously in base 2, 8, 10, and 16.

Formula & reference

The source string is parsed as an integer (parseInt(str, from)) and re-expressed in the target base (toString(to)). Hexadecimal results are shown in uppercase.

Examples
BinaryOctalDecimalHex
10101210A
11111111377255FF
Why computers use binary · a hex color code in practice

Computer circuits can reliably distinguish only two stable states: voltage present (on) and voltage absent (off). Trying to represent 10 decimal digits directly with 10 distinct voltage levels would make even small noise or voltage drift likely to flip a digit into the wrong reading. Binary needs to distinguish only 0 and 1, so its error rate is far lower — which is why it became the base representation for all digital circuits.

Hexadecimal is a human-friendly compression of binary, since exactly 4 binary digits (0000-1111) map to one hex digit (0-F). Web color codes are a familiar example: #FF0000 expresses the red, green, and blue (RGB) channels as two hex digits each. Converting 255 from decimal to hex in this calculator gives FF (255 = 15×16+15), which represents the maximum value the red channel can hold, while green and blue are 00 (=0) — producing pure red.

Octal notation in Linux file permissions: chmod 755

Linux/Unix file permissions are expressed as the sum of three bits — read (r=4), write (w=2), execute (x=1) — which always adds up to a value between 0 and 7, so they're written in octal. In chmod 755, the first digit, 7, is the owner's permission: 4+2+1 (rwx, read, write, and execute all allowed). The second and third digits, 5, are the group and other users' permissions: 4+1 (r-x, read and execute only, no write). Converting 755 from base 8 to base 10 in this calculator gives 493, treating it as one continuous octal number — which differs from reading each digit independently as its own 3-bit permission group, so file permissions must be interpreted digit by digit.

16진수에서 A~F는 무엇을 의미하나요?
16진법은 0~9 다음에 10~15를 표현하기 위해 알파벳 A~F를 사용합니다. A=10, B=11, C=12, D=13, E=14, F=15이며, 대소문자는 구분하지 않지만 이 계산기는 결과를 대문자로 표시합니다.
각 진법에서 사용할 수 없는 숫자를 입력하면 어떻게 되나요?
예를 들어 2진수는 0과 1만, 8진수는 0~7만 사용할 수 있습니다. 원본 진법에서 허용되지 않는 문자를 입력하면 오류로 표시되니, 선택한 진법에 맞는 문자만 입력해야 합니다.
음수도 변환할 수 있나요?
이 계산기는 앞에 마이너스(−) 기호를 붙인 음의 정수도 지원합니다. 부호를 제외한 나머지 문자는 선택한 원본 진법의 유효 문자여야 하며, 변환 결과에도 부호가 그대로 유지됩니다.
컴퓨터는 왜 하필 2진수를 쓰나요?
컴퓨터 내부 회로는 전압이 있는 상태(켜짐)와 없는 상태(꺼짐), 단 두 가지만 안정적으로 구별합니다. 10가지 상태를 구별해야 하는 10진수 회로보다 오류 확률이 훨씬 낮아, 0과 1 두 값만으로 표현하는 2진수가 전자 회로와 가장 잘 맞습니다.
16진수 색상 코드 #FF0000은 무슨 의미인가요?
웹 색상 코드는 빨강·초록·파랑(RGB) 채널을 각각 16진수 두 자리(00~FF, 10진수 0~255)로 표현합니다. #FF0000은 빨강 채널이 FF(=255, 최댓값), 초록과 파랑이 00(=0)이라는 뜻으로 순수한 빨간색을 나타냅니다.
What do A-F mean in hexadecimal?
Hexadecimal uses the letters A-F to represent 10-15 after 0-9. A=10, B=11, C=12, D=13, E=14, F=15. Case doesn't matter for input, but this tool always displays results in uppercase.
What happens if I enter an invalid digit for a base?
For example, binary only allows 0 and 1, and octal only allows 0-7. Entering a character not valid for the selected source base will show an error, so make sure your input matches the chosen base.
Can negative numbers be converted?
Yes, this tool supports negative integers prefixed with a minus (−) sign. The remaining characters must be valid for the selected source base, and the sign is preserved in the converted result.
Why do computers use binary?
Computer circuits reliably distinguish only two states: voltage present (on) and absent (off). This gives a far lower error rate than trying to distinguish 10 distinct states for decimal, which is why binary became the base representation for electronic circuits.
What does the hex color code #FF0000 mean?
Web color codes express the red, green, and blue (RGB) channels as two hex digits each (00-FF, i.e. 0-255 in decimal). #FF0000 means the red channel is FF (=255, maximum) while green and blue are 00 (=0), producing pure red.