Skip to main content

    Number Base Converter

    Convert numbers between decimal, binary, octal, and hexadecimal. Instant results as you type.

    Free to use. Runs in your browser.

    Enter a number in decimal, binary, octal, or hexadecimal to see it converted to all other bases simultaneously. Supports up to 64-bit integers.

    Number Bases: How Computers Count

    Humans count in base 10 (decimal) because we have 10 fingers. Computers count in base 2 (binary) because transistors have two states: on and off. But binary is tedious for humans, 11111111 is easier to read as FF (hexadecimal, base 16) or 255 (decimal).

    Hexadecimal (base 16) is everywhere in computing: colour codes (#FF5733), memory addresses, MAC addresses, and Unicode code points. Octal (base 8) appears in Unix file permissions (chmod 755). Binary shows up when working with bitwise operations, network masks, and low-level protocols.

    This converter handles any base from 2 to 36. Enter a number in one base, see it instantly in all others. It handles large numbers, negative values, and validates input for the selected base.

    Common Number Bases

    BaseNameDigits UsedWhere You See It
    2Binary0, 1Low-level computing, network masks, flags
    8Octal0 to 7Unix file permissions (chmod 755)
    10Decimal0 to 9Everyday numbers, most user interfaces
    16Hexadecimal0 to 9, A to FColours (#FF5733), addresses, UUIDs
    32Base32A to Z, 2 to 7TOTP secrets (2FA authenticator apps)
    36Base360 to 9, A to ZURL shorteners, compact IDs

    What this means for you: Most developers only need decimal, hexadecimal, and binary. Octal matters for Unix permissions. Base36 is useful for short URL-safe identifiers (toString(36) in JavaScript).

    Practical Base Conversion Examples

    DecimalBinaryHexOctalContext
    25511111111FF377Max byte value, RGB channel max
    4201101001001A4644Unix file permission (rw-r--r--)
    4931111011011ED755Unix file permission (rwxr-xr-x)
    655351111111111111111FFFF177777Max 16-bit unsigned integer
    16777215111111111111111111111111FFFFFF77777777White colour (#FFFFFF)

    Quick Conversion Tricks

    Hex → Binary (by hand)

    Each hex digit maps to exactly 4 binary digits. F = 1111, A = 1010, 0 = 0000. So FF = 11111111, and A3 = 10100011. This is why hex and binary are so closely related.

    Powers of 2 to memorise

    2⁸ = 256, 2¹⁰ = 1024 (1K), 2¹⁶ = 65536, 2³² = ~4.3 billion. These come up constantly in byte limits, colour depth, integer ranges, and memory addressing.

    JavaScript shortcuts

    0xFF (hex), 0b11111111 (binary), 0o377 (octal), all equal 255 in JS. Use parseInt("FF", 16) and (255).toString(16) for conversions in code.

    Subnet masks

    255.255.255.0 in binary is 11111111.11111111.11111111.00000000, that's /24 in CIDR notation. Understanding binary makes network masks intuitive.

    Related Tools

    How to use this tool

    1

    Enter a number in the input field

    2

    Select the base your number is in (decimal, binary, octal, or hex)

    3

    See instant conversions to all four bases

    Common uses

    • Converting hex colour codes to RGB decimal values
    • Understanding Unix file permissions in octal
    • Working with binary subnet masks and IP addresses
    • Debugging memory addresses and byte values in hex

    Share this tool

    Frequently Asked Questions

    What is a number base?
    A number base (or radix) defines how many unique digits a counting system uses. Decimal uses 10 digits (0-9) because humans have 10 fingers. Binary uses 2 (0 and 1) because transistors have two states. Hexadecimal uses 16 (0-9 plus A-F) because it maps neatly to 4-bit groups.
    Why do developers use hexadecimal?
    Hex is compact and maps perfectly to binary. One hex digit represents exactly 4 binary bits, so a byte (8 bits) is always 2 hex digits. FF is easier to read than 11111111. That's why colour codes (#FF5733), memory addresses, and byte values all use hex.
    What is octal?
    Octal (base 8) uses digits 0 through 7. Each octal digit represents exactly 3 binary bits. It's primarily used in Unix/Linux file permissions, chmod 755 means rwxr-xr-x. Outside of permissions, octal is rarely used in modern development.
    How do I convert binary to decimal manually?
    Multiply each binary digit by its positional power of 2, then add the results. For 1011: (1×8) + (0×4) + (1×2) + (1×1) = 11 in decimal. The rightmost digit is 2⁰, then 2¹, 2², and so on moving left.
    What does 0x mean in code?
    0x is the prefix for hexadecimal numbers in most programming languages (JavaScript, Python, C, Java). So 0xFF means 255 in decimal. Similarly, 0b means binary (0b1010 = 10) and 0o means octal (0o755 = 493).
    Why are colours written in hexadecimal?
    Each colour channel (red, green, blue) ranges from 0-255, which is exactly one byte. In hex, that's 00-FF, two digits per channel. So #FF5733 means red=255, green=87, blue=51. It's compact, widely understood, and maps directly to how computers store colour data.
    What's the largest number this tool can convert?
    JavaScript safely handles integers up to 2^53 - 1 (9,007,199,254,740,991). Beyond that, precision is lost. For larger numbers, you'd need a BigInt-based converter. For most practical use cases, colours, permissions, byte values, this range is more than sufficient.
    How is base 36 useful?
    Base 36 uses all 10 digits plus 26 letters (A-Z), producing the shortest possible alphanumeric representation of a number. URL shorteners like bit.ly use it to create compact IDs. In JavaScript, (1234567890).toString(36) gives 'kf12oi', much shorter than the decimal version.
    What's the connection between binary and file sizes?
    File sizes use powers of 2 because computers think in binary. 1 KB = 1024 bytes (2^10), 1 MB = 1,048,576 bytes (2^20). The 'kilo = 1000' vs 'kibi = 1024' debate exists because humans prefer powers of 10, but hardware uses powers of 2.
    Why do MAC addresses use hexadecimal?
    MAC addresses are 48 bits (6 bytes), written as 6 pairs of hex digits separated by colons: AA:BB:CC:DD:EE:FF. Hex is the natural choice because each pair represents one byte cleanly. Writing 48 binary digits would be unreadable.
    Is the conversion done on a server?
    No. All conversions happen in your browser using JavaScript's built-in parseInt() and toString() methods. Nothing is transmitted. The tool works completely offline.
    How do subnet masks relate to binary?
    Subnet masks like 255.255.255.0 are really about binary. In binary, that's 11111111.11111111.11111111.00000000, twenty-four 1s followed by eight 0s. That's why it's written as /24 in CIDR notation. Understanding binary makes networking click.

    Results are for general informational purposes only and should be checked before use. They are not professional advice. See our Disclaimer and Terms of Service.