Developer Tools

Binary, Hex, Octal & Decimal Converter Online Free

Number bases are the alphabet of computing. Binary drives every bit of logic your CPU executes, hexadecimal makes memory addresses and color codes human-readable, and octal still shows up every time you run chmod 755. This guide explains each base, how to convert between them manually, and how to do it instantly with a free online tool — no account, no upload, no server.

By · July 2, 2026 · 8 min read · Updated July 2026
Key Takeaways

  • Binary (base-2), octal (base-8), decimal (base-10), and hexadecimal (base-16) all represent the same numbers — just in different symbol systems
  • Use FusionPDF's Number Base Converter to convert any value across all four bases instantly
  • Manual binary-to-decimal: multiply each bit by its power of 2 and sum the results
  • Negative integers use two's complement — invert all bits, then add 1
  • Language prefixes: 0b = binary, 0o = octal (Python), 0x = hex (JS, Python, C, Java)
  • Hex is used in HTML/CSS colors because two hex digits represent exactly one byte (0–255) per color channel

Every number base is just a counting system that runs out of single digits at a different point. Decimal runs out at 9 and carries over to the next column. Binary runs out at 1. Hexadecimal runs out at F. Understanding this one principle unlocks all the rest.

The Four Number Bases — What Each One Is For

Binary (base-2) is the only base computers actually operate in — every value in memory is ultimately stored as a sequence of bits (0s and 1s). The other bases exist because humans need more compact or meaningful ways to read those values. Octal, decimal, and hexadecimal are all just different lenses for viewing the same underlying binary data.

Binary — Base-2

The language of hardware

Uses only digits 0 and 1. Every CPU instruction, every memory value, every network packet is stored as binary at the lowest level.

  • Used in bitwise operations (&, |, ^, ~)
  • 8 bits = 1 byte (values 0–255)
  • Prefix in code: 0b (JS, Python)
  • Example: 0b11111111 = 255
Hexadecimal — Base-16

The developer's shorthand

Uses digits 0–9 and letters A–F. One hex digit represents exactly 4 bits, so two hex digits represent one byte — making hex an extremely compact notation for binary data.

  • Memory addresses: 0x7FFF5FBFF8A0
  • HTML/CSS colors: #FF5733
  • Prefix in code: 0x
  • Example: 0xFF = 255

Octal (base-8)

Octal uses digits 0–7. It maps cleanly to groups of 3 bits, which made it popular on early computing systems where word sizes were multiples of 3. Today its most visible use is Unix/Linux file permissions. When you run chmod 755, those three digits are octal — 7 (rwx), 5 (r-x), 5 (r-x) — each representing a 3-bit permission mask for owner, group, and others. The Python prefix for octal literals is 0o (e.g., 0o755).

Decimal (base-10)

Decimal is the system humans use for everyday counting, with digits 0–9. It has no special role in hardware but it's what you see in most user-facing numbers. Interestingly, decimal is the hardest base to work with programmatically at the bit level — which is why developers constantly switch between decimal and the other three.

How to Use the Converter (3 Steps)

FusionPDF's Number Base Converter runs entirely in your browser. Type in any number in any base and instantly see all four representations simultaneously. There is no server request, no rate limit, and no signup — just open the tool and start converting.

1

Open the tool. Go to fusionpdf.pro/number-base-converter. No account required. The tool loads entirely client-side — nothing is sent anywhere.

2

Enter your number and select its base. Type your value into the input field — for example 11111111 for binary, or FF for hex — and select the source base from the dropdown. Valid characters are automatically enforced: binary accepts only 0 and 1, hex accepts 0–9 and A–F (case-insensitive).

3

Read the instant results. As you type, all four base representations update in real time: binary, octal, decimal, and hexadecimal. Click any result to copy it to the clipboard in one click.

Tip: The converter accepts the standard language prefixes as well. Type 0xFF and select Hexadecimal, or 0b1010 and select Binary — the tool strips the prefix automatically and converts the value.

Why Developers Work in Multiple Bases

Most developers learn decimal in school and only encounter other bases on the job. Each base shows up in specific, recurring contexts — and knowing which context calls for which base saves constant mental overhead. Here are the situations where each base earns its place.

Binary: bitwise operations and flags

When you work with bitwise operators — &, |, ^, ~, <<, >> — you're operating directly on bit patterns. Reading the operands in binary makes the operations immediately legible. For example, 0b10110101 & 0b00001111 visually shows you which bits survive the AND mask (the lower nibble). Reading those same values in decimal (181 & 15) gives you the right answer but hides the structure.

Hexadecimal: memory, colors, and bytes

Hex is the standard notation for memory addresses, byte sequences, cryptographic hashes, and HTML colors. Two hex digits represent exactly one byte (8 bits), so a 32-bit address becomes eight hex digits — compact and predictable. The color #FF5733 encodes three independent byte values (R=255, G=87, B=51) in six characters. Without hex you'd need to write rgb(255,87,51) every time.

Octal: Unix permissions

Unix file permissions are stored as 9 bits: 3 bits each for owner (user), group, and others. Each 3-bit group maps directly to one octal digit (0–7), where 4=read, 2=write, 1=execute. chmod 755 means rwxr-xr-x: the owner has all three permissions (4+2+1=7), group and others have read and execute (4+1=5). This is a perfect example of octal encoding three independent boolean flags per digit.

16
unique values per hex digit One hexadecimal digit encodes exactly 4 bits — 24 = 16 states. This is why hex is the natural shorthand for binary: two hex digits (00–FF) represent one full byte (8 bits, 256 states) with zero waste and zero ambiguity.

Manual Conversion Methods Explained

Understanding manual conversion is worth the investment even if you use a tool every day. It builds an intuition for bit patterns that makes debugging faster and code review sharper. The three most common conversions each have a clean mechanical method.

Binary to decimal: sum of powers of 2

Write down the binary number. Label each bit position from right to left starting at 0. Multiply each bit (0 or 1) by 2 raised to its position, then sum the results where the bit is 1.

Example: 1011 in binary.

  • Position 3: 1 × 2³ = 1 × 8 = 8
  • Position 2: 0 × 2² = 0 × 4 = 0
  • Position 1: 1 × 2¹ = 1 × 2 = 2
  • Position 0: 1 × 2⁰ = 1 × 1 = 1
  • Total: 8 + 2 + 1 = 11 in decimal

Hexadecimal to decimal: sum of powers of 16

The same approach applies, but each position is a power of 16. Letters A–F have values 10–15.

Example: 2F in hex.

  • Position 1: 2 × 16¹ = 2 × 16 = 32
  • Position 0: F × 16⁰ = 15 × 1 = 15
  • Total: 32 + 15 = 47 in decimal

Decimal to binary: repeated division by 2

Divide the decimal number by 2. Record the remainder (0 or 1). Divide the quotient by 2 again. Repeat until the quotient is 0. The binary result is the remainders read from bottom to top.

Example: convert 13 to binary.

  • 13 ÷ 2 = 6 remainder 1
  • 6 ÷ 2 = 3 remainder 0
  • 3 ÷ 2 = 1 remainder 1
  • 1 ÷ 2 = 0 remainder 1
  • Reading remainders bottom to top: 1101

Verify: 1×8 + 1×4 + 0×2 + 1×1 = 8+4+1 = 13. Correct.

The positional notation system underpinning all number bases was formalized in mathematics long before digital computers existed. Binary was chosen for electronics because two states (on/off, high/low voltage) are trivial to implement reliably in hardware — far more reliable than the ten discrete voltage levels that decimal would require. Knuth, Donald E. The Art of Computer Programming, Vol. 2: Seminumerical Algorithms. Addison-Wesley, 1997.

Quick Reference Table: 0–15 in All Four Bases

The values 0–15 are the most frequently looked-up range because they cover one hex digit and one 4-bit nibble. Memorizing this table is worth doing — it makes reading hex values and binary bit patterns much faster in practice.

Decimal Binary Octal Hexadecimal
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

Notice that the binary column fills in a pattern — the rightmost bit alternates every 1, the second bit alternates every 2, the third every 4, the fourth every 8. This pattern is predictable and is exactly how binary counting works: each column represents the next power of 2.

Two's Complement and Negative Numbers

Standard binary has no sign — every bit pattern is a non-negative integer. To represent negative numbers, virtually all modern CPUs and programming languages use two's complement encoding. It's the standard for signed integer types in C, Java, Python, JavaScript, and Rust.

How two's complement works

In an 8-bit two's complement system, the most significant bit (leftmost) is the sign bit: 0 means positive, 1 means negative. To negate a number:

  1. Invert all bits (flip every 0 to 1 and every 1 to 0). This is called the bitwise NOT or one's complement.
  2. Add 1 to the result.

Example: convert +5 to −5 in 8-bit two's complement.

  • +5 in binary: 00000101
  • Invert all bits: 11111010
  • Add 1: 11111011
  • Result: 11111011 = −5 in 8-bit two's complement

Why this system? Two's complement has a crucial property: addition works the same for both positive and negative numbers without any special hardware. The CPU can use one adder circuit for all signed arithmetic. This is why two's complement was adopted universally and why the system has one zero (unlike sign-magnitude, which has +0 and −0).

The range of an n-bit two's complement integer is −2n-1 to +2n-1−1. For 8 bits: −128 to +127. For 32 bits: −2,147,483,648 to +2,147,483,647. This asymmetry (one more negative than positive) comes from the single zero representation.

Watch out for overflow: When you add two large positive 8-bit numbers and the result exceeds 127, the sign bit flips and the result appears negative. This is integer overflow — one of the most common sources of subtle bugs in systems code. 127 + 1 = -128 in signed 8-bit arithmetic.

Bitwise Operators in JavaScript and Python

Bitwise operators work directly on the binary representation of integers. Understanding what you're operating on — the actual bit patterns — requires being comfortable reading numbers in binary or hex. A base converter is an essential companion when working with bitwise logic.

Operator Name JS / Python What it does
& AND a & b Output bit is 1 only if both input bits are 1. Used to mask (isolate) specific bits.
| OR a | b Output bit is 1 if either input bit is 1. Used to set (turn on) specific bits.
^ XOR a ^ b Output bit is 1 if input bits differ. Used to toggle specific bits or simple encryption.
~ NOT ~a Inverts all bits. In Python/JS: ~x equals -(x+1) due to two's complement.
<< Left shift a << n Shifts bits left by n positions, filling with zeros. Equivalent to multiplying by 2n.
>> Right shift a >> n Shifts bits right by n positions. Equivalent to integer division by 2n. Sign-extends in JS/Python.

Where base conversion helps with bitwise ops

When you're debugging a bitwise expression like (flags & 0x0F) >> 4, the fastest way to understand it is to convert the hex mask (0x0F = 00001111 in binary) and trace through the operation bit by bit. A good base converter lets you paste in the hex mask and immediately see the binary representation, making the logic obvious.

Similarly, when building a bitmask for a set of permission flags, you'll often calculate the value in binary (where you can see exactly which bits are set), then use the hex equivalent in code for compactness. The workflow is: design in binary, implement in hex, verify with a converter.

Language Prefixes: 0b, 0x, 0o

Most programming languages descended from C use a standard set of prefix notation to mark integer literals in non-decimal bases. These prefixes are parsed at compile or interpret time and have no runtime cost — they're purely a readability convention for source code.

  • 0b — binary. Available in JavaScript (ES6+) and Python 3. Example: 0b1010 = 10. In Python, bin(10) returns '0b1010' and int('1010', 2) converts a binary string without the prefix.
  • 0x — hexadecimal. The oldest and most widely supported prefix, inherited from C. Works in C, C++, Java, JavaScript, Python, Rust, Go, Swift, Kotlin, and essentially every language derived from C. Example: 0xFF = 255. Case-insensitive: 0xFF, 0xff, and 0XFF are all equivalent.
  • 0o — octal (Python 3). Python 3 uses 0o for octal literals to avoid ambiguity. In Python 2, a leading 0 alone (e.g., 0755) meant octal — a notorious source of bugs that Python 3 fixed by requiring the explicit 0o prefix. In JavaScript, octal literals use 0o as well (strict mode) or a bare leading zero in non-strict mode (legacy, avoid).

Python tip: The built-in functions bin(), oct(), and hex() convert any integer to a prefixed string. int(string, base) converts from any base string to decimal. Example: int('FF', 16) = 255, int('0b1010', 2) raises ValueError — strip the prefix first, or use int('1010', 2).

FusionPDF vs RapidTables vs CyberChef

Several free tools handle base conversion. The differences are in scope, interface speed, privacy, and what extra context they provide. Here is an honest comparison of the three most-used options.

Feature FusionPDF RapidTables CyberChef
Bases covered 2, 8, 10, 16 2, 8, 10, 16 2–36 (any base)
Realtime conversion Yes Yes Recipe-based
Privacy (no server) Yes — 100% local Unclear Yes — open source
Two's complement Shown Separate tool Via recipe
Ads / clutter None Heavy ads None
Mobile usability Optimized Workable Complex interface
Learning curve Minimal Minimal Steep (for new users)

CyberChef is the most powerful option if you need exotic bases (base-3, base-36) or want to chain conversions with other operations like XOR or encoding. For everyday binary-to-decimal and hex work, a simpler tool is faster to reach for. RapidTables covers the basics but its ad density makes it frustrating on mobile. FusionPDF's converter prioritizes speed and a clean interface, with two's complement displayed inline rather than requiring a separate lookup.

Frequently asked questions
What is 0xFF in decimal?

0xFF is 255 in decimal. The 0x prefix marks hexadecimal. FF in hex is 15×16¹ + 15×16⁰ = 240 + 15 = 255. In binary it's 11111111 — all 8 bits set to 1, which is the maximum value of an unsigned 8-bit integer (one byte). You'll see 0xFF constantly in color values (where #FFFFFF is white), byte masks, and network programming.

How do I convert negative numbers in binary?

Negative integers in binary use two's complement. To convert a positive binary number to its negative: (1) invert all bits (flip every 0 to 1 and every 1 to 0), then (2) add 1. For example, +5 in 8-bit binary is 00000101. Invert to get 11111010, add 1 to get 11111011, which represents −5. To verify: add the original and its two's complement and you get 100000000 — the carry bit overflows out of 8 bits, leaving zero. This overflow-to-zero property is exactly why two's complement works for signed arithmetic.

What does 0b mean in Python?

The 0b prefix in Python (and JavaScript ES6+) indicates a binary integer literal. For example, 0b1010 equals 10 in decimal. Python provides complementary built-in functions: bin(10) returns the string '0b1010', and int('1010', 2) parses a binary string (without the prefix) back to an integer. Python also supports 0o for octal literals (e.g. 0o755 = 493) and 0x for hex literals (e.g. 0xFF = 255).

What is the 0x prefix?

The 0x prefix marks a hexadecimal (base-16) number literal in most programming languages: C, C++, Java, JavaScript, Python, Rust, Go, Swift, and many others. For example, 0x1F equals 31 in decimal (1×16 + 15). The convention originated in the C language in the 1970s and spread to virtually every language derived from it. When you see 0x in memory addresses, color codes, byte constants, or bitfield masks, the digits that follow are always hexadecimal — using digits 0–9 and letters A–F.

Why is hexadecimal used in HTML colors?

HTML color codes like #FF5733 use hexadecimal because each color channel — red, green, blue — spans 0 to 255, which fits exactly into two hex digits (00 to FF). The six-character #RRGGBB format encodes three independent byte values in a compact, visually separable string. #FF0000 is pure red (R=255, G=0, B=0), #00FF00 is pure green. In decimal, you'd need rgb(255, 0, 0) — more characters and harder to parse at a glance. Hex also maps directly to how color data is packed in memory and on the GPU: one byte per channel, three channels, six hex digits total.

Convert Binary, Hex & Octal — Free, Instant, No Signup

Enter any number in any base and see all four representations at once. Runs entirely in your browser — nothing sent to any server.