Number Base Converter Tool - Binary Decimal Hex Octal Converter with Bit Visualization
First Published:
Last Updated:
This tool converts numbers between binary (base 2), octal (base 8), decimal (base 10), hexadecimal (base 16), and any arbitrary base from 2 to 36 in real time. It supports arbitrarily large numbers via BigInt, provides an interactive bit visualization grid where you can click individual bits to toggle them, and includes a bitwise operations calculator with visual bit-level display.
All processing is performed entirely in your browser using client-side JavaScript. No data is transmitted to any server. Your input never leaves your device.
- This tool is provided "AS IS" without any warranties of any kind.
- The author accepts no responsibility for incorrect conversions used in production systems.
- Always verify critical calculations independently.
- By using this tool, you accept full responsibility for any outcomes.
This tool uses client-side JavaScript for all processing. No data is transmitted to servers, no files are uploaded online, all processing happens locally in your browser. Once loaded, this tool continues to work even without an internet connection. For more details, please refer to our Web Tools Disclaimer.
Interactive Bit Visualization
Click any bit to toggle it. Hex nibble values are shown below each 4-bit group.
Bitwise Operations Calculator
Supports prefixes: 0b (binary), 0o (octal), 0x (hex). Unprefixed values are treated as decimal.
Features
- Real-time simultaneous conversion — Type in any field (binary, octal, decimal, hex, or custom base) and all other fields update instantly as you type.
- Arbitrary base support (2–36) — Convert to and from any number base from 2 to 36 using the custom base selector.
- BigInt support — Handle arbitrarily large integers beyond JavaScript's Number.MAX_SAFE_INTEGER limit.
- Interactive bit visualization — Click individual bits to toggle them on or off. Hex nibble values are displayed below each 4-bit group for instant correlation.
- Signed and unsigned integer display — View two's complement signed and unsigned interpretations for 8, 16, 32, or 64-bit widths with overflow detection.
- Bitwise operations calculator — Perform AND, OR, XOR, NOT, left shift (<<), and right shift (>>) with visual bit-level display of operands and result.
- Grouped digit display — Toggle automatic grouping for readability (binary in 4-bit groups, decimal with commas, hex in 4-digit groups).
- Prefix auto-detection — The bitwise calculator accepts
0b,0o, and0xprefixes to specify the input base. - Per-field copy buttons — Copy any individual conversion result to the clipboard with one click.
- Negative number support — Enter negative decimals and see the corresponding two's complement representation in the bit grid.
- Uppercase toggle — Switch between lowercase and uppercase hex digits (a-f vs. A-F).
- Client-side only — All processing happens in your browser. No data is sent to any server.
How to Use
- Convert numbers: Type a number into any field (Binary, Octal, Decimal, Hex, or Custom Base). All other fields update in real time. You can include spaces, underscores, or common prefixes (0b, 0o, 0x) — they are automatically stripped.
- Use the bit grid: Click any bit cell to toggle it between 0 and 1. All conversion fields and the signed/unsigned display update immediately. Select a bit width (8, 16, 32, or 64) to change the grid size.
- Check signed vs. unsigned: Below the bit grid, the “Signed (Two's Complement)” and “Unsigned” displays show how the current bit pattern is interpreted at the selected bit width. An overflow warning appears if the value exceeds the selected bit width.
- Perform bitwise operations: Enter values in Operand A and Operand B (with optional
0b/0o/0xprefixes), select an operation (AND, OR, XOR, NOT, <<, >>), and click Calculate. The result is shown in binary, decimal, and hex, with a visual bit-level breakdown. - Copy results: Click the clipboard icon next to any field to copy its value (formatting is stripped for clean output).
Important Notes
- This tool uses JavaScript BigInt for arbitrary-precision integer arithmetic. There is no upper limit on the number of digits.
- The bit visualization grid and signed/unsigned display are bounded by the selected bit width (8, 16, 32, or 64 bits). Values exceeding the selected width are truncated (with an overflow indicator).
- For the bitwise operations calculator, shift amounts must be within the selected bit width range.
- Floating-point numbers are not supported. This tool works with integers only.
- This tool is designed for educational and development use. Always verify critical calculations independently.
Common Use Cases
- Debugging low-level code: When working with memory addresses, register values, or binary protocols, developers frequently need to convert between hexadecimal, binary, and decimal representations. This tool provides instant conversion across all common bases and displays the result in multiple formats simultaneously.
- Understanding bitwise operations: The interactive bit grid and bitwise calculator let you visualize how AND, OR, XOR, NOT, and shift operations affect individual bits. This is invaluable when implementing bit flags, permission masks, or network subnet calculations.
- Learning number systems in computer science: Students studying computer architecture, digital logic, or programming fundamentals can use this tool to build intuition about how numbers are represented in different bases. The visual bit grid makes abstract concepts concrete.
- Working with color codes: Web developers and designers frequently convert between hexadecimal color values and their decimal RGB components. Enter a hex value like
FF8040and instantly see its decimal equivalent, or convert individual RGB channels between bases. - Analyzing network addresses and masks: Convert IP addresses and subnet masks between decimal, binary, and hexadecimal to understand network boundaries, calculate broadcast addresses, or verify CIDR notation. The bit grid makes it easy to see which bits belong to the network and host portions.
- Exploring signed and unsigned integer representations: Compare how the same bit pattern is interpreted as signed (two's complement) and unsigned values across 8, 16, 32, and 64-bit widths. This is essential for understanding integer overflow, type casting, and cross-language interoperability.
About Positional Numeral Systems
A positional numeral system represents numbers using a fixed set of digits, where each digit's value depends on its position (place value). The number of unique digits used is called the base or radix. Modern computing relies heavily on four bases: binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16).
The concept of positional notation dates back to ancient Babylon (base 60) and was refined by Indian mathematicians who developed the decimal place-value system between the 1st and 5th centuries CE. The binary system, fundamental to all digital computing, was formalized by Gottfried Wilhelm Leibniz in 1703, though its practical application had to wait until the invention of electronic computers in the mid-20th century.
- Binary (base 2): Uses digits 0 and 1. This is the native language of digital circuits, where each bit represents an on/off state. All data in computers — text, images, programs — is ultimately stored and processed as sequences of binary digits.
- Octal (base 8): Uses digits 0–7. Each octal digit maps to exactly three binary digits, making it a compact way to represent binary data. Octal is commonly used in Unix file permissions (e.g.,
755= rwxr-xr-x) and some legacy computing contexts. - Decimal (base 10): Uses digits 0–9. The standard number system for everyday human use, likely adopted because humans have ten fingers. Computers convert to and from decimal for human-readable input and output.
- Hexadecimal (base 16): Uses digits 0–9 and letters A–F. Each hex digit maps to exactly four binary digits (one nibble), making it the most popular compact representation of binary data. Memory addresses, color codes, MAC addresses, and cryptographic hashes are typically written in hexadecimal.
- Arbitrary bases (2–36): Any integer base from 2 to 36 is possible, using digits 0–9 followed by letters A–Z for values 10–35. Base 36 is the highest base representable with standard alphanumeric characters and is occasionally used for compact URL encoding and unique identifiers.
This tool uses JavaScript BigInt for arbitrary-precision arithmetic, meaning there is no upper limit on the number of digits. It converts between any base from 2 to 36, and provides interactive visualization of the binary representation through a clickable bit grid.
Frequently Asked Questions
- What is the maximum number size supported? There is no artificial limit. This tool uses JavaScript BigInt, which supports integers of arbitrary length. You can convert numbers with hundreds or thousands of digits. The practical limit is your browser's memory.
- How do I enter a hexadecimal number? Select base 16 (hexadecimal) from the input base selector, then type your number using digits 0–9 and letters A–F. The input is case-insensitive, so
ffandFFare treated identically. You can optionally prefix with0x. - What are the bit width options? The tool offers 8-bit, 16-bit, 32-bit, and 64-bit display modes. The bit width affects the bit visualization grid, signed/unsigned interpretation, and overflow detection. If your number exceeds the selected bit width, an overflow indicator is shown.
- How does two's complement work? Two's complement is the standard method for representing signed integers in computing. The most significant bit (leftmost) is the sign bit: 0 for positive, 1 for negative. To negate a number, invert all bits and add 1. The signed/unsigned display shows both interpretations of the same bit pattern.
- Can I click individual bits to toggle them? Yes. The interactive bit grid allows you to click any bit to flip it between 0 and 1. The converted values in all bases update instantly, making it easy to experiment with bit patterns and understand how each bit affects the final value.
- What bitwise operations are available? The bitwise calculator supports AND, OR, XOR, NOT, left shift, right shift (arithmetic), and right shift (logical). Enter two operands, select an operation, and see the result in all bases simultaneously with the bit-level visualization.
- Does this tool support floating-point numbers? No. This tool works with integers only. For IEEE 754 floating-point analysis, a dedicated floating-point tool would be needed. The focus here is on integer conversion and bitwise operations.
References:
Tech Blog with curated related content
Web Tools Collection