A number base (or radix) is how many digits a system uses: decimal (base 10) uses 0–9, binary (base 2) uses 0–1, and hexadecimal (base 16) uses 0–9 then A–F. The same value can be written in any base. To convert, enter the number and its base into a converter and read the others. Here is how the common bases relate.
Type the value, optionally with a 0x, 0b or 0o prefix.
Choose the base it’s written in, or let auto-detect read the prefix.
Binary, octal, decimal and hexadecimal are shown at once.
Convert to any base from 2 to 36 and copy the result.
Binary, hex and the 0x / 0b prefixes
Binary (base 2) is how computers store everything; hex (base 16) is a compact way to write binary, since one hex digit equals four bits. In code, 0x marks a hex literal (0xFF = 255) and 0b marks binary (0b1010 = 10). The number base converter reads these prefixes automatically.
Where base conversion shows up
Hex appears in colours (#RRGGBB), memory addresses and byte values; binary in bit flags and permissions; octal in Unix file modes. Converting between them is a daily task in low-level and web work alike.
Tip: One hex digit maps to exactly four binary bits — so you can convert hex↔binary in your head a nibble at a time (F = 1111, A = 1010).
Convert number bases now
Convert between binary, hex, decimal and any base — free, in your browser.
Open the Number Base Converter →Frequently Asked Questions
How do I convert decimal to binary or hex?
Enter the decimal number in a base converter; it shows the binary and hexadecimal forms instantly.
What do 0x and 0b mean?
0x marks a hexadecimal number and 0b marks a binary number in most programming languages.
Does it handle large numbers?
Yes — it uses BigInt, so large integers convert exactly.