How to use the Number Base Converter
- Type a number into any field — decimal, hex, binary, octal or the custom base (2–36). All other fields update as you type.
- Negative numbers work with a leading minus; very large numbers are handled exactly with BigInt.
- Choose 8, 16, 32 or 64 bits in the bit view to see the two’s complement representation, signed and unsigned values. Click bits to flip them.
- Use the Text ↔ hex ↔ binary panel to encode text as UTF-8 bytes or decode hex/binary back into text.
What is a number base?
A number base (or radix) is how many distinct digits a positional number system uses. Decimal uses ten (0–9), binary two (0–1), octal eight (0–7) and hexadecimal sixteen (0–9 and A–F). Each position is worth the base raised to a power, so hex 2F means 2 × 16 + 15 = 47, and binary 101 means 1 × 4 + 0 × 2 + 1 = 5. Bases up to 36 use the letters A–Z as digits, which is how short IDs and URL shorteners squeeze large numbers into a few characters.
How to convert between bases
To decimal: multiply each digit by its place value and add them up — binary 1101 = 8 + 4 + 0 + 1 = 13. From decimal: repeatedly divide by the target base and read the remainders from bottom to top — 13 ÷ 2 = 6 r1, 6 ÷ 2 = 3 r0, 3 ÷ 2 = 1 r1, 1 ÷ 2 = 0 r1 → 1101. Binary and hex convert directly because one hex digit is exactly four bits: 1111 1010 = FA. Octal maps to groups of three bits, which is why Unix permissions like 755 are written in octal (111 101 101 = rwx r-x r-x).
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 10 | 1010 | 12 | A |
| 255 | 1111 1111 | 377 | FF |
| 1024 | 100 0000 0000 | 2000 | 400 |
| 65535 | 1111 1111 1111 1111 | 177777 | FFFF |
Two’s complement and signed integers
Computers store negative integers in two’s complement: invert all bits of the positive value and add one. In 8 bits, 5 is 00000101 and −5 is 11111011 (hex FB, which is 251 when read as unsigned). The highest bit acts as the sign bit, so an 8-bit signed integer ranges from −128 to 127, 16-bit from −32,768 to 32,767, 32-bit from −2,147,483,648 to 2,147,483,647 and 64-bit up to about ±9.22 × 1018. Values outside the range wrap around — the classic integer overflow. The bit view above shows both interpretations of the same bits.
Large numbers and JavaScript
JavaScript’s regular numbers are 64-bit floats and lose precision above 253 − 1 (9,007,199,254,740,991). This converter uses BigInt, so 64-bit IDs, hashes and huge values convert exactly. To encode bytes as text instead of numbers, see the Base64 Encoder; for colour codes like #4F46E5, the Color Converter turns hex into RGB and HSL.
Tools that pair well with the Number Base Converter
- Hash Generator — Compute MD5 and SHA hashes of any text or file instantly, create HMAC signatures, and paste an expected checksum to verify a download.
- Unit Converter — Convert between metric, imperial and technical units in ten categories — with a two-way converter and a table of every unit at once.
- URL Encode / Decode — Percent-encode text for safe use in URLs, decode encoded strings back to readable text, and break any URL down into its parts and query parameters.
- Percentage Calculator — Seven everyday percentage calculations on one page.
Frequently asked questions
How do I convert binary to decimal?
10110 = 16 + 0 + 4 + 2 + 0 = 22. Or paste it into the Binary field above.How do I convert hex to decimal?
1F4 = 1 × 256 + 15 × 16 + 4 = 500.What is two’s complement?
Why does −1 show as FFFFFFFF?
FFFFFFFF in hex or 4,294,967,295 when interpreted as unsigned.How do I convert text to binary?
01000001. Non-ASCII characters such as “é” use two or more bytes.