Skip to content

Online Number Base Converter

    Convert a whole number between binary, decimal, hexadecimal and octal. Choose the input base and enter its digits in this number base converter to see all four representations.

    Number systems

    Binary, Decimal, Hex and Octal Converter

    Convert a whole number between binary, decimal, hexadecimal and octal. See all four representations together without rounding.

    Your number

    Changing base converts the number and removes extra leading zeros.

    Enter 0s and 1s; leading zeros count toward the input width.

    Unsigned values from 0 to 18,446,744,073,709,551,615 (64 bits).

    Decimal (base 10)

    —

    Enter your values to calculate.

    Leading zeros retain the input width. A hexadecimal digit represents four bits; an octal digit represents three.

    Decimal input uses enough bits for its entered digit count, up to 64 bits. Padding does not change the number.

    Binary, hex and ASCII reference
    ASCII codes 0–127; binary values are shown as eight bits.
    DecimalHexBinaryCharacterDescription
    00000000000NULNull
    10100000001SOHStart of Header
    20200000010STXStart of Text
    30300000011ETXEnd of Text
    40400000100EOTEnd of Transmission
    50500000101ENQEnquiry
    60600000110ACKAcknowledge
    70700000111BELBell
    80800001000BSBackspace
    90900001001HTHorizontal Tab
    100A00001010LFLine Feed
    110B00001011VTVertical Tab
    120C00001100FFForm Feed
    130D00001101CRCarriage Return
    140E00001110SOShift Out
    150F00001111SIShift In
    161000010000DLEData Link Escape
    171100010001DC1Device Control 1
    181200010010DC2Device Control 2
    191300010011DC3Device Control 3
    201400010100DC4Device Control 4
    211500010101NAKNegative Acknowledge
    221600010110SYNSynchronize
    231700010111ETBEnd of Transmission Block
    241800011000CANCancel
    251900011001EMEnd of Medium
    261A00011010SUBSubstitute
    271B00011011ESCEscape
    281C00011100FSFile Separator
    291D00011101GSGroup Separator
    301E00011110RSRecord Separator
    311F00011111USUnit Separator
    322000100000spaceSpace
    332100100001!Exclamation mark
    342200100010"Double quote
    352300100011#Number
    362400100100$Dollar sign
    372500100101%Percent
    382600100110&Ampersand
    392700100111'Single quote
    402800101000(Left parenthesis
    412900101001)Right parenthesis
    422A00101010*Asterisk
    432B00101011+Plus
    442C00101100,Comma
    452D00101101-Minus
    462E00101110.Period
    472F00101111/Slash
    4830001100000Zero
    4931001100011One
    5032001100102Two
    5133001100113Three
    5234001101004Four
    5335001101015Five
    5436001101106Six
    5537001101117Seven
    5638001110008Eight
    5739001110019Nine
    583A00111010:Colon
    593B00111011;Semicolon
    603C00111100<Less than
    613D00111101=Equality sign
    623E00111110>Greater than
    633F00111111?Question mark
    644001000000@At sign
    654101000001ACapital A
    664201000010BCapital B
    674301000011CCapital C
    684401000100DCapital D
    694501000101ECapital E
    704601000110FCapital F
    714701000111GCapital G
    724801001000HCapital H
    734901001001ICapital I
    744A01001010JCapital J
    754B01001011KCapital K
    764C01001100LCapital L
    774D01001101MCapital M
    784E01001110NCapital N
    794F01001111OCapital O
    805001010000PCapital P
    815101010001QCapital Q
    825201010010RCapital R
    835301010011SCapital S
    845401010100TCapital T
    855501010101UCapital U
    865601010110VCapital V
    875701010111WCapital W
    885801011000XCapital X
    895901011001YCapital Y
    905A01011010ZCapital Z
    915B01011011[Left square bracket
    925C01011100\Backslash
    935D01011101]Right square bracket
    945E01011110^Caret / circumflex
    955F01011111_Underscore
    966001100000`Grave / accent
    976101100001aSmall a
    986201100010bSmall b
    996301100011cSmall c
    1006401100100dSmall d
    1016501100101eSmall e
    1026601100110fSmall f
    1036701100111gSmall g
    1046801101000hSmall h
    1056901101001iSmall i
    1066A01101010jSmall j
    1076B01101011kSmall k
    1086C01101100lSmall l
    1096D01101101mSmall m
    1106E01101110nSmall n
    1116F01101111oSmall o
    1127001110000pSmall p
    1137101110001qSmall q
    1147201110010rSmall r
    1157301110011sSmall s
    1167401110100tSmall t
    1177501110101uSmall u
    1187601110110vSmall v
    1197701110111wSmall w
    1207801111000xSmall x
    1217901111001ySmall y
    1227A01111010zSmall z
    1237B01111011{Left curly bracket
    1247C01111100|Vertical bar
    1257D01111101}Right curly bracket
    1267E01111110~Tilde
    1277F01111111DELDelete

    For number-base conversions on your phone, Unit Converter is free to download and includes a Binary Conversion tool.

    How to use this tool

    1. Choose Input base: Binary, Decimal, Hexadecimal or Octal.
    2. Enter a Whole number using digits valid for that base, without a sign or base prefix.
    3. Click Convert to see all four representations. Changing Input base converts the existing valid number into the newly selected base.

    What is a number base?

    A number base, also called a radix, determines the digits a number system uses and how much each position is worth. Decimal is base 10: its positions represent ones, tens, hundreds and successive powers of ten. Binary follows the same principle with powers of two. A number base converter translates an integer between these systems.

    The four systems used here appear frequently in computing:

    System Base Digits
    Binary 2 0 and 1
    Decimal 10 0 through 9
    Hexadecimal 16 0 through 9, then A through F
    Octal 8 0 through 7

    In hexadecimal, A through F represent the digit values ten through fifteen. Each digit value must be smaller than the base, so a symbol valid in one system may not be a valid digit in another.

    Place value and binary to decimal conversion

    The rightmost digit of a whole number occupies position zero, with a place value of one. Each step to the left multiplies the place value by the base. The full value is the sum of the contributions from all its digits:

    Value = sum of (digit value × baseposition)

    To convert binary to decimal, each binary digit is multiplied by its power of two and the results are added. The same method works for hexadecimal and octal, using powers of sixteen or eight. A zero digit contributes nothing, but it holds a position so that the other digits keep their correct weights.

    Converting decimal to binary and other bases

    Repeated division builds the digits of a positive whole number in a new base. Divide by the destination base, keep the remainder, and repeat with the whole-number quotient. Continue until that quotient is zero. The first remainder is the rightmost digit; reading the remainders in reverse order gives the converted number.

    For decimal to binary conversion, the divisor is two, so each remainder is either zero or one. For hexadecimal or octal, the divisor is sixteen or eight. Zero itself is written as a single zero before any extra width padding is applied.

    Converting binary to hexadecimal or octal

    Binary digits, or bits, can be grouped directly into hex or octal digits. Four bits have sixteen possible combinations, exactly matching the sixteen hexadecimal digits. Three bits have eight combinations, matching the eight octal digits.

    For a whole number, binary to hexadecimal conversion groups bits in fours from the right. Octal conversion uses groups of three. If the leftmost group is short, leading zeros complete it. Reversing the process expands each hex or octal digit into its corresponding group of bits.

    This relationship makes hexadecimal useful for reading memory addresses and byte values. A byte contains eight bits, so two hexadecimal digits can represent it. Unix-style file permissions use octal numbers because each read, write and execute permission group fits into three bits.

    What leading zeros and bit width mean

    Leading zeros can align a value with a fixed-width field or a group of bytes. They do not contribute to its unsigned value. A width of w bits provides 2w possible bit patterns, representing unsigned integers from zero through 2w − 1.

    The displayed bit width here follows the input’s width: binary digits each occupy one bit, hexadecimal digits four and octal digits three. For decimal input, padding is based on the entered decimal digit count, so the displayed width can be longer than the shortest binary representation. Padding is capped at 64 bits.

    Signed formats such as two’s complement give the highest bit a different meaning so that negative numbers can be represented. This converter reads the whole bit pattern as an unsigned integer. That distinction matters when comparing a result with a signed value reported by a programming language or debugger.

    Number bases and ASCII character codes

    ASCII assigns numeric codes to 128 characters and control functions using seven bits. A character’s code can be written in decimal, binary or hexadecimal; the character meaning comes from the encoding. The expandable ASCII reference table pairs the characters and controls with their numeric representations, making it useful when reading encoded text or inspecting data.

    More tools: Browse all calculators and unit converters.

    Convert number bases on your phone

    Keep the Binary Conversion tool alongside Unit Converter’s other number tools. Download it free from the App Store or Google Play.

    Leave a Reply

    Your email address will not be published. Required fields are marked *