Number Base Converter
Arbitrarily large integers are supported. Prefixes 0x, 0o, and 0b are recognized in auto-detect mode.
About the Number Base Converter
This converter translates numbers between binary, octal, decimal, hexadecimal, and any radix from 2 to 36. It uses big-integer arithmetic, so values of any length convert without losing precision.
Auto-detect mode understands the common prefixes 0x (hex), 0o (octal), and 0b (binary). Spaces and underscores used as digit separators are ignored, so you can paste values straight from source code.
How to convert between number bases
- Type or paste a number — 255, 0xFF, or 0b11111111 all work.
- Pick the input base, or leave auto-detect to honor 0x/0o/0b prefixes.
- Read the value in binary, octal, decimal, hex, and Base36 at once.
- Set a custom base between 2 and 36 for anything else.
Tips
- Underscores and spaces in the input are ignored, so 1_000_000 parses fine.
- Negative numbers convert as signed mathematical values, not as two's complement bit patterns.
- Base36 uses digits 0-9 and letters a-z; it is handy for compact IDs in URLs.
- Conversions use BigInt, so numbers longer than 64 bits stay exact.
Base conversion checks before using converted values
Binary, octal, decimal, and hex are just notations for the same number, but prefixes, signs, and width still cause bugs.
Verify the input base
The digits 10 mean two in binary, eight in octal, ten in decimal, and sixteen in hex. Confirm what the source actually uses.
Watch numeric prefixes
0x, 0o, and 0b prefixes change how parsers read a value. Strip or keep them consistently across your codebase.
Mind signed representations
This tool shows the mathematical value. Hardware and low-level code often use fixed-width two's complement for negatives.
Check leading zeros
Some formats are width-sensitive: a color needs 6 hex digits and file permissions use 3 or 4 octal digits.
Related tools
You may also find these tools useful.