Convert binary, decimal, octal, hexadecimal, or text bytes in one place with grouped bits, signed integer view, and easy-to-check results.
Advanced options
Formatting
Signed view (two's complement)
How to use our Binary Converter Calculator
- Choose Convert from to switch between number conversion and text encoding.
- If you picked number mode, choose the Source base that matches your entry: binary, octal, decimal, or hexadecimal.
- Enter your value in Input value. You may use one leading + or - sign and one decimal point for fractions such as 1101.1.
- If you picked text mode, enter characters in Text input and choose Text encoding as UTF-8 or ASCII.
- Open Advanced options if you want to change Fraction output limit (digits), set Binary group size, or turn on Signed integer view with a chosen Bit width for signed view.
- Click Calculate to see Binary value, Octal value, Decimal value, Hexadecimal value, and any byte or character results that apply.
- Use Notes to check whether a fraction was shortened, whether zeros were padded for signed view, or whether a text character could not be encoded.
- Sanity-check the output: 1 hex digit should match 4 binary bits, 1 octal digit should match 3 binary bits, and plain English text in UTF-8 should usually have the same Byte count as the number of characters.
Definitions
Convert from: The mode selector. Choose number conversion for base changes or text mode to turn characters into bytes.
Source base: The number system your Input value uses. Binary is base 2, octal is base 8, decimal is base 10, and hexadecimal is base 16.
Input value: The number you want to convert. In number mode it can include one leading sign and one decimal point.
Text input: The characters you want to encode into bytes.
Text encoding: The rule used to turn text into bytes. ASCII covers code points 0 to 127, while UTF-8 can use 1 to 4 bytes per code point.
Binary group size: A display option that adds spaces every 4 or 8 bits so the bit pattern is easier to check.
Signed decimal view: A second interpretation of a whole-number bit pattern using two's complement at the selected width. It can be negative even when Decimal value is positive.
Byte count: How many bytes the text encoding used, or how many full bytes the shown binary pattern represents when that output is byte-aligned.
Character preview: A text reading of whole bytes when the bytes map cleanly to the chosen encoding. Non-printable bytes should be shown clearly instead of hidden.
Notes: Extra messages that explain truncation, repeating fractions, padding, or encoding problems.
Common mistakes and quick fixes
Mistake: Choosing the wrong Source base for the number you typed in Input value .
Fix: Match the base to the digits you entered. For example, 2D belongs in hexadecimal, not binary or octal.
Mistake: Typing invalid digits into Input value , such as 2 in binary or G in hexadecimal.
Fix: Use only digits allowed by the selected Source base . Binary uses 0 and 1, octal uses 0 to 7, decimal uses 0 to 9, and hexadecimal uses 0 to 9 plus A to F.
Mistake: Turning on Signed integer view for a fractional Input value like 101.1.
Fix: Signed two's complement works only for whole-number bit patterns. Remove the decimal point or turn Signed integer view off.
Mistake: Setting Bit width for signed view smaller than the entered whole-number pattern.
Fix: Pick a width large enough for all bits in the value, such as 16 bits instead of 8 bits, so the calculator does not have to cut bits off.
Mistake: Expecting every character in Text input to work with Text encoding set to ASCII.
Fix: ASCII only supports code points 0 to 127. Switch Text encoding to UTF-8 if your text includes symbols, accented letters, or many non-English characters.
Mistake: Reading spaces in Binary value as extra bits.
Fix: Spaces from Binary group size are only visual grouping. Ignore the spaces when comparing the actual bit pattern or counting the numeric value.
Limitations & Key Assumptions / Boundary Conditions
- Signed interpretation only applies to whole-number inputs. Fractional values do not have a signed two's complement view here.
- If a fraction does not end exactly in the target base, the result stops at the chosen Fraction output limit (digits) and Notes should explain that it was shortened.
- Signed integer view depends on the selected Bit width for signed view. The same bit pattern can mean different signed values at different widths.
- If signed view is on and the entered whole-number pattern is longer than the chosen width, the calculator should show an error instead of cutting bits off.
- In number mode, Character preview only works when the value maps cleanly to full bytes in the chosen encoding. Otherwise it should show N/A.
- ASCII text mode supports only code points 0 to 127. Characters outside that range require UTF-8.
- Grouped spaces in binary output are for readability only and do not change the value.
- Very long repeating fractions may be displayed as truncated results rather than exact infinite expansions.
Methodology
How the conversion works
The calculator first validates the entry against the chosen base, then converts the source value into a numeric form, and finally rebuilds that value in the other bases.
value = sum(d_i * b^i)
For a whole number, each digit has a place value. The rightmost digit is multiplied by base^0, the next by base^1, and so on.
value = integer_part + sum(d_j * b^(-j))
For a fraction, digits after the point use negative powers of the base. That is why binary 0.1 equals one-half in decimal.
Building the target-base fraction
When the target base needs digits after the point, the fractional part is generated step by step.
next_digit = floor(frac * t)
frac = frac * t - next_digit
This repeats until the fraction ends exactly or the selected digit limit is reached. If it does not end, the result is shown as shortened in Notes.
Signed integer view
If Signed integer view is on, the calculator reads the whole-number bit pattern as two's complement using the selected width.
signed = unsigned - 2^n, if unsigned >= 2^(n-1); otherwise signed = unsigned
If the entered pattern is shorter than the chosen width, zeros are added on the left before interpretation. If it is longer, that width is invalid and should trigger an error.
Text to bytes
In text mode, the calculator encodes the characters into bytes using ASCII or UTF-8, then shows those bytes in binary, decimal, and hexadecimal forms. ASCII uses code points 0 to 127, and modern UTF-8 uses 1 to 4 bytes per code point.
Mini examples
Example 1:
binary 101101 equals decimal 45 because 1*32 + 0*16 + 1*8 + 1*4 + 0*2 + 1*1 = 45. That same value is octal 55 and hexadecimal 2D.
Example 2:
binary 1101.1 equals decimal 13.5. The integer part 1101 is 13, and the fractional part .1 in base 2 equals 1 * 2^-1 = 0.5.
Example 3: with Signed integer view on and width 8 bits, binary 11111111 has unsigned Decimal value 255 but Signed decimal view -1.
Practical assumptions
This tool assumes the selected base is correct, treats grouping spaces as visual only, and does not claim an exact infinite expansion when a fraction repeats forever. Text preview is only shown when the bytes map cleanly to the chosen encoding.
Sources
- Binary and Hexadecimal (why hex is compact for bytes; conversions) - Bytellect (PDF) - Bytellect
- Base Converter - Binary, Octal, Decimal, Hex Tool - Codeshack
- Hex Converter & Translator - Convert Hexadecimal to Decimal, Binary, Octal & Text - Hexconvert
- HexConvert - Hex, Decimal, Octal & Binary Converter - Hexconvert