Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal. See all bases at once. Free online base converter.
What is Number Base Converter?
A number base converter translates numbers between different numeral systems — decimal (base-10), binary (base-2), octal (base-8), and hexadecimal (base-16). Computers operate in binary, memory addresses use hexadecimal, some Unix permissions use octal, and humans think in decimal. Developers constantly need to translate between these systems when debugging, reading memory dumps, setting file permissions, working with color codes, understanding network masks, or reading low-level system output.
How It Works
Enter a number in any base and the tool displays its equivalent in all supported bases simultaneously. For conversion, it first parses the input in its source base to determine the numeric value, then formats that value in each target base using the appropriate digit set. Binary uses 0-1, octal uses 0-7, decimal uses 0-9, and hexadecimal uses 0-9 plus A-F. The tool handles arbitrarily large numbers and shows the conversion steps for educational purposes.
Examples
255
Binary: 11111111 Octal: 377 Hexadecimal: FF
0xFF5733
Decimal: 16733491 R: 255 G: 87 B: 51
Quick Reference
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 255 | 11111111 | 377 | FF |
Common Use Cases
- •Converting hex color codes to binary for understanding bit-level color representation
- •Reading binary data dumps and converting to hexadecimal for more compact display
- •Setting Unix file permissions (chmod) by converting between octal and binary representations
- •Understanding subnet masks and IP addressing by converting between decimal and binary
- •Debugging memory addresses and pointers displayed in hexadecimal by converting to decimal
- •Converting between number formats when working with hardware registers and bit flags
Frequently Asked Questions
What bases are supported?▼
Binary (base 2), Octal (base 8), Decimal (base 10), and Hexadecimal (base 16).
Why are hexadecimal and binary so common in programming?▼
Because they map onto how hardware stores data. One hex digit is exactly four bits and two hex digits are exactly one byte, so hex is a compact way to write binary without losing the bit boundaries. That is why colours (`#FF5733`), memory addresses and bitmasks are written in hex.
What do the prefixes 0x, 0b and 0o mean?▼
They declare the base of a literal in most programming languages: `0x` is hexadecimal, `0b` binary and `0o` octal. A bare leading zero means octal in C and several older languages, which is a notorious bug source — `010` is 8, not 10.
How do I convert a negative number?▼
Whole positive integers convert directly. Negative numbers depend on representation: computers normally use two's complement, where the result also depends on the width in bits. In 8-bit two's complement, -1 is `11111111`, but in 16-bit it is `1111111111111111`. Decide the width before converting.
Can I convert numbers with a fractional part?▼
Yes, though the results are often surprising. Many decimal fractions have no exact binary representation — 0.1 in binary repeats forever, which is the underlying reason `0.1 + 0.2` does not equal `0.3` in floating-point arithmetic.
What is base64 and is it the same kind of thing?▼
No. Base 2, 8, 10 and 16 are ways of writing a number. Base64 is a way of representing arbitrary binary *data* as printable ASCII text, using 64 symbols. Use the Base64 Encoder for that, not this tool.
Related Tools
More from Converters:
Color Converter
Convert colors between HEX, RGB, HSL, and CMYK formats instantly. Free online color converter with live preview and copy-to-clipboard.
Percentage Calculator
Calculate percentages easily. Find percentage of a number, percentage change, percentage difference, and more. Free online percentage calculator.
Base64 Encoder/Decoder
Encode and decode Base64 strings instantly. Free online Base64 converter tool for text and files. Works entirely in your browser.