Number Base Converter

Convert numbers between binary, decimal, hexadecimal, and octal instantly in your browser — auto-detects the base from a 0x/0b/0o prefix, or assumes decimal.

0 chars 0 Bytes

What Are Number Bases?

A number base (or radix) is the count of unique digits a numbering system uses before it carries over to the next place value. Decimal (base 10) is what people use day to day, with digits 0-9. Computers work natively in binary (base 2, digits 0-1), and programmers often use hexadecimal (base 16, digits 0-9 and A-F) or octal (base 8, digits 0-7) as more compact, human-friendlier stand-ins for binary.

The same value can be written in any of these — 255 in decimal is 11111111 in binary, FF in hex, and 377 in octal. They're not different numbers, just different notations for the same quantity.

At a Glance
Instant, in your browser No upload, no server round-trip
All 4 bases at once Binary · Octal · Decimal · Hex
Arbitrary precision Accurate even for very large numbers

Why Convert Between Bases?

Binary is what hardware actually stores, but it's long and error-prone to read or type by hand. Hex compresses every 4 binary digits into 1 character, which is why color codes, memory addresses, and byte values are almost always written in hex. Octal shows up in older Unix file permissions (chmod 755). Converting between them is a routine part of low-level debugging, bit manipulation, and reading hardware or protocol documentation.

How This Tool Works

Type one or more numbers, one per line — plain digits for decimal, or a 0x/0b/0o prefix for hex/binary/octal. Click Convert and get all four representations for each. Everything runs in your browser using arbitrary-precision arithmetic, so even very large numbers convert accurately. Nothing is uploaded to any server.

Binary vs. Decimal vs. Hex vs. Octal

BaseRadixDigits UsedExample (255)Common Use
Binary20-111111111What hardware actually stores
Octal80-7377Unix file permissions (chmod)
Decimal100-9255Everyday human arithmetic
Hexadecimal160-9, A-FFFColor codes, memory addresses, byte values

Use Binary When

  • You're working directly with bitwise operations, flags, or hardware registers
  • You need to see exactly which individual bits are set

Use Hex When

  • You're reading a color code, a memory address, or a byte dump
  • You want a compact, copy-pasteable stand-in for binary (4 bits per hex digit)

Use Octal When

  • You're setting Unix/Linux file permissions
  • You're reading legacy code or protocols that still use octal literals

Use Decimal When

  • You're communicating a value to a person, not a machine

Common Scenarios for Converting Number Bases

Reading a Hex Color Code or Memory Address

Hex values like #FF6B35 or a debugger's memory address are common in day-to-day development, but doing arithmetic on them (is this address within that range?) is much easier once you see the decimal equivalent.

Setting Unix File Permissions

Commands like chmod 755 use octal notation for read/write/execute permissions. Converting between octal and binary makes it clear exactly which permission bits (owner, group, other) a given number actually sets.

Debugging Bitwise Logic

When working with flags, masks, or bitwise operators (&, |, ^), seeing a value's binary representation makes it obvious which bits are set — much harder to eyeball from the decimal or hex form alone.

Decoding a Token or Header Value

Some low-level protocols and tokens encode fields as hex or binary values. If you're also working with a Base64-encoded token like a JWT, our JWT Decoder handles that specific format directly — this tool is for the raw numeric values inside it.

Checking a Value During Code Review

When reviewing code that hardcodes a hex or binary literal (0x1F4, 0b1010), converting it to decimal on the spot confirms whether the value is what the comment or variable name claims it is.

Other Ways to Convert Number Bases

You can also convert between number bases using your calculator app's programmer mode, or a quick command in your language's REPL (Python's bin(), hex(), and oct(), for example). FileCast is useful for a quick, one-off conversion without switching apps.

Frequently Asked Questions

Is my data uploaded anywhere?

No. Every conversion happens entirely in your browser — nothing is sent to any server.

How do I tell the tool which base my number is in?

Prefix it: 0x for hexadecimal, 0b for binary, 0o for octal. Plain digits with no prefix are read as decimal. A number containing only the letters A-F with no prefix (like FF) is automatically treated as hex, since it can't be anything else.

Can I convert more than one number at a time?

Yes. Put each number on its own line, and the tool converts all of them in one pass, showing all four representations for each.

Does this handle negative numbers?

Yes — prefix a number with - and the sign is preserved across all four output representations. Note this is a simple signed magnitude (a minus sign shown in front), not two's complement binary representation.

Does this handle very large numbers?

Yes. Conversions use arbitrary-precision arithmetic, so numbers far larger than what a 32-bit or 64-bit integer could normally hold still convert accurately, with no precision loss.