Number Base Converter

Convert between binary, octal, decimal, hexadecimal, and custom bases (2–36) instantly

Result
—
All Common Bases
Binary—
Octal—
Decimal—
Hexadecimal—
Conversion History

No conversions yet. Start typing above.

About Number Base Converter

Our free online number base converter lets you instantly convert numbers between any two bases from 2 to 36. Whether you need to convert binary to decimal, hexadecimal to octal, or work with custom bases like base-3 or base-36, this tool handles it all with live real-time conversion as you type. Built entirely with JavaScript's native parseInt() and Number.toString() methods, everything runs 100% client-side in your browser — your data never touches a server. The tool supports binary (base-2), octal (base-8), decimal (base-10), hexadecimal (base-16), and any custom base (2–36).

Key features include input validation that highlights invalid characters for the selected base, a swap button to quickly reverse source and target bases, simultaneous display of all four common bases (binary, octal, decimal, hexadecimal), individual copy buttons for each result, character count display, and a conversion history that stores your last 20 conversions in your browser's localStorage. The clean glassmorphism interface adapts to both light and dark themes and is fully responsive on mobile devices.

How to Use the Number Base Converter

  1. Enter your number: Type or paste the number you want to convert into the input field. The tool starts converting automatically as you type.
  2. Select the source base: Choose the base of your input number — Binary (2), Octal (8), Decimal (10), Hexadecimal (16), or Custom. For custom, enter a value between 2 and 36.
  3. Select the target base: Choose the base you want to convert to. The conversion updates instantly.
  4. Read the main result: The prominent result area shows the converted number in your selected target base.
  5. View all common bases: The table below displays your number in binary, octal, decimal, and hexadecimal simultaneously — no extra clicks needed.
  6. Copy results: Use the copy buttons next to any result to copy it to your clipboard. The main "Copy Result" button copies the primary conversion.
  7. Swap bases: Click the swap button between the two selectors to quickly reverse the source and target bases.
  8. Use history: Your recent conversions are automatically saved. Click on any history entry to reuse a previous conversion, or clear the history with one click.

Frequently Asked Questions

What is a number base?

A number base (or radix) defines how many unique digits a numeral system uses. Decimal uses 10 digits (0–9), binary uses 2 (0–1), octal uses 8 (0–7), and hexadecimal uses 16 (0–9, A–F). Our converter supports all bases from 2 to 36, using digits 0–9 and letters A–Z.

How do I convert binary to decimal?

To convert binary to decimal manually, multiply each digit by 2 raised to its position power (counting from 0 at the rightmost digit). For 1011 binary: 1×8 + 0×4 + 1×2 + 1×1 = 11 decimal. Our tool does this instantly for you.

What is base-36 used for?

Base-36 uses digits 0–9 plus letters A–Z, making it very compact for representing large numbers. Common uses include URL shorteners (like YouTube's video IDs), database IDs, license keys, and encoding systems where case-insensitive identifiers are needed.

Can I convert between any bases 2–36?

Yes, our converter supports conversion between any two bases from 2 to 36 inclusive. Select "Custom" for either source or target base (or both), then enter the desired base value. The tool validates the input against the source base automatically.

Is my data sent to a server?

No, all conversions happen entirely in your browser using JavaScript. The tool uses parseInt() to parse input in the source base, then Number.toString(base) to convert to the target base. No data is ever transmitted to any server — your privacy is guaranteed.

Why do I see an invalid digit error?

Number bases only allow specific digit ranges. For binary (base-2), only 0 and 1 are valid. For octal (base-8), digits 0–7 are allowed. For hexadecimal (base-16), valid characters are 0–9, A–F (case-insensitive). The tool highlights which characters are invalid so you can fix them.

What is hexadecimal used for?

Hexadecimal (base-16) is ubiquitous in computing. It represents memory addresses, CSS color codes (#FF5733), machine code, assembly language instructions, MAC addresses, UTF-8 byte representations, and any context where binary data needs human-readable representation.

How does the swap button work?

The swap button exchanges the source and target base selections, then recalculates the conversion automatically. This is particularly useful when you want to reverse a conversion — just click swap and the result updates immediately.

Is there a character limit?

There is no enforced character limit, but extremely long inputs may slow down your browser since all processing is client-side. The tool displays the character count of each result, helping you gauge the output size for your needs.

Does the converter save my history?

Your last 20 conversions are automatically saved to your browser's localStorage. The history includes the input, source base, target base, and result. It persists across browser sessions but is never uploaded anywhere. You can clear the history at any time.

The Complete Guide to Number Base Conversion

What Are Number Bases and Why Do They Matter?

A number base, also called a radix, is the foundation of every positional numeral system. The most familiar base is base-10 (decimal), which uses ten digits (0–9) and is believed to originate from humans counting on their ten fingers. However, computers operate in base-2 (binary), using only 0 and 1 to represent all data. Between these extremes, base-8 (octal) and base-16 (hexadecimal) serve as compact shorthand for binary data. Understanding number bases is essential for programmers, computer scientists, electronics engineers, and anyone working with low-level computing concepts. Our number base converter makes it easy to switch between any of these systems instantly.

Binary (Base-2): The Language of Computers

Binary is the simplest number base, using only two digits: 0 and 1. Every piece of data in a computer — text, images, video, audio — is ultimately represented as sequences of binary digits (bits). Groups of bits form bytes (8 bits), which can represent values from 0 to 255. While binary is fundamental to computing, it is cumbersome for humans to read and write. A 32-bit number like 11010010101101001011010010101101 is difficult to parse visually, which is why programmers prefer hexadecimal or octal representations. Converting between binary and other bases is a daily task for embedded systems developers, network engineers, and cybersecurity professionals.

Octal (Base-8): Legacy and Permissions

Octal uses digits 0–7 and was historically popular in early computing systems like the PDP-8 and UNIX operating systems. One octal digit represents exactly three binary digits, making conversion between binary and octal straightforward. Today, octal is most commonly encountered in UNIX file permissions (e.g., chmod 755), where each digit represents read/write/execute permissions for owner, group, and others. Some programming languages use a leading zero to denote octal literals. While less common than hexadecimal, octal remains relevant in specific legacy and systems programming contexts.

Decimal (Base-10): Human-Centric Counting

Decimal is the everyday number system used in commerce, science, and daily life. It uses ten digits (0–9) and is the default numeral system for most human communication. While computers internally work in binary, they display results to users in decimal format. Converting between decimal and other bases is essential when interpreting computer memory addresses (hexadecimal), file sizes (binary), or network addresses (decimal dotted notation for IPv4). Understanding decimal-to-binary conversion is particularly important for understanding how computers store and process numerical data.

Hexadecimal (Base-16): The Programmer's Choice

Hexadecimal uses sixteen digits: 0–9 plus A–F (where A=10, B=11, C=12, D=13, E=14, F=15). Each hexadecimal digit represents exactly four binary digits (a nibble), making it an extremely compact way to represent binary data. A single byte can be represented by just two hex digits (e.g., FF = 255 decimal = 11111111 binary). Hexadecimal is used everywhere in computing: memory addresses in debuggers, color codes in web design (#FF5733), MAC addresses (00:1A:2B:3C:4D:5E), UTF-8 byte sequences, assembly language opcodes, and cryptographic hash digests. Mastering hex conversion is a fundamental skill for any developer.

Custom Bases (2–36): Beyond the Standards

Our converter extends beyond the four common bases to support any base from 2 to 36. This includes base-3 (ternary), base-4 (quaternary), base-5 (quinary), base-6 (senary), base-7 (septenary), base-9 (nonary), base-11 through base-15, and base-17 through base-36. Base-36 is particularly noteworthy because it uses all digits 0–9 and all letters A–Z, providing a case-insensitive alphanumeric encoding that is highly compact. URL shorteners like YouTube use base-64 (URL-safe version) or similar encoding schemes, but base-36 is easier to work with because it avoids special characters. Custom base conversion is useful for cryptography, encoding schemes, mathematical exploration, and educational purposes.

The Mathematics Behind Base Conversion

Converting between bases relies on two fundamental operations. To convert from any base to decimal, multiply each digit by the base raised to its position power (starting from 0 at the rightmost digit). For example, hexadecimal A3F = 10×256 + 3×16 + 15×1 = 2623 in decimal. To convert from decimal to any base, repeatedly divide the decimal number by the target base and collect the remainders from right to left. For example, 42 decimal converted to binary: 42÷2=21 rem 0, 21÷2=10 rem 1, 10÷2=5 rem 0, 5÷2=2 rem 1, 2÷2=1 rem 0, 1÷2=0 rem 1 — reading remainders backward gives 101010 binary. Our tool automates both directions for any supported base.

Practical Applications of Base Conversion

  • Network engineering: Converting IP addresses between binary and dotted decimal notation, subnet mask calculation
  • Web development: Converting RGB values to hexadecimal color codes, data URI encoding
  • Embedded systems: Reading memory dumps, interpreting register values, programming microcontrollers
  • Cybersecurity: Analyzing hex dumps of network packets, decoding malware payloads, reverse engineering
  • Database design: Using base-36 for compact unique identifiers, URL slugs, and short codes
  • Education: Teaching computer science fundamentals, number theory, and digital logic design
  • Cryptography: Representing keys, hashes, and encrypted data in human-readable formats
  • File formats: Understanding binary file headers, PNG chunks, EXIF data, and media container formats

Why Use Our Free Online Number Base Converter?

Our converter offers a unique combination of power and simplicity. Unlike basic converters that only handle the four common bases, ours supports custom bases 2–36 with live validation. The real-time conversion updates as you type with a 200ms debounce, making it feel instant. The simultaneous display of all four common bases saves time when you need to see multiple representations at once. History persistence via localStorage means you can reference past conversions even after closing your browser. And because everything runs client-side, there are no privacy concerns, no rate limits, and no server costs — the tool is completely free and always available.

Start Converting Numbers Today

Whether you're a professional developer debugging memory addresses, a student learning computer science fundamentals, or a hobbyist experimenting with different numeral systems, our number base converter provides everything you need in one clean, fast interface. Bookmark this page for quick access whenever you need to convert between binary, octal, decimal, hexadecimal, or any custom base from 2 to 36. No signup, no data upload, no limits — just instant, accurate base conversion at your fingertips.