Developer

Hex / Decimal / Binary / Octal Converter

Convert integers between decimal, hexadecimal, binary and octal. Edit any of the 4 fields and the others update instantly, with exact BigInt precision for very large numbers.

This tool runs entirely in your browser. Anything you type here is never sent to a server.

Examples

Click an example to load it into the matching field.

What is a number base

A number base (or radix) is how many distinct digits a numbering system uses before it carries over into an extra digit — the same quantity can be written in any base, just with different digits. Computers and the people who work on them use several bases side by side, because each one is convenient for a different job.

Example

The decimal number 255 is FF in hexadecimal, 11111111 in binary, and 377 in octal — all four represent the exact same quantity.

The 4 bases

  • Decimal (base 10): The everyday counting system, using digits 0-9. It is what humans read and write most comfortably, but it does not map neatly onto how a computer stores data.
  • Hexadecimal (base 16): Uses digits 0-9 and letters A-F. Each hex digit represents exactly 4 bits (half a byte), which makes it a compact, human-friendly way to write raw binary data.
  • Binary (base 2): Uses only 0 and 1. It is the native representation of every value inside a computer — each digit is one bit.
  • Octal (base 8): Uses digits 0-7. Each octal digit represents exactly 3 bits — less common today, but still standard for one specific use: Unix-style file permissions.

Where each base shows up

  • Hexadecimal: Memory addresses, debugger output, byte values, and colors in CSS/design tools (e.g. #1A56DB).
  • Binary: Individual bits, bitwise flags, and bitmasks (combining or checking several boolean options packed into one number).
  • Octal: Unix/Linux file permissions, as used by chmod — e.g. chmod 755 grants read/write/execute to the owner and read/execute to everyone else.
  • Decimal: The default for anything meant to be read by a person — quantities, prices, counters, IDs.

Quick reference: 0-15 in every base

DecimalHexadecimalBinaryOctal
0000
1111
22102
33113
441004
551015
661106
771117
88100010
99100111
10A101012
11B101113
12C110014
13D110115
14E111016
15F111117

Frequently asked questions

Why does hexadecimal use letters?

Base 16 needs 16 distinct digits, but the decimal system only has 10 (0-9). Hexadecimal borrows the letters A-F to represent the values 10 through 15.

How are negative numbers handled?

This tool shows negative values with a plain leading minus sign in every base (e.g. -FF, -11111111) — it does not use two’s complement, since that only makes sense for a fixed bit width, which this converter does not assume.

Why does chmod use octal?

A Unix permission set is 3 groups of 3 bits (owner/group/others × read/write/execute), and 3 bits is exactly one octal digit — so each permission group becomes a single, easy-to-read octal digit, e.g. 7 = read+write+execute.

Is there a limit to how large a number I can convert?

Internally, values are stored as BigInt, so precision is exact no matter how large the number is. The input field does have a generous defensive length cap to keep the page responsive — pasting an unreasonably long string of digits will show a "too long" message instead of freezing the tab.