What is Number Base Converter?
A Number Base Converter converts data from one format to another using a deterministic mapping. It parses the input, transforms it according to the relevant standard, and returns a ready-to-use result. Convert numbers between binary (2), octal (8), decimal (10), hex (16), and any custom base from 2 to 36.
Number Base Converter
Convert numbers between binary, octal, decimal, hex, and any base from 2 to 36.
TLDR
Type a number and its source base (2-36), pick the target base. The page parses with parseInt(s, fromBase) and emits with toString(toBase). Negative numbers and prefixes (0b, 0o, 0x) auto-detected.
How to use this tool
- Enter your inputs. Each field is labeled with what it expects.
- Read the result instantly. Numbers update as you type or change inputs.
- Adjust to test sensitivity. Change one input at a time to see what moves the result most.
- Cross-check the formula in the section below if you want to verify the math.
- Copy or screenshot the result for later. The site does not save anything; close the tab and inputs are gone.
About this tool + how it works
This tool runs 100% in your browser - the libraries load from a public CDN and the math runs on your device. Nothing is uploaded to a server. The underlying logic is:
number = parseInt(input, from_base) result = number.toString(to_base)
You can verify by opening the browser developer tools and watching the Network tab; you'll see no requests fired during normal use beyond the initial page and library load.
Real-world scenarios where this tool helps
Quick conversion
Paste, convert, copy - faster than spinning up a Python REPL.
Learning
See exactly how number base converter works step by step.
Debugging
Verify encoding / decoding output when integrating with APIs.
Mock data
Generate properly-encoded test fixtures.
What this tool does
- Runs the number base converter 100% in your browser - no upload, no API, no signup.
- Shows live error messages when input is malformed.
- One-click Copy, Sample, and Clear buttons.
- Works on phones, tablets, and desktops; loads in under a second.
- Free forever; no premium tier.
What it does NOT do
- Does not store, log, or send your input anywhere.
- Does not require an account, an API key, or a paid plan.
- Does not fix malformed input - garbage in = error message.
- Does not preserve formatting nuances that the target encoding cannot express.
How positional number bases work
A number base, or radix, is the count of distinct digits a numbering system uses before it rolls over to the next place value. Decimal (base 10) uses ten digits, 0 through 9; binary (base 2) uses just 0 and 1; hexadecimal (base 16) uses 0 through 9 plus A through F. In every positional system, each position is worth the base raised to a power, increasing right to left. The decimal number 255 means 2x100 + 5x10 + 5x1; the same value in hex is FF, meaning 15x16 + 15x1.
This converter parses your input in the source base to a plain integer, then re-expresses that integer in the target base. It supports any base from 2 to 36, using the digits 0 through 9 and the letters A through Z for digit values 10 through 35. Binary, octal (8), decimal, and hex are the four most common bases in computing, but the same mechanism works for any radix in that range.
Worked example: hex FF to binary
Convert the hexadecimal value FF into binary, going through decimal as the bridge.
- Hex to decimal: FF = 15x16 + 15x1 = 240 + 15 = 255.
- Decimal to binary by repeated division: 255 / 2 leaves remainders that, read bottom to top, give 11111111.
- Shortcut: each hex digit maps to exactly four binary digits, so F = 1111 and FF = 1111 1111.
- Check: 11111111 in binary = 128+64+32+16+8+4+2+1 = 255, confirming the result.
Result
FF (hex) = 255 (decimal) = 11111111 (binary) = 377 (octal). The hex-to-binary shortcut, four bits per hex digit, is why programmers favour hex: it is a compact, readable stand-in for binary that the eye can group at a glance.
Common base conversions reference
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 16 | 10000 | 20 | 10 |
| 100 | 1100100 | 144 | 64 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
Common mistakes and pitfalls
- Choosing the wrong source base. The string "10" is two in binary, eight in octal, ten in decimal, and sixteen in hex. Always set the source base to match how the digits were written.
- Using out-of-range digits. A digit must be smaller than its base: 2 is invalid in binary, and 8 or 9 are invalid in octal. The converter rejects digits the base cannot contain.
- Forgetting hex letter case. Hex digits A to F are the same whether upper or lower case, but mixing them into other bases by mistake produces a parse error.
- Dropping prefixes. 0b, 0o, and 0x signal binary, octal, and hex. If you strip the prefix but leave the base set to decimal, the value is misread.
- Expecting fractions. This tool converts whole integers. Fractional values in non-decimal bases need a different, place-by-place method for the digits after the point.
Related tools
Frequently asked questions
How do I convert binary to decimal?
Multiply each binary digit by 2 raised to its position (counting from 0 on the right) and add the results. For 1011 that is 1x8 + 0x4 + 1x2 + 1x1 = 11. In the tool, enter the binary value with source base 2 and target base 10, and it does the arithmetic for you.
What is the largest base this converter supports?
It supports any base from 2 up to 36. The upper limit of 36 comes from using the ten digits 0 to 9 plus the twenty-six letters A to Z to represent digit values, which gives exactly 36 symbols. Base 16 (hex), base 8 (octal), and base 2 (binary) are the most common, but base 32 and base 36 appear in compact identifiers.
Why do programmers use hexadecimal instead of binary?
Each hex digit maps to exactly four binary digits, so hex is a compact, human-readable shorthand for binary. The byte 11111111 is just FF in hex, far easier to read and type without error. This clean four-to-one mapping is why memory addresses, colour codes, and byte values are almost always written in hex.
What do the 0b, 0o, and 0x prefixes mean?
They are the standard markers many programming languages use to indicate a number's base: 0b for binary, 0o for octal, and 0x for hexadecimal. So 0xFF is hex, 0b1010 is binary, and 0o17 is octal. The converter auto-detects these prefixes and shows the value across all common bases at once.
Can it convert negative numbers or fractions?
It handles negative whole numbers by preserving the minus sign, but it converts integers only, not fractional values after a decimal point. Converting fractions between bases requires a separate digit-by-digit method, since each place after the point is the base raised to a negative power. Stick to whole numbers for reliable results here.
