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).
Free online calculators and tools covering mathematics, unit conversion, text processing, and daily life. Accurate, fast, mobile-friendly, and completely free to use.