- Home
- Tools
- Text & Code
- Number Base Converter
Number Base Converter
Convert arbitrary-precision integers between bases 2 and 36.
Bases 2–36 · underscores and 0b/0o/0x prefixes supported · arbitrary precision
Converted value
FF
Decimal: 255
Working notes
Use Number Base Converter with the boundary visible.
Number Base Converter translates signed, arbitrary-precision integers between any bases from 2 through 36 without routing values through an imprecise JavaScript number.
What is Number Base Converter?
A number base (or radix) determines how many unique digits are used to represent numbers. Decimal (base 10) uses 0-9, binary (base 2) uses 0-1, octal (base 8) uses 0-7, and hexadecimal (base 16) uses 0-9 and A-F. Different bases appear throughout computing: binary represents how data is stored in memory, octal is used in Unix file permissions, hexadecimal is the standard for memory addresses and color codes, and base 36 is used for compact URL-safe identifiers. Converting between bases is a routine task when reading memory dumps, setting file permissions, working with color values, or interpreting protocol-level data. This tool uses JavaScript BigInt for arbitrary-precision arithmetic, meaning conversions are exact for integers of any size — unlike standard Number which loses precision beyond 2^53. It supports all bases from 2 to 36, recognizes common prefixes (0x for hex, 0b for binary, 0o for octal), handles negative numbers, and allows digit separators for readability.
When to use it
- Converting hex color codes — translate between hex (#FF8C00) and decimal RGB values (255, 140, 0) when working with colors in code.
- Reading Unix permissions — convert octal permission values (755, 644) to binary to understand the read/write/execute bits for owner/group/other.
- Debugging memory addresses — convert hexadecimal addresses to decimal for comparison with documentation or error logs.
- Working with bitwise operations — convert values to binary to visualize bit patterns when debugging flags, masks, or protocol fields.
- Encoding compact identifiers — convert large decimal IDs to base 36 for shorter, URL-safe representations.
How to use it
- 01Choose the source base (2-36) from the dropdown or enter a prefixed value (0x for hex, 0b for binary).
- 02Enter the integer value using digits valid for the selected base.
- 03Choose the target base for conversion.
- 04Review the live result and copy it for use in code or documentation.
Common mistakes
- Using digits outside the base range — base 8 only allows digits 0-7. Entering "8" or "9" in octal mode is invalid.
- Confusing case sensitivity — hexadecimal is case-insensitive (FF = ff), but some systems expect a specific case. The tool normalizes to uppercase by default.
- Losing precision with large numbers — standard JavaScript Number loses precision above 2^53. This tool uses BigInt, so precision is exact for any integer size.
- Forgetting the 0x/0b prefix — when entering hex in code, 0xFF is hexadecimal but FF alone is not valid JavaScript. The tool accepts both forms.
- Negative numbers in different bases — the tool preserves the sign. It does not convert to two's complement representation, which depends on the bit width.
Synthetic example
Convert hexadecimal to binary
Input
FF in base 16
Result
11111111 in base 2
Related standards
Limits and data boundary
- Only integers are supported; fractional positional notation is not converted.
- Prefixes are recognized only when they agree with the selected source base.
Frequently asked questions
- What number bases are supported?
- Any integer base from 2 (binary) through 36. Common bases include binary (2), octal (8), decimal (10), and hexadecimal (16).
- Does this tool handle very large numbers?
- Yes. The converter uses arbitrary-precision arithmetic (BigInt) so there is no loss of precision for integers of any size.
- Can I convert negative numbers?
- Yes. Enter a minus sign before the digits. The tool preserves the sign through the conversion.
- What is base 36?
- Base 36 uses digits 0-9 and letters A-Z, producing the most compact alphanumeric representation of an integer. It is commonly used for short URL-safe identifiers.
Keep working