Number Base Converter

Convert a number between binary, octal, decimal and hexadecimal — enter a value, pick its base, and see all four at once. Runs in your browser.

Developer Tools Free No upload Instant

Loading Number Base Converter…

Your browser is preparing the tool. It runs 100% locally.

Quick Answer

Enter a whole number and choose its base — binary, octal, decimal or hexadecimal — and the tool shows it in all four at once. It reads the value with the browser's integer parser, so a digit that is not valid for the chosen base stops the reading there. It handles whole numbers only, and very large values lose precision past the safe-integer limit. It runs entirely in your browser.

What the Number Base Converter Does

Type a number, tell the tool which base it is in (base 2, 8, 10 or 16), and you instantly see the binary, octal, decimal and hexadecimal forms together. It is the quick way to read a hex colour or memory address in decimal, or to see what a decimal value looks like in binary.

Hexadecimal output is shown in uppercase; the others in lowercase. The conversion is live, so editing the value or switching the input base updates all four readings at once.

How It Works

The tool parses your input as an integer in the base you pick — using the browser's parseInt with that radix — then re-expresses that number in base 2, 8, 10 and 16. Because parseInt reads valid digits from the start and stops at the first character that is not valid for the base, a stray digit truncates the value rather than raising an error.

Only the first character being invalid produces a clear invalid-number message. Otherwise you always get a result, which is fast and forgiving but means you should check that your input contains only digits legal for its base — no 2 in a binary number, no letter G in a hex number.

Data source & conversion logic

  1. Read the value and base. Take the number you typed and the base you selected (2, 8, 10 or 16).
  2. Parse to an integer. Read the digits valid for that base from the start, stopping at the first invalid one.
  3. Re-express in four bases. Convert the resulting integer into binary, octal, decimal and hexadecimal.
  4. Show all four. Display the results together, with hexadecimal in uppercase.

Same value, four bases

decimal 255 binary 11111111 octal 377 hexadecimal FF

Each base writes the same number with a different set of digits; base 16 uses 0-9 and A-F.

Technical Details

Input basesbinary, octal, decimal, hexadecimal
Outputall four at once
Numberswhole numbers only
Hex caseuppercase output
Invalid digitsreading stops at the first one
Large valueslose precision past the safe-integer limit
Where it runsIn your browser — nothing uploaded

Standards & references

  • Positional number systems — binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16) all write the same value using different digit sets and place values.
  • Integer parsing — the value is read with the browser's parseInt at the chosen radix, which accepts the digits valid for that base and stops at the first invalid character.
  • Safe-integer limit — the browser's numbers are exact only up to 2 to the power 53 minus 1; a value larger than that can lose precision and round, so this tool is for ordinary-sized integers.

Accuracy & Limitations

It parses leniently and stops at the first invalid digit. A binary input of 1012 is read as 101 (the 2 is not a binary digit), and a hex input of 1FG is read as 1F — no error, just a truncated value. Only an input whose very first character is invalid shows an invalid-number message.

It handles whole numbers only. There is no fractional or decimal-point support, so a value after a dot is dropped. For fractions you would need a tool built for non-integer base conversion.

Very large numbers lose precision. The browser represents integers exactly only up to 2 to the power 53 minus 1; beyond that, the result can be rounded silently, so this tool is reliable for ordinary values, not for huge ones where you would use arbitrary-precision arithmetic.

The input bases are limited to 2, 8, 10 and 16. It does not take other bases (such as base 3, 5 or 36) as input, though those four cover almost all everyday computing needs.

Hexadecimal is shown in uppercase and the others in lowercase. Hex is case-insensitive in value — FF and ff are the same number — but if a system you paste into expects one case, adjust accordingly.

Real-World Use Cases

Reading hex and binary

See a hex colour, byte or address as a decimal number.

Programming

Check how a value looks across bases while coding or debugging.

Learning

See the same number written in binary, octal and hex side by side.

Bit and byte work

Translate a binary pattern into decimal or hexadecimal.

When to use it — and when not to

Good for

  • Converting between binary, octal, decimal and hex
  • Reading a hex or binary value in decimal
  • Quick base checks while coding
  • Seeing all four bases at once

Not the best choice for

  • Fractional or decimal-point numbers
  • Bases other than 2, 8, 10 and 16
  • Very large numbers beyond the safe-integer limit
  • Bitwise operations or two's-complement views

Need a base outside 2, 8, 10 and 16, or arbitrary precision? A programmer's calculator or a big-integer tool handles those. Doing bitwise math? A dedicated bitwise calculator shows the AND, OR and shift operations.

Frequently Asked Questions

Which bases does it convert between?
Binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). You enter a value in one of those and it shows all four at once.
Why did part of my number get dropped?
The parser reads digits valid for the chosen base from the start and stops at the first invalid one. A binary 1012 becomes 101, because 2 is not a binary digit. Check that the input only uses digits legal for its base.
Can it convert numbers with a decimal point?
No. It handles whole numbers only; anything after a decimal point is dropped. For fractional values you need a converter built for non-integer bases.
Why is the hexadecimal in capitals?
The tool outputs hex in uppercase (so FF, not ff). Hex is case-insensitive as a value, but some systems prefer one case; adjust if yours does.
What happens with a really big number?
The browser is exact only up to 2 to the power 53 minus 1; past that, a value can be rounded silently. For ordinary numbers it is accurate, but use an arbitrary-precision tool for very large integers.
What is hexadecimal used for?
It is a compact way to write binary — each hex digit is exactly four bits — so it is common for colours, memory addresses, byte values and hashes.
Can I enter a base other than 2, 8, 10 or 16?
Not as input. Those four cover almost all computing uses; for an unusual base like 3 or 36, use a programmer's calculator that accepts any radix.
Why do I get an invalid-number message?
That appears when the first character is not valid for the chosen base — for example a letter in a decimal field. Fix the leading character and it will convert.
Does it handle negative numbers?
A leading minus sign is read, so a negative decimal converts, but base work is usually about positive values and bit patterns. For two's-complement representations, use a bitwise or programmer's calculator.
How many bits is a hex digit?
Four. That is why hexadecimal pairs so neatly with binary — two hex digits make one byte (eight bits).
Is my input uploaded?
No. The conversion happens entirely in your browser; nothing is sent anywhere.
What is octal used for?
Base 8 groups bits in threes. It is less common now but still appears in things like Unix file permissions (for example 755).

References

Reads the value with the browser's parseInt at the chosen base, so it stops at the first invalid digit rather than erroring; it is explicit that it handles whole numbers only, takes bases 2, 8, 10 and 16, and can lose precision past the safe-integer limit (2 to the power 53 minus 1).

PopularHot

JSON Formatter

JSON Formatter for developers — instant, offline-style and privacy-safe.

DeveloperOpen Tool
Popular

JSON Validator

JSON Validator for developers — instant, offline-style and privacy-safe.

DeveloperOpen Tool
Popular

Base64 Encoder

Base64 Encoder for developers — instant, offline-style and privacy-safe.

DeveloperOpen Tool
Popular

Hash Generator

Fast, free Hash Generator that runs entirely client-side in your browser.

DeveloperOpen Tool
Popular

UUID Generator

Fast, free UUID Generator that runs entirely client-side in your browser.

DeveloperOpen Tool
Trending

CSS Minifier

Fast, free CSS Minifier that runs entirely client-side in your browser.

DeveloperOpen Tool

Ready to try the Number Base Converter?

It is free, private and runs entirely in your browser — no sign-up, no uploads, no limits.