Convert values between Binary, Octal, Decimal, and Hexadecimal in real time with instant copy-ready results.
0x, 0b, 0o) before pasting — the tool expects raw digits.Every digital system speaks binary internally, but humans and high-level languages use decimal, octal, and hexadecimal as shorthand for those underlying bits. Converting between bases is how programmers, embedded engineers, security analysts, and CS students translate between the layers — reading a hex memory address back into the binary bit pattern it represents, decoding a Unix chmod number into actual permission bits, or sanity-checking that a hash digest matches a published reference value.
0x7FFF5FBFF8A0). Convert to binary to inspect individual flag bits in a status register, or to decimal when comparing against a printf'd integer.chmod 755 is octal: each digit maps to exactly three permission bits (rwx for owner, group, other). Convert 755 to binary 111 101 101 to see which bits are set. Pair this tool with the chmod calculator for symbolic vs numeric conversions.#FF5733 is three hex bytes for the red, green, and blue channels (255, 87, 51 in decimal). Hex is compact (6 chars for 3 bytes) and aligns to the RGB byte layout. For full color-model translations see the color converter.255.255.255.0 is four bytes shown in decimal; convert each octet to binary (11111111.11111111.11111111.00000000) to see exactly where the network/host boundary falls.| Decimal | Binary (4 bits) | Octal | Hexadecimal |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 3 | 0011 | 3 | 3 |
| 4 | 0100 | 4 | 4 |
| 5 | 0101 | 5 | 5 |
| 6 | 0110 | 6 | 6 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 9 | 1001 | 11 | 9 |
| 10 | 1010 | 12 | A |
| 11 | 1011 | 13 | B |
| 12 | 1100 | 14 | C |
| 13 | 1101 | 15 | D |
| 14 | 1110 | 16 | E |
| 15 | 1111 | 17 | F |
Memorising rows 0-15 makes hex-to-binary conversion instant: every hex digit maps to exactly four binary digits (a "nibble"), so 2A is 0010 1010 without arithmetic.
| Base | Primary uses | Language prefix | Why this base wins |
|---|---|---|---|
| Binary (2) | Hardware bit fields, flag masks, low-level logic | 0b (Python, JS, C++14, Java 7+) |
Native to digital electronics — transistors are on/off |
| Octal (8) | Unix file permissions (chmod 755), some legacy file formats |
0o (Python 3+), leading 0 (C, older Python) |
3 bits per digit aligned to historical 12/24/36-bit word sizes and to the 3-bit rwx permission groups |
| Decimal (10) | Human-facing math, prices, counts, lengths | None | What everyone learned in school; intuitive but awkward for bit-level work |
| Hexadecimal (16) | Memory addresses, MAC addresses, CSS colors, hash digests, byte sequences | 0x (C, Java, JS, Python), # (CSS), &H (BASIC/VB) |
4 bits per digit aligns exactly to 8-bit bytes — one byte = exactly two hex digits |
| Base36 | Reasonably short, case-insensitive IDs (PHP dechex equivalents, some short URLs) |
None | Alphanumeric + case-insensitive, so safe for filesystems and manual entry |
| Base58 | Bitcoin addresses, Ripple wallets, IPFS CIDs | None | Drops easily confused characters (0, O, I, l) so addresses survive being read aloud or hand-copied |
| Base62 | URL shorteners (bit.ly-style), short tokens | None | Maximum compactness from the URL-safe alphanumeric set (0-9, a-z, A-Z) — case-sensitive |
Digital circuits are built from transistors that switch reliably between two voltage states — typically "near 0 V" (off, 0) and "near supply voltage" (on, 1). Two states are far more error-resistant than ten: small voltage fluctuations from heat, electromagnetic noise, or component aging won't flip a 0 to a 1 the way they would corrupt a ten-level signal. Ternary and decimal logic have been built experimentally (Soviet Setun computers used balanced ternary in the late 1950s), but the engineering wins from binary — simpler gates, cheaper memory cells, robust error margins — have kept it dominant for every mainstream architecture since.
Almost exclusively for Unix and Linux file permissions. chmod 755 script.sh sets owner=rwx (7 = binary 111), group=r-x (5 = 101), other=r-x (5 = 101). Octal also survives in a few protocol headers and in language literals — Python 3 writes octal as 0o755 (the 0o prefix was introduced in PEP 3127 to replace the C-style leading 0, which silently interpreted 0755 as octal and confused everyone). Outside of permissions, hex has largely displaced octal because modern machines are byte-oriented and hex aligns cleanly to bytes; octal doesn't.
0x in code and # in CSS?Both signal "hexadecimal follows", but they're conventions from different domains. 0x is the C / Java / JavaScript / Python prefix for hex integer literals, and it works for any length — 0xFF, 0xDEADBEEF, 0x7FFFFFFF. # is the CSS shorthand specifically for hex color codes: #RGB, #RRGGBB, or #RRGGBBAA for alpha. They don't mean the same thing — #FF is not a valid CSS color (you need at least 3 hex digits), and 0xFF is not valid CSS syntax. When pasting a CSS color into this converter, drop the #; when pasting a C literal, drop the 0x.
They are encodings that pack more information per character than hex by using the full alphanumeric set. Base36 uses 0-9 and a-z (case-insensitive, 36 characters). Base62 adds uppercase letters for 62 characters, so it's case-sensitive but more compact — bit.ly-style shorteners use Base62 to keep URLs as short as possible. Base58 is a Bitcoin-era invention that uses 58 characters: Base62 minus 0, O, I, and l because those characters get confused when read aloud or typed. Bitcoin addresses, IPFS content IDs, and Ripple wallet addresses all use Base58Check (Base58 with a built-in checksum), so a single mistyped character is detected before funds are sent. This converter handles bases 2, 8, 10, and 16; for Base58 you'll need a dedicated encoder.
Modern CPUs almost universally use two's complement. To negate a value, you invert every bit and add 1. With 8 bits, +5 is 0000 0101 and -5 is 1111 1011. The most significant bit acts as a sign indicator (0 = positive, 1 = negative), but the encoding is not "sign + magnitude" — it's chosen so that ordinary binary addition just works for signed arithmetic, and there's only one representation of zero. An 8-bit two's complement byte covers -128 to +127; a 32-bit int covers roughly -2.1 billion to +2.1 billion. Older formats like signed-magnitude (sign bit + absolute value) and one's complement still appear in some DSP and legacy hardware, but two's complement is the default for x86, ARM, RISC-V, and effectively every general-purpose CPU shipping today.
Not directly — this converter handles integers. A 32-bit float like 3.14 is stored as 1 sign bit + 8 exponent bits + 23 mantissa bits (IEEE 754 binary32), and reconstructing the float from its bit pattern requires interpreting those three fields with a bias of 127 and an implicit leading 1 in the mantissa. Likewise for 64-bit doubles (binary64: 1/11/52). If you have the raw 32-bit hex representation of a float and want to recover the decimal value, you need a dedicated IEEE 754 converter, not a pure-integer base tool. For checking that a hex byte sequence represents a particular integer, however, this tool gives exact results.
Three reasons: compactness, byte alignment, and history. An sRGB color is three bytes (R, G, B), each 0-255. Written in decimal you'd need up to 11 characters (255,255,255); in hex you need 6 (FFFFFF). Each pair of hex digits is exactly one byte, so designers and developers can mentally split #FF5733 into "red byte FF, green byte 57, blue byte 33". And the convention dates back to early computer graphics hardware where pixel data was already laid out in hex, so when the web's CSS specification needed a color syntax in the mid-1990s, hex was the obvious carry-over from existing tooling.
The converter uses arbitrary-precision arithmetic in JavaScript (BigInt), so there's no 64-bit ceiling — you can paste in hundreds of hex digits and get exact binary, octal, and decimal back. That makes it suitable for inspecting full SHA-256 digests (256 bits / 64 hex chars), RSA moduli, large cryptographic exponents, and any value that overflows standard 32-bit or 64-bit integer types. The only practical limit is browser memory; multi-million-digit inputs will get slow, but anything in the kilobit range is instant.
No — ff, FF, and Ff are all 255. Most programming styles pick one and stick with it for readability: lowercase (0xff) is common in C, Go, and Rust; uppercase (0xFF) is common in older Windows / x86 documentation and assembly listings. CSS treats hex colors as case-insensitive, but designers usually pick lowercase for consistency with the rest of their stylesheet. This converter accepts any mix and outputs uppercase in the hex field.