DevToolsForYou
Private by defaultRuns in your browser

Binary / Hex / Octal converter

Enter a number in any base — binary, octal, decimal, or hex — and see the equivalent in all other bases instantly.

BIN—
OCT—
HEX—
DEC—
Quick samplesClick to load
Base Converter

About this tool

Different bases exist because different problems have different natural units. Binary maps directly onto hardware, where everything is ultimately a switch, but it is unreadable at any length — a 32-bit value is thirty-two characters of ones and zeros. Hexadecimal solves that by packing exactly four bits into each digit, so one byte is always two hex characters and the mapping stays exact rather than approximate. That is why hex dominates anywhere bytes matter: memory addresses, colour codes, MAC addresses, file signatures, hashes, and bitmask constants. Octal packs three bits per digit and survives mainly in Unix file permissions, where the three permission bits per class map onto one octal digit, which is the entire reason chmod 755 is written that way. Reading a bitmask is where base conversion earns its keep — a flags value of 0x2A means nothing until you see it as 101010 and can pick out which bits are set. This converter shows a number in binary, octal, decimal, and hexadecimal simultaneously, updating every representation as you type in any one of them, entirely in your browser.

No signup requiredRuns in your browserInstant results
How to use
  1. 1

    Enter a number in any base — decimal, binary, hexadecimal, or octal.

  2. 2

    All other representations update instantly.

  3. 3

    Use it for bitwise operations, memory addresses, color codes, or learning number systems.

Why use this tool?
  • →

    Convert a hex colour or memory address to binary for bit-level inspection.

  • →

    Check octal file permission values (e.g. 755) in binary or decimal.

  • →

    Translate between bases when reading assembly, low-level code, or network documentation.

ExamplesInput → output

Decimal to all bases

Input255 (decimal)
OutputBinary: 11111111 | Hex: FF | Octal: 377

Hex to decimal

Input0xFF
Output255

Binary to decimal

Input1010
Output10
Common errorsAnd how to fix them

A hex value is interpreted as decimal

Cause: Digits 0 through 9 are valid in every base, so 100 is a legitimate number in binary, octal, decimal, and hex — with four different values. Without a prefix there is nothing to disambiguate it.

Fix: Enter the value in the field for its actual base. When writing values in code, use the standard prefixes — 0x for hex, 0b for binary, 0o for octal — so the intent is explicit.

A leading zero changes the value in my code

Cause: In C, Java, Go, and JavaScript's non-strict legacy mode, a leading zero marks an octal literal, so 0755 is 493 rather than 755. Python 3 rejects it outright.

Fix: Use the explicit 0o prefix for octal and strip leading zeros from decimal literals. This bites hardest with zero-padded data such as postcodes and account numbers pasted into source code.

Large values come back wrong

Cause: JavaScript bitwise operations coerce to 32-bit signed integers, so values above 2147483647 wrap to negative, and integers beyond about nine quadrillion lose precision as doubles.

Fix: For 64-bit values, use BigInt in JavaScript and the appropriate fixed-width integer type in other languages. Watch for sign extension when converting a value with the high bit set.

Frequently asked questionsCommon questions answered

These answers explain common base converter tasks, expected input formats, and edge cases so both visitors and search engines can understand what this tool does.

What number bases does this tool support?

Binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Enter a value in any one and the other three update instantly.

Can I enter hex values with the 0x prefix?

Yes. Common prefixes like 0b (binary), 0o (octal), and 0x (hex) are stripped automatically before conversion.

What is the maximum number supported?

The tool safely handles integers up to 2⁵³ − 1 (Number.MAX_SAFE_INTEGER), which covers all practical use cases including 32-bit and 64-bit values.

How do I convert binary to hexadecimal?

Select Binary as the input base, type your binary number (e.g. 11111111), and the tool instantly shows the hexadecimal equivalent (FF) alongside octal (377) and decimal (255). No manual grouping into nibbles required.

What does the 0x prefix mean in hexadecimal?

0x is a conventional prefix used in programming languages like C, Python, and JavaScript to indicate that a number literal is in base 16 (hexadecimal). For example, 0xFF equals 255 in decimal. This tool accepts values with or without the prefix.