Number base converter — offline
Binary, octal, decimal, and hex — converted exactly with BigInt, on your device.
| Binary | 11111111 | |
| Octal | 377 | |
| Decimal | 255 | |
| Hexadecimal | ff |
Convert between binary, decimal, octal and hex offline
Base conversion comes up constantly in low-level work: reading a bitmask from a log, decoding a permission value, checking a colour channel, working out what a hex offset means in a debugger. Type a number here and all four representations appear at once, computed in your browser with nothing transmitted anywhere.
Input is deliberately tolerant of how numbers appear in real code: the 0b, 0o, and 0x prefixes are accepted, as are underscore separators like 1_000_000 or 0b1010_1010, so you can paste straight from a source file without cleaning it up first.
Exact conversion with BigInt, at any size
Conversion uses JavaScript's BigInt, which means arbitrarily large integers convert exactly. This is not a detail — it is the difference between a correct answer and a quietly wrong one.
Ordinary JavaScript numbers are IEEE 754 doubles and can only represent integers exactly up to 2^53. Beyond that they silently lose precision, so a converter built on them starts producing subtly incorrect results for large values with no warning at all. That range is easy to exceed in practice: 64-bit identifiers, Twitter-style snowflake IDs, database sequence values, and cryptographic constants all live above it. Here the arithmetic is exact however large the number gets.
Where each base shows up
- Hexadecimal — memory addresses, colour codes, byte dumps, hashes. Each hex digit is exactly four bits, so two digits are one byte, which makes it the natural shorthand for binary data.
- Binary — flags and bitmasks. Reading a permission value in binary makes it immediately obvious which bits are set.
- Octal — mostly Unix file permissions, where
chmod 755is three octal digits describing owner, group, and other. - Decimal — everything humans read.
Related and equally local: hash generator, Base64 encoder for binary as text, and colour converter when the hex value is a colour.
How to convert between binary, decimal and hex
- 1
Pick the base of your input number.
- 2
Type the number (0x/0b prefixes and _ separators are fine).
- 3
Copy any of the four representations.
Number Base Converter — frequently asked questions
Are my numbers processed on a server?
No — conversion happens in your browser using BigInt, so even numbers far beyond 64 bits convert exactly.
Which bases are supported?
Binary, octal, decimal, and hexadecimal. Prefixes (0b, 0o, 0x) and underscore separators are accepted on input.
Is there a size limit?
Practically no — BigInt handles arbitrarily large integers with exact precision.