Developer Tools
Number Base Converter
Convert integers between binary, octal, decimal, and hexadecimal.
About This Tool
Convert whole numbers between the number systems commonly used in programming, computing, digital electronics, and technical documentation. The converter supports binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16), including signed integers and values larger than JavaScript's safe Number range. Processing stays in your browser.
How To Use It
- Choose the number system your input currently uses.
- Choose the number system you want as the result.
- Enter a whole number using only digits valid for the selected input base.
- Copy the exact result or reverse the conversion to check it in the opposite direction.
Examples
Binary to decimal
101010 in base 2 equals 42 in base 10.
Decimal to hexadecimal
255 in decimal equals FF in hexadecimal.
Large unsigned value
18446744073709551615 in decimal equals FFFFFFFFFFFFFFFF in hexadecimal, with the integer kept exact.
Useful Notes
How positional number systems work
Each digit is multiplied by a power of the base according to its position. Binary uses powers of 2, octal powers of 8, decimal powers of 10, and hexadecimal powers of 16. Hexadecimal extends the decimal digits with A through F for values 10 through 15.
Exact large-integer conversion
This tool uses integer arithmetic rather than floating-point Number arithmetic, so large whole numbers are not rounded merely because they exceed JavaScript's Number.MAX_SAFE_INTEGER.
Valid digits depend on the base
Binary accepts only 0 and 1; octal accepts 0 through 7; decimal accepts 0 through 9; hexadecimal accepts 0 through 9 and A through F. Invalid digits produce an error instead of being partially parsed.
Whole numbers only
The converter intentionally handles integers, not fractional radix notation such as 101.01₂. Limiting the scope avoids implying exact fractional behavior where repeating representations and precision rules require additional choices.
Signed values
A leading plus or minus sign is supported. Negative values are converted by magnitude and keep their minus sign; this is numeric base conversion, not a two's-complement bit-pattern converter.
FAQ
Does the converter support very large integers?
Yes. It uses exact integer arithmetic, so values larger than JavaScript's safe Number range can be converted without floating-point rounding.
Why is 2 invalid in binary?
Base 2 has only two digits: 0 and 1. A digit must be smaller than the base it belongs to.
Are hexadecimal letters case-sensitive?
No. You can enter A-F in upper or lower case; output hexadecimal letters are shown in uppercase.
Does a negative result show two's complement?
No. A value such as -31 converts to -1F. Two's complement depends on a chosen bit width, so it is a different task.
Related Tools
Base64 Encode / Decode
PopularConvert plain text and Base64 in either direction.
JSON Formatter & Validator
PopularValidate JSON, pretty-print it, minify it, and inspect JSON paths.
Basic Calculator
PopularA simple arithmetic calculator for quick results.
Data Size Converter
Convert bits, bytes, kB, MB, GB, KiB, MiB, GiB, and more.