Skip to content

Number Base Converter — Binary, Hex, Decimal & Octal

Convert numbers between binary, hexadecimal, decimal, octal, and any custom base (2-36) instantly. Free, private, no sign-up — all processing happens in your browser.

No Tracking Runs in Browser Free
Binary (Base 2)
-
Octal (Base 8)
-
Decimal (Base 10)
-
Hexadecimal (Base 16)
-
Custom Base
-
Code Literals
-
Grouped Binary
-

What Is a Number Base Converter?

A number base converter is a tool that translates values between different positional numeral systems, each defined by its radix — the number of unique digits used. Every numeral system is positional, meaning a digit's value depends on its position within the number. The radix determines the multiplier for each position: in base 10, positions represent powers of 10; in base 16, powers of 16. A base converter automates the arithmetic of translating a value from one radix to another.

The four most common bases in computing are binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Binary is the native language of processors, representing data as sequences of 0s and 1s. Octal maps neatly to 3-bit groups and is used for Unix file permissions. Decimal is the human-readable default. Hexadecimal compresses 4 bits into a single character, making it the standard for memory addresses, CSS color codes, and byte-level data inspection. Other bases appear in specialized contexts — for instance, base 64 is used in data encoding (see our Base64 encoder for that use case).

This tool supports any integer base from 2 to 36, using digits 0-9 and letters A-Z for bases above 10. It is powered by JavaScript's BigInt, enabling arbitrary-precision arithmetic with no upper limit on digit count. All processing runs entirely in your browser — no data is transmitted to a server, ensuring complete privacy for sensitive values like cryptographic keys or proprietary identifiers.

// The number 42 in different bases:
// Binary:      101010   (base 2)
// Octal:       52       (base 8)
// Decimal:     42       (base 10)
// Hexadecimal: 2A       (base 16)

// JavaScript code literals:
const bin = 0b101010;   // 42
const oct = 0o52;       // 42
const hex = 0x2A;       // 42

Key Features of This Base Conversion Tool

Real-Time Multi-Base Conversion

See results in binary, octal, decimal, and hexadecimal simultaneously — all fields update instantly as you type.

Custom Base Support (2-36)

Convert to and from any base between 2 and 36 using digits 0-9 and letters A-Z.

Arbitrary Precision with BigInt

No size limit on input numbers. Convert values with hundreds of digits without precision loss.

Code-Ready Output

Copy values as programming language literals (0b, 0o, 0x) ready for JavaScript, Python, Go, Rust, and C.

Grouped Binary Display

Binary output is displayed with nibble grouping (4-bit groups) for easy visual inspection.

100% Browser-Based

All processing happens locally in your browser. No server uploads, no tracking, no cookies — your data never leaves your device.

Base Conversion Examples

Binary to Decimal — ASCII Character Code

1000001
65

The binary value 1000001 equals decimal 65, which is the ASCII code for the uppercase letter 'A'. Understanding this mapping is fundamental to text encoding in computing.

Decimal to Binary — Subnet Mask

255
11111111

Decimal 255 converts to binary 11111111 — a full octet of 1s. This is the building block of subnet masks like 255.255.255.0, where each octet is either all 1s or all 0s in classful networking.

Decimal to Hexadecimal — RGB Color Channel

255
FF

Decimal 255 is FF in hexadecimal, representing the maximum value for a single RGB color channel. CSS colors like #FF5733 use two hex digits per channel: FF (red), 57 (green), 33 (blue).

Hex Color to Binary

FF5733
1111 1111 0101 0111 0011 0011

Convert a CSS hex color code to its binary representation to understand individual bit patterns

Hexadecimal to Decimal — Memory Address

1A3F
6719

The hex address 0x1A3F equals decimal 6719. Debuggers and memory inspectors display addresses in hexadecimal because it maps cleanly to binary, but decimal values are sometimes needed for pointer arithmetic and offset calculations.

Unix Permission to Decimal

755
493

Convert an octal Unix file permission (rwxr-xr-x) to its decimal equivalent

Binary IP Octet to Decimal

11000000
192

Convert a binary IP address octet to decimal — the first octet of 192.168.x.x

Large Number in Base 36

1000000
LFLS

Encode a large decimal number into a compact base-36 string, commonly used in URL shorteners

Common Base Conversions

Quick reference for the most frequently used number base conversions.

How to Convert Binary to Hexadecimal

Binary (Base 2) Hexadecimal (Base 16)

Group binary digits into sets of 4 from right to left, then map each group to its hex equivalent. For example, 1010 1111 becomes AF. To convert hex back to binary, expand each hex digit to its 4-bit binary equivalent.

10101111 AF

Each hex digit represents exactly 4 binary bits — memorize the 0-F mapping and conversions become instant.

Try it above — enter your number and see the result instantly.

How to Convert Binary to Decimal

Binary (Base 2) Decimal (Base 10)

Multiply each binary digit by 2 raised to the power of its position (starting from 0 on the right), then sum all values. For example, 1011 = 1×8 + 0×4 + 1×2 + 1×1 = 11. To convert decimal to binary, divide repeatedly by 2 and read remainders bottom-up.

1011 11

Powers of 2 are worth memorizing: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024.

Try it above — enter your number and see the result instantly.

How to Convert Hexadecimal to Decimal

Hexadecimal (Base 16) Decimal (Base 10)

Multiply each hex digit by 16 raised to the power of its position, then sum. For example, FF = 15×16¹ + 15×16⁰ = 240 + 15 = 255. To convert decimal to hex, divide repeatedly by 16 and map remainders to hex digits.

FF 255

Remember that A=10, B=11, C=12, D=13, E=14, F=15 in hexadecimal.

Try it above — enter your number and see the result instantly.

How to Convert Decimal to Octal

Decimal (Base 10) Octal (Base 8)

Divide the decimal number repeatedly by 8, collecting remainders. Read the remainders from bottom to top to get the octal result. For example, 255 ÷ 8 = 31 R7, 31 ÷ 8 = 3 R7, 3 ÷ 8 = 0 R3, giving 377. To convert octal to decimal, multiply each digit by 8^position and sum.

255 377

Octal is commonly used for Unix file permissions: 7=rwx, 5=r-x, 4=r--.

Try it above — enter your number and see the result instantly.

How to Convert Octal to Hexadecimal

Octal (Base 8) Hexadecimal (Base 16)

The easiest method is to convert octal to binary first (each octal digit = 3 bits), then regroup into 4-bit nibbles for hex. For example, octal 755 → binary 111 101 101 → regroup as 0001 1110 1101 → hex 1ED. To reverse, convert hex to binary then regroup into 3-bit octal groups.

755 1ED

Going through binary as an intermediate step is almost always the fastest path between octal and hex.

Try it above — enter your number and see the result instantly.

How to Convert Octal to Binary

Octal (Base 8) Binary (Base 2)

Replace each octal digit with its 3-bit binary equivalent. For example, octal 17 → 001 111 → binary 1111 (drop leading zeros). To convert binary to octal, group bits into sets of 3 from the right and map each group to its octal digit.

17 1111

Since 8 = 2³, each octal digit maps to exactly 3 binary digits — making this conversion a simple lookup.

Try it above — enter your number and see the result instantly.

How to Use the Number Base Converter

  1. 1

    Select Source Base

    Choose the base of your input number from the dropdown menu: Binary (2), Octal (8), Decimal (10), Hexadecimal (16), or any custom base from 2 to 36.

  2. 2

    Enter Your Number

    Type or paste the number you want to convert into the input field. The tool validates your input in real time against the selected base.

  3. 3

    View Instant Results

    See the converted values instantly in Binary, Octal, Decimal, and Hexadecimal fields below the input. All conversions update as you type.

  4. 4

    Copy or Use Code Literals

    Click the copy button next to any output to copy the value. Use the code literals section to get language-ready formats like 0xFF, 0b1010, or 0o17.

Use Cases for Base Conversion

Debugging Memory Addresses
Convert hexadecimal memory addresses to binary or decimal for debugging pointer arithmetic and memory layouts.
CSS Color Code Conversion
Convert hex color codes like #FF5733 to their decimal RGB equivalents or binary bit patterns.
Unix File Permissions
Convert between octal permission codes (755, 644) and their decimal or binary representations.
Network Subnet Masks
Convert subnet masks between binary, decimal, and hexadecimal for network configuration and CIDR calculations.
URL Shortener Encoding
Encode large numeric IDs into compact base-36 strings for shorter, more shareable URLs.
Educational Exercises
Verify manual base conversion calculations for computer science and discrete mathematics coursework.

Technical Details

BigInt Precision
Uses JavaScript BigInt for arbitrary-precision integer arithmetic, eliminating the 53-bit limit of Number.
Base Range
Supports conversion between any bases from 2 to 36, using digits 0-9 and letters A-Z for extended bases.
Browser-Based Processing
All conversions run client-side in JavaScript with zero network calls. No data leaves your browser.

Best Practices for Number Base Conversion

Verify With Known Values
When learning base conversion, start with small known values (like 255 = FF = 11111111) to build intuition.
Use Hex for Byte Data
When working with byte-level data, prefer hexadecimal over binary for readability — each byte is exactly 2 hex digits.
Check Digit Validity
Ensure your input digits are valid for the selected base — for example, base 8 only allows digits 0-7.

Frequently Asked Questions About Base Conversion

What is a number base (radix) and why does it matter in programming?
A number base (or radix) defines how many unique digits are used in a positional numeral system. Base 10 (decimal) uses digits 0-9; base 2 (binary) uses 0-1; base 16 (hexadecimal) uses 0-9 and A-F. In programming, binary represents raw machine data, octal is used in Unix file permissions (e.g., chmod 755), and hexadecimal is standard for memory addresses, color codes (#FF5733), and byte-level data inspection. Understanding bases is essential for debugging, networking, and low-level programming.
How do I convert between number bases manually?
To convert from any base to decimal: multiply each digit by the base raised to the power of its position (right to left, starting from 0), then sum the results. For example, binary 1011 = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8+0+2+1 = 11. To convert from decimal to another base: repeatedly divide by the target base and collect remainders in reverse order. For example, decimal 255 to hex: 255÷16 = 15 remainder 15, giving FF.
Is my data safe when using this base converter?
Yes, completely. All conversions run locally in your browser using JavaScript. No data is sent to any server — there are no network requests, no cookies, no analytics on your input, and zero data storage. Your numbers never leave your device. This tool is ideal for converting sensitive data like memory addresses or proprietary byte sequences.
What is the base 36 number system and where is it used?
Base 36 is the largest alphanumeric base, using digits 0-9 and letters A-Z (where A=10 through Z=35). It is widely used in URL shorteners (e.g., YouTube video IDs), compact unique identifiers, database primary keys, and encoding large numbers into short human-readable strings. For example, the decimal number 1,000,000 becomes LFLS in base 36 — much shorter and easier to share. Base 36 is especially popular in web development for generating slug-friendly identifiers that are both compact and case-insensitive, making them ideal for URLs and short codes.
What is the difference between signed and unsigned number representation?
Unsigned numbers represent only non-negative values (0 and positive). Signed numbers can represent both positive and negative values, typically using two's complement encoding in computers. In two's complement, the most significant bit indicates the sign: 0 for positive, 1 for negative. For example, in 8-bit unsigned, the range is 0-255; in 8-bit signed (two's complement), the range is -128 to 127.
Why do programmers use hexadecimal instead of binary?
Hexadecimal is a compact representation of binary data: each hex digit maps exactly to 4 binary bits (a nibble). This makes hex much easier to read and write than long binary strings. For example, the binary value 11111111 00001010 is simply FF0A in hex. Hex is the standard in memory addresses, color codes (CSS #FF5733), MAC addresses (00:1A:2B:3C:4D:5E), and UUID formatting.
Can this tool handle very large numbers?
Yes. This tool uses JavaScript's BigInt for arbitrary-precision integer arithmetic, so there is no upper limit on the number of digits. You can convert numbers with hundreds or even thousands of digits between any bases from 2 to 36 without losing precision. JavaScript's native Number type is limited to 53-bit integers (up to 9,007,199,254,740,991), but BigInt removes this limitation entirely. Whether you're working with cryptographic hashes, large database IDs, or scientific computations, this tool handles them all accurately.
How do I convert binary to hexadecimal manually?
The simplest method is the 4-bit grouping technique. Starting from the rightmost bit, split the binary number into groups of 4 digits (called nibbles). Pad the leftmost group with leading zeros if needed. Then use this lookup table to convert each group: 0000=0, 0001=1, 0010=2, 0011=3, 0100=4, 0101=5, 0110=6, 0111=7, 1000=8, 1001=9, 1010=A, 1011=B, 1100=C, 1101=D, 1110=E, 1111=F. For example, binary 10101111 splits into 1010 and 1111, which map to A and F, giving hex AF. This works because 16 is a power of 2 (16 = 2⁴), so each hex digit represents exactly 4 binary digits.
How do I convert a negative number between bases?
Negative numbers in computers are typically represented using two's complement. In this system, the most significant bit (MSB) acts as the sign bit: 0 for positive and 1 for negative. To find the two's complement of a number, invert all bits (change 0s to 1s and vice versa) and add 1. For example, to represent -5 in 8-bit binary: start with 5 (00000101), invert to get 11111010, add 1 to get 11111011. This means -5 in 8-bit two's complement is 11111011 in binary or FB in hexadecimal. The range of an n-bit two's complement number is -2^(n-1) to 2^(n-1)-1. This tool converts the magnitude of the number; for signed representations, you would apply two's complement manually.
What is the difference between hexadecimal and decimal?
Decimal (base 10) uses ten digits (0-9) and is the everyday number system humans are most familiar with. Hexadecimal (base 16) uses sixteen symbols (0-9 and A-F) and is the preferred format in computing. The key difference is place value: in decimal, each position represents a power of 10 (1, 10, 100, 1000...), while in hexadecimal each position represents a power of 16 (1, 16, 256, 4096...). For example, the decimal number 255 is FF in hex because 15×16 + 15×1 = 255. Hexadecimal is favored in programming because it maps cleanly to binary — each hex digit represents exactly 4 bits — making it ideal for memory addresses, color codes, and byte-level data.
Why do computers use binary instead of decimal?
Computers use binary (base 2) because their fundamental building blocks — transistors — operate as electronic switches with two states: on (1) and off (0). This maps perfectly to binary digits. Representing decimal digits would require circuits that reliably distinguish between 10 different voltage levels, which is far more complex and error-prone than distinguishing just 2 states. Binary also aligns naturally with Boolean logic (true/false), which forms the foundation of all computer operations. While early computers experimented with ternary (base 3) and decimal systems, binary won out because it offers the best combination of simplicity, reliability, and noise tolerance in electronic circuits.
Why are Unix file permissions represented in octal?
Unix file permissions use three categories — owner, group, and others — each with three permission bits: read (r=4), write (w=2), and execute (x=1). Since 3 bits can represent values 0-7, each category maps perfectly to a single octal digit. For example, permission 755 means: owner has rwx (7 = 4+2+1), group has r-x (5 = 4+0+1), and others have r-x (5 = 4+0+1). Octal is the natural choice because each digit encodes exactly one permission group. In binary, 755 is 111 101 101, which directly shows the rwx bit pattern. This elegant 3-bit-to-1-digit mapping is why chmod uses octal notation.
How are hexadecimal colors used in web development?
In web development, colors are commonly specified in the #RRGGBB hex format, where each pair of hex digits represents one color channel: red, green, and blue. Each channel ranges from 00 (0, no intensity) to FF (255, full intensity). For example, #FF5733 means red=FF (255), green=57 (87), blue=33 (51), producing a vibrant orange-red. There is also a shorthand notation — #F00 expands to #FF0000 (pure red). Modern CSS additionally supports #RRGGBBAA for alpha transparency, where AA ranges from 00 (fully transparent) to FF (fully opaque). Hexadecimal is used because two hex digits perfectly represent one byte (0-255), making it a compact and readable format for color values.
What are the practical applications of base conversion in networking?
Base conversion is essential in networking for working with IP addresses, subnet masks, and MAC addresses. IPv4 addresses like 192.168.1.1 are written in decimal, but subnet calculations require binary. For example, a /24 subnet mask is 11111111.11111111.11111111.00000000 in binary, which is 255.255.255.0 in decimal. Network engineers AND (bitwise) the IP address and subnet mask in binary to determine the network address. MAC addresses use hexadecimal notation (e.g., 00:1A:2B:3C:4D:5E) because each hex pair represents one byte. Understanding base conversion helps you calculate subnets, troubleshoot routing, and analyze packet captures.
How does this tool compare to using programming language built-in conversion functions?
Programming languages offer built-in conversion functions — JavaScript has parseInt() and toString(), Python has bin(), oct(), hex(), and int(). However, this tool provides several advantages: it converts to all common bases simultaneously with real-time updates, requires no coding setup, supports any base from 2 to 36 in one interface, and uses BigInt for arbitrary precision beyond what some language defaults offer. It is ideal for quick lookups, verifying your code's output, learning base conversion concepts visually, and working with bases not directly supported by language built-ins. For production code, use your language's native functions; for exploration and debugging, this tool is faster and more convenient.

Related Tools

View all tools →

Image Compressor

Conversion Tools

Reduce image size up to 80% — compress JPEG, PNG & WebP in your browser, no upload needed. Batch 20 images, adjust quality, compare before & after. Free & private.

Length Unit Converter — Metric, Imperial & More

Conversion Tools

1 inch = 2.54 cm, 1 foot = 0.3048 m, 1 mile = 1.609 km. Convert between 16 length units instantly — metric, imperial, nautical & astronomical. Free, private, runs in your browser.

Temperature Converter — Celsius, Fahrenheit, Kelvin, Rankine

Conversion Tools

0 °C = 32 °F = 273.15 K = 491.67 °R. Convert Celsius, Fahrenheit, Kelvin & Rankine instantly — free, private, browser-based. Includes conversion formulas, step-by-step guides, and reference charts.

Volume & Liquid Measurement Converter — 15 Units

Conversion Tools

1 liter = 0.2642 US gallons, 1 cup = 236.6 mL. Convert volume & liquid capacity between 15 units — metric, US customary, imperial & cooking measurements. Free online converter, 100% private, runs in your browser.

Weight Converter — kg, lbs, oz, g, Stone & 10 More Units

Conversion Tools

1 kg = 2.205 lbs · 1 oz = 28.35 g · 1 stone = 14 lbs. Convert weight between 13 units — metric, imperial & troy. Includes conversion tables, formulas & real-world references. Free, private, runs in your browser.

Base64 Decoder & Encoder

Encoding & Formatting

Decode and encode Base64 online for free. Real-time conversion with full UTF-8 and emoji support. 100% private — runs in your browser. No signup needed.