XConvert
Downloads
Pricing

Online Number Base Converter

Convert values between Binary, Octal, Decimal, and Hexadecimal in real time with instant copy-ready results.

How to Convert Between Number Bases Online

  1. Enter Your Number in Any Base: Type or paste a value into the Binary (Base 2), Octal (Base 8), Decimal (Base 10), or Hexadecimal (Base 16) field. Use 0/1 for binary, 0-7 for octal, 0-9 for decimal, and 0-9 / A-F for hex (case insensitive). Drop any language prefix (0x, 0b, 0o) before pasting — the tool expects raw digits.
  2. Watch All Four Bases Update in Real Time: The other three fields recompute as you type. There is no Convert button — every keystroke re-derives binary, octal, decimal, and hex simultaneously, so you can compare representations side by side without losing context.
  3. Copy Individual Values or All Four: Tap the Copy icon next to any base to send that single value to your clipboard, or use Copy All to grab every representation at once — useful when you're pasting into a comment that needs both the hex address and the decimal equivalent.
  4. Reset with Clear: Hit Clear to wipe all four fields and start a new conversion. Everything runs client-side in your browser session — values are never sent to a server, never logged, and never stored after you close the tab.

Why Convert Between Number Bases?

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.

  • Reading memory dumps and register values — Debuggers, disassemblers, and kernel panics all show addresses in hex (0x7FFF5FBFF8A0). Convert to binary to inspect individual flag bits in a status register, or to decimal when comparing against a printf'd integer.
  • Decoding Unix file permissions — 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.
  • CSS and design system color codes — #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.
  • Inspecting hash digests and checksums — SHA-256 and MD5 outputs are displayed as hex. When you need to verify byte-by-byte against a published value, convert pairs of hex digits to decimal or binary to reason about the underlying bytes. The hash generator outputs hex digests that pair directly with this converter.
  • Subnet masks and IP arithmetic — A subnet mask like 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.
  • Computer architecture and assembly coursework — Two's complement, sign extension, masking, shifting, and Boolean ops all become intuitive once you can move fluently between bases. Use the converter to verify hand calculations.

Number Base Quick Reference (0-15)

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.

Where Each Base Shows Up in Practice

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

Frequently Asked Questions

Why do computers use binary instead of decimal?

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.

When is octal still used today?

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.

What's the difference between 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.

What are Base36, Base58, and Base62, and why do URL shorteners care?

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.

How are negative numbers represented in binary?

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.

Can I use this for IEEE 754 floating-point numbers?

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.

Why are colors written in hex instead of decimal?

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.

How large a number can I convert?

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.

Does case matter in hex?

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.

Image Tools

Image CompressorCompress JPEGCompress PNGCompress GIFCompress WebPImage ConverterJPG ConverterImage Resizer

Video Tools

Video CompressorCompress MP4MP4 to GIFVideo to GIFVideo ConverterMP4 ConverterVideo Cutter

Audio Tools

Audio CompressorCompress MP3Compress WAVAudio ConverterMP3 ConverterFLAC to MP3Audio Cutter

Document Tools

Compress PDFMerge Images to PDFSplit PDFPDF to JPGUnzip FilesRAR Extractor
© 2026 XConvert.com. All Rights Reserved.
About UsPrivacy PolicyTerms of ServiceContactHelp Us Grow