ToolForge
Advertisement

Number Base Converter

Convert Binary, Octal, Decimal, and Hexadecimal

Written by toolforge.websiteLast reviewed How we build and check these tools

Number Base Converter tool

Type a value in any field — all other bases update instantly.

Base 2
Base 8
Base 10
Base 16

Quick reference — common values

DecimalBinaryOctalHex
0000
1111
81000108
10101012A
15111117F
16100002010
25511111111377FF
256100000000400100
1024100000000002000400
655351111111111111111177777FFFF

Number Base Converter: key facts

What it does
Convert Binary, Octal, Decimal, and Hexadecimal
Category
Converters
Cost
Free, with no account, sign-up, or install.
Your data
Runs entirely in your browser — the files and text you enter are never uploaded to a server.
Last reviewed
. Report an incorrect result.
Advertisement

What the Number Base Converter does

Binary, octal, decimal, and hexadecimal are not four separate number systems — they are four different ways of writing the same integer. Computers work in binary (base 2) internally, memory addresses and color codes appear in hexadecimal (base 16), Unix file permissions are conventionally written in octal (base 8), and decimal (base 10) is what most humans think in. Moving fluidly between them is a fundamental skill for programmers, network engineers, and computer science students.

A front-end developer might start with the hex color code #1A73E8, want to see its decimal RGB channels, and then check the binary representation of each channel to understand bit-masking. A student debugging a microcontroller might need to convert a decimal sensor reading to binary to verify individual bit flags. An admin reading octal chmod permissions like 0755 needs to understand which read/write/execute bits are set. This converter shows all four representations at once and updates live as you type in any one of them.

Real-time validation highlights illegal characters for the selected base — you cannot type the digit 2 in binary mode, and letters beyond F are flagged red in hex — so you know immediately if your input is valid.

Using the Number Base Converter, step by step

  1. Type your number into the Binary, Octal, Decimal, or Hexadecimal input field.
  2. All other bases update instantly. Invalid characters are highlighted in red with a message explaining what is allowed.
  3. Hexadecimal values are displayed in uppercase (A–F).
  4. Click Copy on any field to copy that representation to your clipboard.

Parsing and rendering in four bases

A value entered in any base is parsed to an integer and then rendered in binary, octal, decimal, and hexadecimal simultaneously. Every representation shows the same number — base is a notation, not a property of the quantity — and seeing all four at once is what makes the relationships between them visible.

Binary and hexadecimal are related in a way worth internalising: sixteen is two to the fourth, so each hex digit corresponds to exactly four binary digits. That is why hex is used as shorthand for binary throughout computing, and why converting between them requires no arithmetic, only grouping.

Octal has the same property with three bits per digit, which is why Unix file permissions are written in octal — three bits map neatly onto read, write, and execute.

  • 255 in decimal is FF in hex and 11111111 in binary — the largest value in one byte.
  • 1024 is 400 in hex, which is why round numbers in computing look arbitrary in decimal.
  • Each hex digit is exactly four binary digits, so FF splits into 1111 1111.

What makes this one worth using

  • All four bases display simultaneously — you see the number in every representation at once without toggling between modes.
  • Per-field character validation prevents illegal input for each base (e.g., 2–9 are flagged red in binary) so you catch errors while typing.
  • Uses JavaScript's built-in parseInt(n, base).toString(base) for reliable, spec-compliant conversion across all supported bases.
  • No libraries, no upload, no account — works offline once the page loads.

Where each base turns up

Hexadecimal appears wherever bytes are displayed compactly: colour codes, memory addresses, MAC addresses, hash digests, and character code points. Two hex digits are exactly one byte, which is the reason a colour is six digits — one byte each for red, green, and blue.

Binary is how the hardware works and is mostly seen when individual bits matter: flags packed into a single value, bitmasks, and network subnet masks. Octal survives in Unix permissions and in some legacy formats.

Two practical traps. Prefixes distinguish bases in most languages — 0x for hex, 0b for binary, and a bare leading zero historically meant octal, which is why 010 has meant eight in some languages and caught out a great many people. And bases apply to integers here; representing fractions in another base is possible but introduces its own rounding, since a fraction that terminates in one base may recur in another.

Frequently Asked Questions

What does "base" mean in number systems?

The base (or radix) tells you how many unique digits the system uses before cycling to the next position. Binary (base 2) uses only 0 and 1; decimal (base 10) uses 0–9; hexadecimal (base 16) uses 0–9 plus A–F for values ten through fifteen.

Why do programmers use hexadecimal so often?

One hex digit represents exactly 4 binary bits (a "nibble"), and two hex digits represent a full byte (8 bits). That tight mapping makes hex far more compact than binary while still being directly convertible — which is why memory addresses, color codes, and cryptographic hashes are expressed in hex.

What is the largest number this converter handles?

The converter works up to JavaScript's Number.MAX_SAFE_INTEGER (2^53 − 1 = 9,007,199,254,740,991 in decimal). Beyond that, floating-point precision limits make integer results unreliable. For very large integers, use BigInt-based tools instead.

Why does my hex input need to be uppercase?

It does not — the converter accepts both uppercase (A–F) and lowercase (a–f) hex input. Output is normalized to uppercase, which is the most common convention in technical documentation, memory dumps, and color codes.

Related Tools

Advertisement
Buy Me a Coffee