Convertisseur de Bases
Convertissez entre binaire, octal, décimal, hexadécimal et toute base de 2 à 36.
| Base | Value |
|---|---|
| 2 (binary) | … |
| 8 (octal) | … |
| 10 (decimal) | … |
| 16 (hex) | … |
| 32 | … |
| 36 | … |
What is this for?
Numbers are the same number regardless of base — 255, 0xff, 0b11111111, and 0o377 are identical. But which base you read or write in matters when you're translating between memory layouts, parsing colour codes, decoding bit fields, or just reading hex from a debugger. This tool converts between binary, octal, decimal, hexadecimal, and any base from 2 to 36, using BigInt under the hood so you don't lose precision on large numbers.
When to use it
- Reading a hex value from a stack trace and figuring out what it is in decimal.
- Converting CSS colour
0xff8800into an RGB triple, or vice versa. - Inspecting a bitmask or flags integer in binary to see which bits are set.
- Translating between base-36 short IDs and decimal counters.
Recognised prefixes
- Hex:
0x,0X,# - Binary:
0b,0B - Octal:
0o,0O - Underscore digit grouping:
1_000_000
Common gotchas
- Negative numbers are sign-prefixed, not two's complement.
-128is shown as-10000000in binary, not10000000. Most languages display the same way for arbitrary-precision integers. - Big numbers don't lose precision here. JavaScript
Numbercaps at 253; this tool usesBigInt, so 64-bit integers, large hashes, and crypto values all round-trip exactly. - Don't confuse base with case. Base-16 letters can be upper or lower; the tool accepts both and emits uppercase. Base-32 / base-36 outputs are lowercase by convention.
- Leading zeros are dropped.
0x000FbecomesF. If you need a fixed-width hex (e.g. for byte representations), pad in your code afterward.