Конвертер между различными системами счисления
Tool guide
This converter turns a whole number from one base into another: binary, octal, decimal or hexadecimal. Type the value into the number field, choose the source base and the target base in the two dropdowns, then press convert to see the digits and copy them. The maths runs in the page itself, so nothing you type leaves the browser. Handy for reading a subnet mask or decoding a hex error code. See also: convert an IP address to decimal and back, get the hex character codes of a string, decode a run of binary back into text.
Set the «From base» dropdown to binary (2), set «To base» to decimal (10), type your string of ones and zeros into the number field and press the convert button. For instance 1101 becomes 13. Do not separate the digits with spaces, dashes or underscores — the parser expects an unbroken run of digits and will report an invalid value otherwise.
Both dropdowns offer the same four bases: binary (2), octal (8), decimal (10) and hexadecimal (16). Unusual radixes such as base 3 or base 36 are not on the list, because the options are hard-coded. Any pairing of the four is allowed though, so you can go hex to binary, octal to decimal and back again — twelve directions in total.
No. The tool works on non-negative whole numbers only. A minus sign, a decimal point or a comma will make the parser reject the input. For a fractional value, convert the integer part here and work out the fractional digits separately; for negative values in two's complement you will need a dedicated programmer's calculator.
The result is the bare digit string, for example cd rather than 0xcd. Prefixes and suffixes belong to particular languages and formats, not to the number itself: 0x in C and JavaScript, a trailing h in assembly listings, a leading # for CSS colours. Add whichever wrapper your context needs after you copy the value.
It does not. 1a2b and 1A2B are read as the same value, so you can type in whichever case is convenient. The output always comes back in lower case letters. If your coding standard or document requires upper case hex, convert the copied string yourself — this tool will not change the case for you.
The practical ceiling is JavaScript's exact integer range, roughly 9,000,000,000,000,000 or two to the power of 53. Longer inputs such as 64-bit identifiers, hashes or key fingerprints lose their low-order digits and the answer comes out wrong. Use a calculator with arbitrary-precision arithmetic for values of that size.
No. The conversion is done by a small script inside the page itself, so what you type stays in the browser tab and never reaches a server log. A pleasant side effect: once the page has loaded, it keeps converting even if your connection drops, right up until you reload it.
Before: 255, decimal (10) to binary (2)
After: 11111111 — eight set bits, one full mask octet
Before: 111101101, binary (2) to octal (8)
After: 755 — the familiar directory permission string
Before: 205, decimal (10) to hexadecimal (16)
After: cd — the byte you drop into #cd0000
Your rating and feedback help decide what to improve next.