Binary/Hex/Decimal Calculator & ASCII Table
Convert between number bases with step-by-step explanations, or look up a character’s ASCII code.
Input
Results
Binary Arithmetic
How to use & examples
- Pick the input base (Decimal, Binary, Hex, Octal, or Other base for anything from 2 to 36).
- Type the number. Prefixes
0x/0b/0o, spaces and underscores are accepted as grouping and stripped automatically. Commas group digits too; in decimal only as thousands separators (1,000,000), so3,14is refused rather than read as 314. - Results update as you type (or click Convert). A step-by-step explanation appears below for numbers up to 256 bits.
- For a signed interpretation, tick Signed integer (two's complement) and choose a bit width. A hex or binary pattern such as
FFat 8 bits is also read as its signed value (−1). - Use Binary Arithmetic for add / subtract / multiply / divide (exact, any size) and AND / OR / XOR / shifts (at the chosen bit width; each number must fit that width).
>>keeps the sign like C, Java and Python;>>>fills with zeros.
| Case | Input (base) | Result |
|---|---|---|
| Good | 255 (decimal) | Binary 1111 1111, Hex FF, Octal 377 |
| Good (huge) | FFFFFFFFFFFFFFFF (hex) | Decimal 18 446 744 073 709 551 615 — exact, not rounded |
| Bad | 123 (binary) | Rejected: “Invalid digit ‘2’ for binary” (never silently truncated) |
| Edge (negative) | -1 (decimal), two's complement, 8-bit | Pattern 11111111 = 0xFF |
| Edge (overflow) | 128, two's complement, 8-bit | Reported: does not fit in 8-bit signed range [-128, 127]; as an 8-bit pattern 1000 0000 it reads as −128 |
| Edge (shift) | -8 >> 1, 8-bit | -4 (arithmetic); -8 >>> 1 gives 124 (logical) |
Accuracy & limits: all math uses arbitrary-precision integers (BigInt), so conversions
are exact at any size — a 256-bit hex value converts to its exact decimal. Negative numbers use
signed magnitude unless you enable two's complement at a chosen bit width. This tool handles integers
only (no fractions). Only ASCII digits and letters count as digits: look-alikes such as ß or
full-width digits are refused, never reinterpreted. Everything runs in your browser; nothing is sent anywhere.
Quick Reference
Binary (Base 2)
Digits: 0, 1
Prefix: 0b
Example: 0b1010 = 10
Used in: Computer hardware, digital logic
Octal (Base 8)
Digits: 0-7
Prefix: 0o or 0
Example: 0o12 = 10
Used in: Unix permissions, legacy systems
Decimal (Base 10)
Digits: 0-9
Prefix: none
Example: 10 = 10
Used in: Everyday numbers
Hexadecimal (Base 16)
Digits: 0-9, A-F
Prefix: 0x
Example: 0xA = 10
Used in: Colors, memory addresses, MAC
Common Values
| Decimal | Binary | Hex | Octal |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 8 | 1000 | 8 | 10 |
| 10 | 1010 | A | 12 |
| 15 | 1111 | F | 17 |
| 16 | 10000 | 10 | 20 |
| 255 | 11111111 | FF | 377 |
| 256 | 100000000 | 100 | 400 |
| Char | Dec | Hex | Oct | Binary | HTML | Description |
|---|
ASCII quick reference
Common control characters
0NUL – Null9TAB – Horizontal Tab10LF – Line Feed (\n)13CR – Carriage Return (\r)27ESC – Escape32SP – Space
Ranges
48–57Digits 0–965–90Uppercase A–Z97–122Lowercase a–z33–47Punctuation91–96Brackets, etc.123–126Braces, etc.
Escape sequences
\0Null (0)\tTab (9)\nNewline (10)\rReturn (13)\\Backslash (92)\'Quote (39)
Conversions
- Upper to lower: +32
- Lower to upper: −32
- Digit char to int: −48
- Int to digit char: +48