IP331.com | Online Tools
HomeBase ConverterPrefixed Base Conversion Tool

Prefixed Base Conversion Tool

Convert numbers with 0x (hex), 0b (binary), 0o (octal) prefixes to all bases

Prefixed Number (e.g., 0xFF, 0b1010, 0o755)

Common Programming Prefixes

0x or 0X = Hexadecimal (base 16)
0b or 0B = Binary (base 2)
0o or 0O = Octal (base 8)
0d or no prefix = Decimal (base 10)

These prefixes are standard in C, C++, Java, JavaScript, Python, Ruby, Go, Rust, and many other programming languages.

Note: In some languages (like older C), a leading 0 alone indicates octal. This tool uses explicit 0o for octal to avoid confusion.

What Are Prefixed Number Notations?

Prefixes tell programming languages and humans which base a number is in. They make code clearer and prevent ambiguity.

Hexadecimal (0x)

Base16, uses 0-9, A-F. Common for memory addresses, colors (0xFF0000), and binary data.

Binary (0b)

Base2, uses 0-1. Perfect for bitmask flags and low-level programming (0b1010).

Octal (0o)

Base8, uses 0-7. Used historically for Unix file permissions (0o755).

Decimal (0d)

Base10, uses 0-9. Our everyday number system, rarely needs a prefix!

💡 Teaching Example: 0xFF (hex) = 255 (decimal) = 0o377 (octal) = 0b11111111 (binary). All represent the same value!

Applications

Programming Web Development Systems Programming Education Debugging

Frequently Asked Questions

What are programming prefixes 0x, 0b, 0o?
In programming languages like C, Java, Python, prefixes indicate the base: 0x = hexadecimal (base16), 0b = binary (base2), 0o = octal (base8), and 0d or no prefix = decimal (base10).
How do you convert a prefixed number?
First identify the base from the prefix, then convert the number to decimal, then convert from decimal to the target base. This tool automates this process!
Which programming languages use these prefixes?
C, C++, Java, JavaScript, Python, Ruby, Go, Rust, and many others use 0x for hex, 0b for binary, and 0o for octal (some use 0 for octal too).
Can I use lowercase or uppercase prefixes?
Yes! 0x, 0X, 0b, 0B, 0o, 0O are all valid. Digits A-F in hex can also be lowercase or uppercase (0xFF or 0xff both work).

More Base Converter Tools

Free online calculators and tools covering mathematics, unit conversion, text processing, and daily life. Accurate, fast, mobile-friendly, and completely free to use.

© 2026 IP331.com — Free Online Tools. All rights reserved.

About · Contact · Privacy Policy · Cookie Policy · Terms of Use · Disclaimer · Sitemap