Number Base Converter (Binary, Hex, Decimal, Octal)
Type a number and choose its base to see it in binary, octal, decimal and hexadecimal at once. Works with very large numbers too.
๐ Everything you type stays in your browser. Nothing is sent to a server.
By Shah Rukh, software developer ยท Last updated:
How to convert decimal to binary
Divide by 2 repeatedly and write down the remainders from bottom to top. For 13: 13 รท 2 = 6 r 1, 6 รท 2 = 3 r 0, 3 รท 2 = 1 r 1, 1 รท 2 = 0 r 1, so 13 = 1101.
Quick reference
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 1 | 1 | 1 | 1 |
| 8 | 1000 | 8 | 10 |
| 10 | 1010 | A | 12 |
| 15 | 1111 | F | 17 |
| 16 | 10000 | 10 | 20 |
| 255 | 11111111 | FF | 377 |
Prefixes like 0x (hex), 0b (binary) and 0o (octal) are accepted and ignored.
Frequently asked questions
Why do programmers use hex?
One hex digit equals exactly 4 binary digits, so hex is a compact way to write binary, like colour codes #FF0000.
Is there a size limit?
No practical limit. It uses arbitrary-precision integers (BigInt).
Does it handle fractions?
No, whole numbers only.
Related tools
QR Code Generator
Free QR codes for links, Wi-Fi, text and contacts.
Color Picker & Palette
HEX, RGB and HSL codes plus matching palettes.
Contrast Checker
Check WCAG AA/AAA colour contrast for text.
Base64 Encoder / Decoder
Encode or decode Base64 text (UTF-8 safe).
URL Encoder / Decoder
Percent-encode or decode URLs and query strings.
CSS Gradient Generator
Linear, radial and conic gradients with CSS code.