Number Base Converter
Convert between binary, hex, octal, and decimal instantly.
Quick Reference
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 2 | 10 | 2 | 2 |
| 4 | 100 | 4 | 4 |
| 8 | 1000 | 10 | 8 |
| 10 | 1010 | 12 | A |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 32 | 100000 | 40 | 20 |
| 64 | 1000000 | 100 | 40 |
| 100 | 1100100 | 144 | 64 |
| 128 | 10000000 | 200 | 80 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
| 1024 | 10000000000 | 2000 | 400 |
How Number Base Conversion Works
Every integer can be represented in any positional base by repeatedly dividing by the base and recording the remainders. Toolkiya parses your input in the source base — binary (base 2), octal (base 8), decimal (base 10), or hexadecimal (base 16) — using JavaScript's parseInt with the appropriate radix, then converts to the target base using Number.prototype.toString(radix).
For values larger than Number.MAX_SAFE_INTEGER, the tool falls back to a BigInt path so very large integers still convert exactly. Two's-complement and unsigned interpretations are both shown for binary and hex, which matters when you are reading bitfields or register values. Everything runs in your browser — no API call, no rounding service, no waiting.
When to Convert Number Bases
Reading a register value from an embedded device datasheet in hex and figuring out which bits are set. Translating a CSS color from hex to decimal RGB. Debugging bitwise flags returned from a system call. Converting Unix file permissions from octal to a readable bitfield. Decoding an IPv4 address represented as a single decimal integer back into octets.
Why Convert Bases in Toolkiya
Number base conversion sounds trivial, but most online converters break down past 32-bit values or silently round to floats. Toolkiya uses BigInt for large values so conversions stay exact up to arbitrary size, and runs everything in your browser with no network round trip.
There is no signup, no rate limit, and no daily quota. The tool works offline once loaded and never logs the values you convert, which is handy when you are working with cryptographic constants or proprietary register layouts.
Tips for Base Conversion
When pasting hex, omit the 0x prefix or leave it — the parser handles both. For binary, group bits in fours visually to spot patterns: 1010 0011 reads faster than 10100011. Remember that negative integers in hex usually mean two's-complement representation; pick the signed view when the source is a CPU register value.
Frequently Asked Questions
Which number bases does this converter support?▼
The tool handles the four bases developers use most often: Binary (base 2, uses only 0 and 1), Octal (base 8, uses 0-7), Decimal (base 10, the numbers we count with), and Hexadecimal (base 16, uses 0-9 and A-F). Every value you enter gets instantly converted to all four bases at the same time — no need to pick a target format.
How do I enter a binary or hexadecimal number?▼
You don't need to type the prefix — just enter the raw digits. For binary, type something like 10110101. For hex, type B5 or b5 (case-insensitive). The tool is smart enough to accept optional prefixes too: 0b10110101, 0o265, 0x B5 all work. After you enter the number, select which base you're entering from the dropdown.
Why would I need to convert between bases?▼
Binary and hex are the native languages of computers. Programmers work with hex for color codes (#FF5733), memory addresses (0x7fff8000), bit masks, file signatures, and low-level debugging. Binary shows up when designing hardware, working with flags, or studying computer science. This tool saves you the 10 seconds of mental math every time you need to flip between them.
What's the biggest number this can handle?▼
Up to JavaScript's safe integer limit: 2^53 - 1, which is 9,007,199,254,740,991 in decimal. That covers every practical use case — memory addresses up to 53 bits, UUIDs split into chunks, file offsets, timestamps, and so on. For cryptographic numbers beyond 64 bits, you'd need a specialized BigInt tool instead.
Does it handle negative numbers or fractions?▼
No — this tool is built for non-negative integers only. Base conversion for negative numbers depends on the representation (two's complement is the usual choice for computers, but there are alternatives), and fractions introduce rounding errors that make cross-base conversion unreliable. For binary representations of floating-point numbers, you'd want a dedicated IEEE 754 converter instead.
What's the difference between octal and decimal?▼
Decimal (base 10) uses digits 0-9 — the numbers we learned in school. Octal (base 8) uses only digits 0-7. Once you pass 7 in octal, you 'carry the one' to start a new column, so 10 in octal equals 8 in decimal. Octal is still used in some Unix file permissions (chmod 755) and in older CPU architectures, but most modern programming uses hex instead.
Is this the same as hex color picker tools?▼
Partially — this tool converts any hex number to decimal and binary, which works for color codes too. But for picking colors visually or converting #RRGGBB notation, use our Color Converter tool which handles HEX, RGB, HSL, HSV, and CMYK with a proper color preview. This base converter is a general-purpose utility, not a design tool.
Why is this all processed in my browser?▼
Because there's no reason it shouldn't be. Base conversion is a simple arithmetic operation — JavaScript can do it in microseconds. Sending your numbers to a server would be slower, require an internet connection, and add unnecessary privacy concerns. Every calculation happens inside your browser tab; no data is logged or transmitted.
Related Tools
Built & maintained by Mayank Rai
Solo developer based in Lucknow, India