Number Base Converter
Convert Binary, Octal, Decimal, and Hexadecimal
Number Base Converter tool
Type a value in any field — all other bases update instantly.
Quick reference — common values
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1024 | 10000000000 | 2000 | 400 |
| 65535 | 1111111111111111 | 177777 | FFFF |
Number Base Converter: key facts
- What it does
- Convert Binary, Octal, Decimal, and Hexadecimal
- Category
- Converters
- Cost
- Free, with no account, sign-up, or install.
- Your data
- Runs entirely in your browser — the files and text you enter are never uploaded to a server.
- Last reviewed
- . Report an incorrect result.
What the Number Base Converter does
Binary, octal, decimal, and hexadecimal are not four separate number systems — they are four different ways of writing the same integer. Computers work in binary (base 2) internally, memory addresses and color codes appear in hexadecimal (base 16), Unix file permissions are conventionally written in octal (base 8), and decimal (base 10) is what most humans think in. Moving fluidly between them is a fundamental skill for programmers, network engineers, and computer science students.
A front-end developer might start with the hex color code #1A73E8, want to see its decimal RGB channels, and then check the binary representation of each channel to understand bit-masking. A student debugging a microcontroller might need to convert a decimal sensor reading to binary to verify individual bit flags. An admin reading octal chmod permissions like 0755 needs to understand which read/write/execute bits are set. This converter shows all four representations at once and updates live as you type in any one of them.
Real-time validation highlights illegal characters for the selected base — you cannot type the digit 2 in binary mode, and letters beyond F are flagged red in hex — so you know immediately if your input is valid.
Using the Number Base Converter, step by step
- Type your number into the Binary, Octal, Decimal, or Hexadecimal input field.
- All other bases update instantly. Invalid characters are highlighted in red with a message explaining what is allowed.
- Hexadecimal values are displayed in uppercase (A–F).
- Click Copy on any field to copy that representation to your clipboard.
Parsing and rendering in four bases
A value entered in any base is parsed to an integer and then rendered in binary, octal, decimal, and hexadecimal simultaneously. Every representation shows the same number — base is a notation, not a property of the quantity — and seeing all four at once is what makes the relationships between them visible.
Binary and hexadecimal are related in a way worth internalising: sixteen is two to the fourth, so each hex digit corresponds to exactly four binary digits. That is why hex is used as shorthand for binary throughout computing, and why converting between them requires no arithmetic, only grouping.
Octal has the same property with three bits per digit, which is why Unix file permissions are written in octal — three bits map neatly onto read, write, and execute.
- 255 in decimal is FF in hex and 11111111 in binary — the largest value in one byte.
- 1024 is 400 in hex, which is why round numbers in computing look arbitrary in decimal.
- Each hex digit is exactly four binary digits, so FF splits into 1111 1111.
What makes this one worth using
- All four bases display simultaneously — you see the number in every representation at once without toggling between modes.
- Per-field character validation prevents illegal input for each base (e.g., 2–9 are flagged red in binary) so you catch errors while typing.
- Uses JavaScript's built-in parseInt(n, base).toString(base) for reliable, spec-compliant conversion across all supported bases.
- No libraries, no upload, no account — works offline once the page loads.
Where each base turns up
Hexadecimal appears wherever bytes are displayed compactly: colour codes, memory addresses, MAC addresses, hash digests, and character code points. Two hex digits are exactly one byte, which is the reason a colour is six digits — one byte each for red, green, and blue.
Binary is how the hardware works and is mostly seen when individual bits matter: flags packed into a single value, bitmasks, and network subnet masks. Octal survives in Unix permissions and in some legacy formats.
Two practical traps. Prefixes distinguish bases in most languages — 0x for hex, 0b for binary, and a bare leading zero historically meant octal, which is why 010 has meant eight in some languages and caught out a great many people. And bases apply to integers here; representing fractions in another base is possible but introduces its own rounding, since a fraction that terminates in one base may recur in another.
Frequently Asked Questions
What does "base" mean in number systems?
The base (or radix) tells you how many unique digits the system uses before cycling to the next position. Binary (base 2) uses only 0 and 1; decimal (base 10) uses 0–9; hexadecimal (base 16) uses 0–9 plus A–F for values ten through fifteen.
Why do programmers use hexadecimal so often?
One hex digit represents exactly 4 binary bits (a "nibble"), and two hex digits represent a full byte (8 bits). That tight mapping makes hex far more compact than binary while still being directly convertible — which is why memory addresses, color codes, and cryptographic hashes are expressed in hex.
What is the largest number this converter handles?
The converter works up to JavaScript's Number.MAX_SAFE_INTEGER (2^53 − 1 = 9,007,199,254,740,991 in decimal). Beyond that, floating-point precision limits make integer results unreliable. For very large integers, use BigInt-based tools instead.
Why does my hex input need to be uppercase?
It does not — the converter accepts both uppercase (A–F) and lowercase (a–f) hex input. Output is normalized to uppercase, which is the most common convention in technical documentation, memory dumps, and color codes.