Number Base Converter
Convert any integer between decimal (base 10), hexadecimal (base 16), binary (base 2), and octal (base 8). Type in any field and all others update instantly. Supports numbers up to 253.
Developer Tools
What This Tool Does
Converts numbers between decimal, hexadecimal, binary, and octal in your browser instantly. Also shows the IEEE 754 float representation for floating-point inputs.
Who This Is For
- Embedded systems and firmware engineers working with hex memory addresses and binary bit fields
- Computer science students learning number systems for coursework or exams
- Web developers converting hex color values or working with binary flags
- Security professionals analyzing binary protocol data or hex-encoded payloads
Example: Input: The decimal number 255 → Output: Hex: FF ยท Binary: 11111111 ยท Octal: 377 โ all displayed simultaneously
How to Convert Between Number Bases
- Enter your number in the input field.
- Select the source base (the base your number is currently in).
- All four conversions โ decimal, hexadecimal, binary, octal โ appear instantly. Hex color values appear everywhere in CSS โ the Color Converter translates HEX to RGB and HSL. For encoding binary data, the Base64 Encoder is the standard tool.
- Click any result to copy it.
The converter updates in real time. Hex strings also appear in URL percent-encoding โ the URL Encoder shows both the character and its hex code. If you enter an invalid character for the selected base (for example, a 9 in a binary field), the field is highlighted and no conversion is shown.
Understanding Number Bases
| Base | Name | Digits Used | Common Use |
|---|---|---|---|
| Base 2 | Binary | 0, 1 | Computer hardware, logic gates, bitwise operations |
| Base 8 | Octal | 0โ7 | Unix file permissions, older computing systems |
| Base 10 | Decimal | 0โ9 | Everyday arithmetic, human-readable numbers |
| Base 16 | Hexadecimal | 0โ9, AโF | Memory addresses, color codes, byte representation |
Every number in any base represents the same underlying quantity โ just written differently. The decimal number 255 is 0xFF in hex, 11111111 in binary, and 377 in octal. All four are the same value.
Hexadecimal is particularly useful because one hex digit maps exactly to 4 binary bits (a nibble), and two hex digits map to one byte (8 bits). This makes hex a compact, human-readable representation of binary data.
Real-World Use Cases
- CSS color codes โ
#FF5733is three hex pairs: red (FF = 255), green (57 = 87), blue (33 = 51). Understanding hex lets you read and tweak colors manually. - Unix file permissions โ
chmod 755uses octal. 7 = 111 in binary = read+write+execute, 5 = 101 = read+execute. - Memory addresses โ debuggers and disassemblers display addresses in hex:
0x7fff5fbff8a0. - IPv4 in hex โ some network tools display IP addresses as 32-bit hex values.
- Bitwise operations โ understanding binary representations is essential for working with bitwise AND, OR, XOR, and shift operators.
- ASCII and Unicode โ character codes are commonly expressed in hex: space is
0x20, A is0x41. - Embedded systems โ microcontroller registers and memory maps are documented in hex throughout.
Hexadecimal Arithmetic Quick Reference
The letters A through F in hex represent values 10 through 15:
| Hex | Decimal | Binary |
|---|---|---|
| A | 10 | 1010 |
| B | 11 | 1011 |
| C | 12 | 1100 |
| D | 13 | 1101 |
| E | 14 | 1110 |
| F | 15 | 1111 |
| 10 | 16 | 10000 |
| FF | 255 | 11111111 |
| 100 | 256 | 100000000 |
To convert hex to decimal manually: multiply each digit by 16 raised to its position. 2A = (2 ร 16ยน) + (10 ร 16โฐ) = 32 + 10 = 42.
Number and Data Encoding Workflow
Base conversion is used throughout computing and cryptography:
- Generate hash values are displayed in hexadecimal โ use this converter to inspect them in binary or decimal โ hashes are displayed in hex and can be converted here
- Encode in Base64 โ a 64-character encoding scheme using 6-bit groups
- Convert timestamps โ Unix timestamps are decimal numbers often shown in hex
Related Tools
- Working with numeric data in CSV format? Convert to JSON for programmatic base conversion. โ convert number data from CSV to JSON
- Got hex or binary values in JSON? Export them to CSV after converting to your target base. โ export converted number data to CSV
- Writing about binary, octal, hex, or decimal for developers? Convert your Markdown guide to HTML. โ document number systems in a guide
- Migrating number parsing code from VB.NET? Convert it to C# syntax. โ convert VB.NET base conversion code to C#
Related Guides
Number Systems Explained: Binary, Octal, Decimal, and Hex
Why computers use binary and hex, and how to convert between bases by hand.
ReferenceConverting Numbers Between Bases: A Reference
Convert between decimal, hexadecimal, binary, and octal by hand and in code โ with tables and patterns.
TutorialBitwise Operations in JavaScript: A Practical Guide
How to use AND, OR, XOR, and shift operators โ with hex and binary examples.
GuideBase64 Encoding Explained: When and Why Developers Use It
Base64 is another encoding scheme โ understand how encoding differs from number bases.
Frequently Asked Questions
0x prefix is a programming convention to indicate a hexadecimal number. It is used in C, JavaScript, Python, and most other languages: 0xFF, 0x1A3F. The prefix itself is not part of the value.