Hex / Decimal / Binary / Octal Converter
Convert numbers exactly between hexadecimal, decimal, binary, and octal.
Input
Private by design: your values never leave your device.
Output
Copy or download conversion as JSON.
Steps
Good to know
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.
Typical searches include hex to decimal, binary to decimal, and convert number base. 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.
How it works
How it works
Step by step
Features
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
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
More tools
Base64 Decoder
Decode Base64, Base64URL, MIME Base64, or data URLs to bytes directly in the browser.
Base64 Encoder
Encode text or local files to Base64, Base64URL, MIME Base64, or data URLs directly in the browser.
bcrypt / MD5 / SHA-256 Generator
Generate and verify bcrypt password hashes and calculate MD5 and SHA-256 digests locally.
JSON Formatter
Validate, format, minify, analyze, and inspect JSON as a tree locally.