Online Number Base Converter: Bases 2–36 and Large Integers
What Is Number Base Conversion
Number base conversion is the process of translating values between different numeral systems. An online number base converter handles this instantly, and the most commonly used bases in computer science are:
| Base | Radix | Digits | Common Usage |
|---|---|---|---|
| Binary | 2 | 0, 1 | Computer internals, bitwise operations |
| Octal | 8 | 0-7 | Unix file permissions (chmod 755) |
| Decimal | 10 | 0-9 | Everyday human counting |
| Hexadecimal | 16 | 0-9, A-F | Memory addresses, color codes, hashes |
| Custom (Base N) | 2–36 | 0-9 then a–z | Short codes, Base36 IDs, teaching demos |
Why You Need Base Conversion
- Low-level debugging: Memory addresses and byte data require hexadecimal
- Bitwise operations: Bitmasks and shifts need binary thinking
- Color handling: CSS colors use hex (
#FF5733) - Network configuration: Subnet masks involve binary-decimal conversion
- File permissions: Linux permissions use octal (
chmod 755) - Compact identifiers: Base36 (
0-9a-z) shortens large integers into printable strings for tickets and invite codes
Base Conversion Methods
Manual Conversion Techniques
Decimal → Binary (divide by 2, collect remainders):
13 ÷ 2 = 6 remainder 1
6 ÷ 2 = 3 remainder 0
3 ÷ 2 = 1 remainder 1
1 ÷ 2 = 0 remainder 1
Result: 1101
Decimal → Hexadecimal (divide by 16, collect remainders):
255 ÷ 16 = 15 remainder 15 (F)
15 ÷ 16 = 0 remainder 15 (F)
Result: FF
Programming Language Conversion
JavaScript / TypeScript:
const num = 255;
num.toString(2) // "11111111" (binary)
num.toString(8) // "377" (octal)
num.toString(10) // "255" (decimal)
num.toString(16) // "ff" (hex)
// String → Number (always pass a radix)
parseInt("ff", 16) // 255
parseInt("11111111", 2) // 255
// Past Number.MAX_SAFE_INTEGER, use BigInt
BigInt("0x1fffffffffffff") + 1n
Python:
num = 255
bin(num) # "0b11111111"
oct(num) # "0o377"
hex(num) # "0xff"
# String → Number (any radix 2–36)
int("ff", 16) # 255
int("z", 36) # 35
Go:
import "strconv"
num := 255
strconv.FormatInt(int64(num), 2) // "11111111"
strconv.FormatInt(int64(num), 8) // "377"
strconv.FormatInt(int64(num), 16) // "ff"
// String → Number
strconv.ParseInt("ff", 16, 64) // 255
strconv.ParseInt("11111111", 2, 64) // 255
How to Use an Online Number Base Converter
Using ToolVault's Number Base Converter:
- Enter an integer (optional matching prefixes
0x/0b/0o) - Select the input base: presets 2/8/10/16, or Custom for any radix 2–36
- Toggle letter case (A–Z / a–z) and optionally enable an extra output base
- Switch to Batch for one value per line; bad digits show position and the allowed alphabet
- One-click copy for any format
Internally the tool accumulates digits with BigInt, so snowflake IDs and 64-bit all-F hex stay lossless past JavaScript's safe integer range.
Quick Reference Table
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 16 | 10000 | 20 | 10 |
| 64 | 1000000 | 100 | 40 |
| 128 | 10000000 | 200 | 80 |
| 255 | 11111111 | 377 | FF |
The conversions developers actually get wrong
Hex to binary is free (each hex digit is exactly 4 bits — memorize the 16 mappings once, convert without arithmetic). The traps live elsewhere: hex to decimal past 2^53 in JavaScript loses digits silently (0x1FFFFFFFFFFFFF + 1 — anything past the double-precision mantissa needs BigInt or string math); octal legacy (leading-zero literals are octal in some languages, decimal in others — the ambiguity that made JSON ban leading zeros); and subnet-mask hex across dotted quads (FF=255 is the only value that appears; /24 = FF FF FF 00 is pattern-memorized by network people). The converter sidesteps these with explicit BigInt string math — the languages' implicit behaviors are the bug source the tool exists to avoid.
Why IPv4, MAC, colors, and Unicode are hex (and URLs are base64)
The domains where hex won share one trait: humans reading machine-aligned values — IPv4 dotted quads (255 fits two hex digits), MAC addresses (48 bits as 12 hex), CSS colors (#RRGGBB — byte alignment), Unicode code points (U+4E2D — the hex IS the identity). Hex digits map cleanly to bytes (2 per byte), making the human-facing form a direct window into the machine value. Base64 won transport (URL-safe IDs, data URIs) where the goal is density in ASCII — 6 bits per character. Base58 won addresses (Bitcoin) where look-alike character ambiguity costs money. Choosing a base for a system you design: alignment (hex), density (base64), or human-transcription-safety (base32/58) — name the requirement first.
What “bases 2–36” actually means
Standard-library “arbitrary base” almost always stops at 36: after digits 0–9 you only have 26 Latin letters left. Base36 shortens long decimals for invite codes; anything denser jumps to a different encoding family (Base58/64), which operates on byte strings rather than “the same integer in another alphabet.” If your input contains +, /, or padding =, that is Base64 — not integer base conversion. Confirm whether you hold another spelling of an integer, or a printable wrapper around opaque bytes.
Floating point: the converter question that reveals the representation
"0.1 in binary" is where number bases stop being arithmetic and become representation theory: 0.1 decimal is infinite in binary (0.000110011... repeating) — which is why 0.1 + 0.2 does not equal 0.3 in every IEEE 754 language. A converter that shows the actual stored value (0.1 as its double bits, 0x3FB999999999999A) teaches more than any explanation; the conversion chain (decimal fraction, binary expansion, truncated mantissa, back) is the entire floating-point story in one number. For exact decimal work (money), the answer is never a different base — it is a different type (integer cents, decimal libraries, rational types); converting 0.1 more precisely between bases cannot fix what the representation cannot hold. This site's converter accepts integers only: a decimal point is rejected with a positioned digit error, so truncation never pretends to succeed.
FAQ
Why Do Programmers Prefer Hexadecimal?
Hex is a human-friendly shorthand for binary. 1 hex digit = 4 binary digits, so 0xFF directly maps to 11111111. Hex is more intuitive than decimal when representing bytes and memory addresses, which is why a byte converter is part of every low-level developer's toolkit.
Is Octal Still Relevant?
Primarily for Linux file permissions. chmod 755 uses octal: 7=rwx, 5=r-x. Also used for escape sequences in some languages (\012 = newline).
How to Quickly Convert Binary to Hex?
Every 4 binary digits map to 1 hex digit. Group right-to-left: 1111 1111 → F F → FF. This is a direct mapping in computer hardware, and a number base converter can verify it for any value.
When is batch conversion useful?
Paste a column of snowflake IDs from logs, a list of hex constants, or Base36 short codes you need to reconcile — one value per line. Bad lines report errors without aborting the rest of the batch.
Triage notes
'The conversions developers actually get wrong' opens by calling hex-to-binary a freebie (each digit is exactly 4 bits) and concentrates on the scenes that actually break: silent digit loss above 2^53 and the historical split over leading-zero octal — the tool sidesteps the languages' implicit behavior with explicit BigInt string math. The floating-point section traces 0.1 + 0.2 ≠ 0.3 back to representation: for exact decimals the answer is never a different base but a different type (integer cents, decimal libraries), so the converter accepts integers only and rejects a decimal point outright, refusing to let 'truncated' masquerade as success. 'What bases 2-36 actually means' adds a discriminant you can use on sight: if the input contains +, /, or =, it is Base64 — first decide whether you are holding another notation for an integer or a printable envelope for bytes.
From the ToolVault developer notebook. The homepage collects more browser-local tools.
Related Tools
Related Articles
Markdown to Word: Native Style Mapping and the Inline-Format Downgrade List
Turning a Markdown draft into a deliverable .docx: pandoc CLI vs in-browser local conversion, how headings/tables/code blocks map to native Word styles, which inline formats degrade to plain text, and why 'editable' beats 'looks right'.
Word to Markdown: Two Clean Paths and What Survives the Conversion
How to convert .docx to Markdown cleanly: pandoc CLI vs in-browser local conversion, a format fidelity table for headings/tables/images/auto-numbering, and fixes for the .doc legacy format, image bloat, and merged-cell tables.
China License Plate Rules and Validation: Standard, New Energy, and Special Formats Explained
Mainland China plate encoding rules in full: the standard blue plate, the GA36D-2018 new-energy format, armed police and embassy plates, province abbreviations and issuing-authority letters — with an online validator.