Number Base Converter
Convert between binary, octal, decimal and hex - free, no signup, exact for huge numbers.
Uses arbitrary-precision arithmetic, so very large numbers (beyond what a normal calculator can hold exactly) still convert exactly.
What this tool does
Enter a number and pick which base it's currently in, and this shows it converted to binary, octal, decimal and hexadecimal all at once, updating live as you type. Conversion uses arbitrary-precision arithmetic rather than a normal calculator's floating-point numbers, so even a number far larger than JavaScript's safe integer limit converts exactly instead of losing precision in the last few digits.
Converts a number between binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16) simultaneously.
Uses arbitrary-precision integer arithmetic, so a number larger than 2^53 (roughly 9 quadrillion) still converts exactly, unlike a naive converter built on ordinary floating-point numbers.
Flags an invalid digit for the chosen base clearly (like a '2' in binary) rather than silently ignoring it.
Ignores spaces and underscores typed inside the number (like 1010_1100 or 1010 1100), so a number copied from code or a datasheet doesn't need manual cleanup first.
Renders hexadecimal output in lowercase digits by default and offers an uppercase copy of the full result with one click.
How to use it
- Type your number.
- Select which base it's currently written in.
- Read the converted value in each of the other three bases.
Why use this converter
Binary, octal, decimal and hex are used in programming and electronics, and big numbers overflow ordinary calculators. Arbitrary precision keeps every digit.
Why we built it
We built the number base converter on arbitrary-precision arithmetic, so numbers far beyond 2^53 convert exactly. Do arithmetic with the binary calculator and look up characters in the ASCII table.
For a neighbouring job there is also the Chmod Calculator, the UUID Generator and the MIME Type / File Extension Lookup.
Who this tool is for
- Computer science students
- Programmers moving between binary, octal, decimal and hex
- Electronics hobbyists
When to use it
- Reading memory addresses and colour values.
- Studying number systems.
- Converting masks and flags.
- Checking large values.
Why precision matters for large numbers
Most calculators quietly lose accuracy past about 9 quadrillion - this one doesn't.
JavaScript's ordinary numbers (and most calculators built on similar floating-point arithmetic) can only represent whole numbers exactly up to 2^53 - 1, or about 9.007 quadrillion. Beyond that, some values become indistinguishable from their neighbours, and a naive base converter built on those numbers will quietly produce a wrong answer in the last few digits without any warning. This tool uses BigInt, JavaScript's arbitrary-precision integer type, throughout, so a 64-bit value, a cryptographic key fragment, or any number far beyond a calculator's safe range converts exactly, digit for digit.
How each base's digits work
The same value, written with a different number of symbols per base.
| Base | Name | Valid digits | Example (decimal 255) |
|---|---|---|---|
| 2 | Binary | 0-1 | 11111111 |
| 8 | Octal | 0-7 | 377 |
| 10 | Decimal | 0-9 | 255 |
| 16 | Hexadecimal | 0-9, a-f | ff |
A base (or radix) is simply how many distinct symbols a number system uses before it carries over into the next column - binary has 2 (0 and 1), octal has 8 (0-7), decimal has the familiar 10, and hexadecimal has 16, borrowing the letters a-f to represent the values 10 through 15. The same underlying quantity is written with more digits in a smaller base (255 needs eight binary digits) and fewer digits in a larger base (255 needs only two hex digits), which is exactly why hexadecimal is the common shorthand for binary data in programming - it's roughly four times shorter to read and type than the equivalent binary string, at a fixed 4-bits-per-digit ratio.
What you give it, and what you get back
| Item | Details |
|---|---|
| Input | A whole number in one base. |
| Output | The number in binary, octal, decimal and hex at once. |
| Notes | Negative numbers are supported. |
Issues you may run into
| What you see | Why it happens | What to do |
|---|---|---|
| Invalid digit | A digit is outside the base. | Use 0-1 for binary, 0-7 for octal. |
| Fractions are not converted | Whole numbers only. | Convert the integer part. |
| Prefix confusion | Prefixes such as 0x are ignored. | Enter digits only. |
Assumptions and limitations
- This converts whole (integer) numbers only - fractional values in a non-decimal base aren't supported.
- A negative number is supported and converts with a leading minus sign in every base shown.
Frequently asked questions
How do I convert binary to decimal (or any base) online for free?
Type the number, select its current base, and the converted value in every other base appears instantly.
Does this handle very large numbers accurately?
Yes - it uses arbitrary-precision (BigInt) arithmetic throughout, so numbers far beyond a normal calculator's exact range (past roughly 9 quadrillion) still convert precisely, digit for digit.
What happens if I enter an invalid digit for the base I selected?
The tool tells you exactly which character isn't valid for that base, rather than silently dropping it or guessing.
Can I convert negative numbers?
Yes - a negative number converts with a leading minus sign shown in every base.
Is my number uploaded anywhere?
No. Conversion happens entirely in your browser - nothing is sent to a server, and closing the tab clears it.
Can I paste a number with spaces or underscores in it?
Yes - spaces and underscores inside the number (like 1010_1100) are stripped automatically before conversion, so a value copied straight from code or a datasheet doesn't need manual cleanup first.
Why is hexadecimal shorter than binary for the same value?
Because each hex digit represents exactly 4 binary digits (16 = 2^4), so any binary number is roughly four times longer to write than its hexadecimal equivalent - which is why hex is the common shorthand for binary data in programming.