Number base converter
Convert between binary, octal, decimal, hex and any base 2–36 — big-integer precise. Runs in your browser.
Runs 100% in your browserHow to convert number bases
- Pick the input base. Tell it whether your number is binary, decimal, hex, etc.
- Enter the number. Type the value; all bases update live.
- Copy a result. Grab any representation you need.
About number bases
Programmers move between bases constantly — hex for colors, memory addresses and byte values, binary
for bitmasks and flags, decimal for everything else. A base is just how many distinct digits a position
can hold before it carries: base 10 uses 0–9, base 2 uses 0–1, base 16 adds a–f for the values 10–15.
Every column is worth the base raised to a power, so the binary 1011 is
8 + 0 + 2 + 1 = 11.
Why hex and octal line up with binary
Hexadecimal is popular in low-level work because one hex digit maps to exactly four bits (a
“nibble”), so a byte is always two hex digits — FF is 1111 1111,
A0 is 1010 0000. Octal groups bits in threes, which is why Unix file
permissions read as octal (755 = rwxr-xr-x). Converting between these bases never
changes the underlying value, only how it's written, so flipping a number into hex to read a bitmask and back
into decimal is lossless.
Big integers, exactly
JavaScript's ordinary numbers lose precision above 253, which quietly corrupts 64-bit IDs and
hashes. This converter parses with arbitrary-precision BigInt arithmetic instead, so a full
64-bit value like 18446744073709551615 round-trips digit-for-digit with no rounding. A leading
minus sign is honoured, and a single 0x, 0b or 0o prefix is tolerated
on input. It works on whole integers — fractional points aren't converted.
Bases beyond 16
The custom-base field reaches all the way to base 36, using the digits 0–9 then a–z. Base 36 is the densest you can get with the alphanumeric character set, which is why it shows up in short URL slugs and compact IDs; base 32 is common for case-insensitive tokens. For byte-oriented hex work the hex converter is more direct, and to turn text itself into binary or ASCII codes use the binary & text converter.
Frequently asked questions
- Binary (2), octal (8), decimal (10) and hexadecimal (16) are shown directly, plus any custom base from 2 to 36. Choose the base your input is written in.
- Yes — it uses arbitrary-precision integers (BigInt), so 64-bit values and beyond convert exactly without rounding.
- Yes, a leading minus sign is handled. Fractional/decimal points are not — it converts whole integers.
- Yes — conversion runs entirely in your browser.