Number Base Converter
Convert numbers between binary, octal, decimal and hexadecimal — enter a value in any base and see all the others instantly.
We use cookies and similar technologies to enhance your browsing experience, analyze site traffic, and personalize content and ads. By clicking "Accept", you consent to our use of cookies. Learn more in our Privacy Policy.
Convert numbers between binary, octal, decimal and hexadecimal — enter a value in any base and see all the others instantly.
The Number Base Converter turns a value written in one base into its equivalent in another. It handles the four bases you reach for most often as a developer: binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Type a number in any one of them and the others update at the same time, so you can read the same value across every representation without doing the arithmetic by hand.
It runs entirely in your browser. Nothing you type is sent to a server, logged, or stored, which means you can paste an internal ID, a register value, or a permission bitmask without it leaving your machine. There is no sign-up and no install. It is built for the everyday moments where you have a hex color, a file permission, or a bit flag in front of you and need the same number in a base you can actually reason about.
Enter a value in the field for the base you have, and every other field recalculates instantly. The tool parses your input against the rules of its base, converts it to an internal integer, then re-encodes that integer into each target base.
Key behavior to know:
2 is rejected in the binary field, and a g is rejected in the hex field, so you find out immediately rather than getting a wrong answer.FF, ff, and Ff all parse to the same value.0x for hex and 0b for binary are accepted, so you can paste straight from code.Because everything happens locally, conversions are immediate and work offline once the page has loaded.
Say you have the hex color component 2A and want to understand it in other bases.
Type 2A into the hexadecimal field. The other fields fill in:
Hex: 2A
Decimal: 42
Octal: 52
Binary: 101010
The math behind the decimal result: hex digit 2 is in the sixteens place and A (which is 10) is in the ones place, so 2 × 16 + 10 × 1 = 42.
For the binary, 42 breaks down into powers of two: 32 + 8 + 2 = 42, which is 101010. You can verify it digit by digit from the right: positions for 2, 8, and 32 are set.
Now edit the binary field to 101011 and watch every field jump to 43 / 2B / 53. That round-trip is the quickest way to sanity-check that a bit you flipped landed where you expected.
A few situations where converting between bases is part of the job:
#1E90FF), but you may need the decimal rgb() components, or want to inspect the individual byte values.chmod modes like 755 are octal; seeing the binary (111 101 101) makes the read/write/execute groups obvious.A few things that trip people up:
00FF and FF are the same number. The tool reads them identically; it does not preserve a fixed width for you.0.5 or 3.14 are not the same problem as integer base conversion and are out of scope.10 means ten in decimal, two in binary, eight in octal, and sixteen in hex. The same characters are four different values depending on the base.F is not a valid hex digit.0x10 is sixteen, not ten. If a number looks an order of magnitude off, check whether a prefix was implied.010 can be eight rather than ten. Converting it here removes the ambiguity.Positional notation works in any base: a number's value is the sum of each digit multiplied by the base raised to its position. Base 2, 8, 10, and 16 are the ones that matter in practice for a specific reason.
Computers store everything in binary because hardware has two states. Binary is correct but unreadable past a few digits, so we group bits. Here is the elegant part: 8 = 2^3 and 16 = 2^4, so each octal digit maps to exactly three bits and each hex digit to exactly four, with no overlap or remainder.
That clean mapping is why hex is the standard shorthand for raw bytes: one byte is eight bits, which is exactly two hex digits (00 to FF). Octal does the same job for three-bit groups, which is why it fits Unix permissions so naturally. Decimal is the base humans count in, so it is the bridge for anything a person needs to read as a plain quantity. Converting between them is just regrouping the same underlying value.
Type or paste the hex value into the hexadecimal field and read the decimal field, which updates instantly. For example, hex 2A becomes decimal 42.
Yes. A 0x prefix on hex and a 0b prefix on binary are recognized and stripped, so you can paste values directly from source code.
No. FF, ff, and Ff all parse to the same value, so you do not have to normalize the case before entering it.
No. This tool converts whole numbers between bases. Decimal fractions follow different rules and are not supported.
The digits 10 mean different quantities per base: ten in decimal, two in binary, eight in octal, and sixteen in hex. Always check which base field you are typing into.
No. All conversion happens in your browser. Nothing you enter is uploaded, logged, or stored, so it is safe for internal IDs or sensitive values.
Enter 755 in the octal field. The binary output is 111101101, which reads as three groups: 111 (owner rwx), 101 (group r-x), 101 (other r-x).
Yes. Once the page has loaded, conversions run locally with no network connection required.