Number Base Converter
Binary, decimal, hex — and text.
Convert numbers between binary, octal, decimal and hexadecimal, or turn text into ASCII codes and back.
How it works
Numbers are parsed in the source base (2, 8, 10 or 16) and rewritten in the others. In text mode, each character is converted to its character code, and a list of codes can be turned back into text.
When it helps
Essential for programming, networking, digital electronics and computer science homework.
What a number base is
Our everyday decimal system uses ten digits, so each position is worth ten times the one to its right. Binary uses only 0 and 1, so each position is worth twice as much. Octal uses eight digits and hexadecimal uses sixteen — the digits 0–9 plus the letters A–F for 10 to 15.
Computers store everything in binary, but long strings of ones and zeros are hard to read. Hexadecimal is popular because one hex digit maps exactly to four bits, so a byte is always two hex digits.
Worked example
Take decimal 202. In binary it's 11001010 (128 + 64 + 8 + 2). Split into groups of four bits — 1100 and 1010 — that's C and A, so the hex value is CA. In octal it's 312. In text mode, the letter 'A' has code 65, which is 01000001 in binary and 41 in hex.
This is the same logic behind HTML color codes: #FF8000 means red 255, green 128 and blue 0.
Frequently asked questions
What is hexadecimal used for?
It's a compact way to write binary. Each hex digit is exactly four bits, which is why colors and memory addresses use it.
Does it support negative numbers?
It's designed for non-negative whole numbers, which covers most everyday conversions.
What does the 0x prefix mean?
It's a common way to mark a hexadecimal number in code, so 0x1F means hex 1F, which is 31 in decimal.
Tools In Orbit · About · Contact · Privacy · Terms