What does a number base converter do?
A number base converter rewrites the same quantity using a different counting system. The value does not change — only the notation does. Decimal 255, hexadecimal FF and binary 11111111 are three ways of writing one number, and each is convenient in a different place: decimal for people, hexadecimal for bytes, binary when the individual bits matter.
A base is simply how many distinct digits you count with before carrying to the next place. Base ten has ten digits and was chosen because people have ten fingers. Base two has two, because a switch has two states, which is why hardware works in it. Base eight and base sixteen are shorthand for binary, since eight and sixteen are powers of two: every octal digit stands for exactly three bits, every hexadecimal digit for exactly four. Base thirty-six uses the whole alphabet and is the highest base that can be written with ordinary alphanumeric characters.
The conversion is the same operation in every case. To write a decimal number in another base, divide it repeatedly by that base and read the remainders backwards. To read a value in from another base, multiply each digit by the base raised to its position and add. This tool does that with arbitrary-precision integers, so a value copied out of a hash or a memory dump converts exactly rather than losing its last digits to rounding.
How to convert between number bases
- Type the value. Letters a to z stand for the digits above nine, so base 16 uses a to f and base 36 uses a to z.
- Choose the base your value is written in. Bases 2, 8, 10 and 16 are the common ones; anything from 2 to 36 works.
- Read the four tiles at the top for the decimal, hexadecimal and binary forms, plus how many bits the value needs.
- Check the table underneath, which shows the same number in every base up to 36 alongside the base you entered.
- Use the grouped column for binary and hex: bytes are far easier to read in groups of eight and two than in one long run.
- Copy whichever form you need. Nothing is submitted, so it is safe to convert a value that came out of a private system.
Number Base Converter limits and rules
| Item | Limit |
|---|---|
| Bases supported | Every base from 2 to 36, including binary, octal, decimal and hexadecimal |
| Digits | 0–9 then a–z, so a base above ten uses letters for the digits above nine |
| Prefixes | 0x, 0b and 0o are stripped when they match the chosen base |
| Negative values | A leading minus sign is carried through to every output |
| Grouping | Binary is grouped into bytes and hex into byte pairs to make them readable |
| Precision | Arbitrary-precision integers, so no digit is lost on a large value |
| Not handled | Fractions, two's complement, IEEE 754 floating point and base-64 style alphabets |
When to use it
- Reading a hexadecimal colour, hash or memory address back into decimal.
- Checking which bits are set in a permission mask or a configuration register.
- Writing a short identifier in base 36 or base 32 so it is compact and case-insensitive.
- Making sense of the binary in a protocol specification next to the hex the same field is described in.
- Teaching or checking the arithmetic behind positional notation without hand-converting a dozen values.
Is it private?
Everything happens in this page. The conversion is integer arithmetic on numbers you type, with no request sent anywhere, no storage and no log — which is the point when the value came out of a private system.
Frequently asked questions
Because four binary digits fit exactly into one hexadecimal digit. A byte is eight bits, so it is always exactly two hex digits and never a fraction of one. That makes hex a compact, lossless shorthand for binary: FF is easier to read and to say than 11111111, and converting between the two is a matter of reading four bits at a time. Octal, at three bits per digit, does not divide a byte evenly, which is why it survives mainly in file-permission masks where three-bit groups do line up.
Thirty-six, with this tool and in most programming languages. The limit is not a mathematical one — you could use any base — but a notation one: bases up to thirty-six can be written with the ten digits and the twenty-six letters, so a value stays readable. Beyond that you need punctuation, which collides with every other use of those characters. Base 36 is popular for short identifiers because it is case-insensitive, so a code read aloud or transcribed by hand is unambiguous.
As an ordinary negative value, with the minus sign in front of the digits in every base. That is what this tool does, and it is the right answer for arithmetic. It is not, however, how a computer stores a negative integer internally: hardware uses two's complement, where the top bit carries the sign and the value is stored as the bitwise inverse plus one. Converting a two's complement representation into a signed value needs to know the width in bits, which is why that is left out here rather than guessed.
The tool says so and names the offending character. In base 2 only 0 and 1 are valid; in base 8 the digits stop at 7; in base 16 they stop at f. Typing 9 into a binary field is a common slip, and the error is clearer than silently reinterpreting the input. The check applies to every digit in the value, so a typo partway through a long string is caught rather than truncated.
Because a long run of ones and zeros is unreadable without them. The grouped column pads the value to a whole number of bytes and separates them with spaces, so 1111 becomes 00001111 and a sixteen-bit value reads as two clean bytes. The same is done for hexadecimal in pairs of digits, matching the byte-per-two-digits convention. Copy the ungrouped column when the value is going back into a program.
No practical one. The arithmetic is done with arbitrary-precision integers rather than the ordinary floating-point numbers, so a value of a hundred digits converts exactly — which matters for a hash or a long identifier where the last few digits are the ones that distinguish it. The only ceiling is how much you want to paste into the box.
Related tools
Written and maintained by Md. Nur Hossain Repon.