Decimal 255 to binary
You enter
- From
- 10
- To
- 2
- Number
- 255
You get
- Result
- 11111111
255 is one less than 256, so all eight binary places hold a 1. That gives eight ones in a row.
Run through the tool’s own code.
Developer tool
Choose the input and output bases, enter an integer and convert it locally.
Supports whole numbers in bases 2 through 36. Digits 0–9 and letters A–Z represent values.
About this tool
For a quick check, decimal 25 is binary 11001, octal 31 and hexadecimal 19. Convert signed whole numbers between any bases 2–36, including hexadecimal to binary; fractions and prefixes such as 0b or 0x are not accepted.
Guide
This page turns a whole number written in one base into the same number written in another base. You pick any base from 2 to 36 for the input and for the output, type your number, and press the button. Binary, octal, decimal and hexadecimal are all in the lists, and so is everything in between. It suits students learning how number systems work, programmers checking a value, and anyone who needs a quick answer without opening code. The work happens in your browser, so nothing you type is sent away. It handles whole numbers only, with an optional minus or plus sign.
255 is one less than 256, so all eight binary places hold a 1. That gives eight ones in a row.
Run through the tool’s own code.
The places are worth 16, 8, 4, 2 and 1. The ones sit on 16, 8 and 1, and 16 plus 8 plus 1 is 25.
Run through the tool’s own code.
In hex, A stands for ten. So 1A3 means 1 times 256, plus 10 times 16, plus 3, which is 419. Run it again with To base set to 2 for the binary form.
Run through the tool’s own code.
The sign is kept and put in front of the converted digits. The tool does not use a two's complement form.
Run through the tool’s own code.
In base 36, z is worth 35. So zz is 35 times 36 plus 35, which is 1295. Lower case letters are accepted.
Run through the tool’s own code.
Spaces are not valid digits, so a number grouped in bytes needs the spaces removed first.
Run through the tool’s own code.
UsefulVerse guides
Common questions
Set From base to 2 and To base to 10, type the ones and zeros without spaces, and press Convert number. The tool adds up the place values for you. For example, 11001 gives 25.
Choose 16 for the From base and 2 for the To base, then type the hex digits. Letters A to F stand for ten to fifteen. Leave out any 0x at the start, because prefixes are rejected.
Any whole base from 2 up to 36 can be used for the input and for the output. Digits 0 to 9 come first, and then letters A to Z carry on the count, up to Z for 35.
Each base has a limited set of digits. Binary only has 0 and 1, and octal stops at 7. If your number holds a character outside that set, a space, or a dot, the tool names the base and stops.
No. Only whole numbers are supported, so a value like 10.5 shows an error. If you need a fractional part, convert the whole part here and work out the fraction separately.
The number can have up to 4,096 digits, not counting a leading sign. The arithmetic uses big integers, so even very long numbers stay exact instead of being rounded the way ordinary floating point numbers are.
A leading minus sign is kept, and the rest is converted as normal. So -42 in decimal becomes -101010 in binary. The tool does not produce a two's complement bit pattern.
No. The answer is the shortest correct form, so decimal 5 shows as 101, not 00000101. Add zeros yourself when a system needs a fixed width, such as eight bits to make one byte.
Underscores are removed before converting, so 1_000 is read as 1000. Spaces are not removed, so remove them first or you will see the invalid digit message.
No. The page works out the answer inside your browser. Nothing you type is uploaded, so you can use it for private values without leaving a trace on a server.
Convert signed whole numbers between any base from 2 to 36. Digits 0–9 and letters A–Z represent values; fractions are not supported.
Decimal 25 is 11001 in binary. Select Decimal as the input base and Binary as the output base, then enter 25.
Convert signed whole numbers between any base from 2 to 36. Digits 0–9 and letters A–Z represent values; fractions and prefixes such as 0b or 0x are not accepted.