Hex / Decimal / Binary / Octal Converter
Runs locally in your browser. Nothing leaves your device.Convert numbers exactly between hexadecimal, decimal, binary, and octal.
Input
Output
Copy or download conversion as JSON.
Steps
How it works
- 1
Choose the number model and input
Choose mathematical integer, fixed bit pattern, or fraction, and enter the number.
- 2
Check source base and options
Check the automatically detected source base and adjust bit width, interpretation, or decimal places if needed.
- 3
View the result in all bases
See the result in hex, decimal, binary, and octal at once, and copy it if needed.
Good to know
The hex/decimal/binary/octal converter converts numbers directly in your browser between bases, with three number models: mathematical integer, fixed bit pattern, or fraction. The source base is automatically detected via prefixes — 0x or # for hex, 0b for binary, 0o for octal; without a prefix, decimal is assumed.
Calculation runs locally in the browser. With a fixed bit pattern, the same bit sequence can represent different values as unsigned or signed; with fractions, not every value has a finite representation in every base.
Typical use cases
Convert numeric values between programming languages
Convert hex, binary, or octal values from source code, logs, or debuggers into decimal to better interpret them.
Compare signed and unsigned interpretation
Use the “fixed bit pattern” model with the right bit width to see what value the same bit sequence yields as unsigned or signed.
Represent fractions in other bases
Convert decimal fractions into binary or hex representation, limiting the decimal places if needed when the base representation isn't finite.
Tips for better results
Use prefixes for unambiguous input
Explicitly specify 0x, 0b, or 0o instead of relying on auto-detection when the input would also be valid as a decimal number.
Match the bit width to the actual data source
Set the bit width to the value your system or programming language actually uses (e.g., 8, 16, 32, or 64 bits) to get correct signed values.
Features
Three number models
Choose between mathematical integer, fixed bit pattern, or fraction.
Automatic base detection
Prefixes such as 0x, 0b, and 0o are detected automatically; without a prefix, decimal is assumed.
Local conversion with calculation steps
Calculation happens directly in the browser and shows the individual calculation steps.
Frequently asked questions
How is the source base automatically detected?
Via prefixes: 0x or # for hexadecimal, 0b for binary, 0o for octal. Without a prefix, decimal is assumed.
Why does the same bit pattern give different values?
Because the same bit pattern can represent different values depending on whether it's interpreted as unsigned or signed — choose the matching interpretation and bit width.
Are my inputs uploaded?
No. Conversion runs entirely locally in the browser.
More tools
Looking for another tool?
Every tool runs locally in your browser – no sign-up, no upload, and it works offline.