liminfo

Number Base Converter

Free web tool: Number Base Converter

0b
0o
0x

Quick Reference

DecBinOctHex
0000
1111
21022
410044
81000108
10101012A
15111117F
16100002010
321000004020
64100000010040
12711111111777F
1281000000020080
25511111111377FF
256100000000400100

Click a row to convert that value

About Number Base Converter

The Number Base Converter & Bit Visualizer is an interactive tool for converting integers between binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Type a value in any input field and all other bases update simultaneously in real time. The four base inputs are displayed in a 2x2 grid layout for quick visual comparison, with each field showing its programming prefix (0b, 0o, 0x) and one-click copy functionality.

The standout feature is the interactive bit visualization panel. Once you enter any number, a visual grid appears showing every individual bit as a clickable cell. Toggle any bit on or off by clicking it, and the number across all bases updates instantly. Choose between 8-bit, 16-bit, and 32-bit views to match your use case — from single-byte microcontroller registers to 32-bit integer analysis. The sign bit is highlighted in red for easy identification, while active data bits appear in blue.

Below the bit grid, the tool displays two's complement information: sign bit status, signed value, unsigned value, and the full hex representation with zero-padding. An overflow warning appears when the number exceeds the selected bit width's signed range, showing only the lower bits. A quick reference table of common values (0 to 256) is shown when no number is entered, and clicking any row instantly loads that value for conversion.

All processing runs entirely in your browser using JavaScript's native parseInt() and toString(). No data leaves your machine. The tool supports negative numbers through two's complement representation and handles values up to JavaScript's safe integer limit (2^53 - 1).

Key Features

  • Real-time simultaneous conversion across binary, octal, decimal, and hexadecimal — type in any field and all others update instantly
  • Interactive bit visualization grid with clickable cells — toggle individual bits on/off to change the number
  • Switchable 8-bit, 16-bit, and 32-bit views for different register and word size analysis
  • Two's complement display showing sign bit, signed value, unsigned value, and zero-padded hex
  • Sign bit highlighted in red, data bits in blue for instant visual differentiation
  • Nibble-aligned hex labels below each 4-bit group for quick hex-to-binary cross-reference
  • Overflow detection with warning when the value exceeds the selected bit width range
  • Negative number support via two's complement representation in the bit visualization
  • Quick reference table of common values (0-256) with click-to-convert functionality
  • One-click copy with prefix (0b, 0o, 0x) for direct use in source code
  • 100% client-side processing — no server communication, all conversions in browser
  • Automatic prefix stripping (0b, 0x, 0o) from pasted values for seamless input

Frequently Asked Questions

What is a number base (radix)?

A number base (or radix) defines how many unique digits a numbering system uses. Decimal (base 10) uses digits 0-9, binary (base 2) uses 0-1, octal (base 8) uses 0-7, and hexadecimal (base 16) uses 0-9 plus A-F. Computers fundamentally operate in binary, but hex is preferred for human readability because each hex digit maps exactly to 4 binary digits (one nibble).

How do I use the bit visualization?

Enter any number in one of the four base fields. The bit visualization panel appears below, showing each bit as a clickable square. Blue squares represent 1 bits, gray squares represent 0 bits, and the leftmost bit (sign bit) appears in red when set. Click any square to toggle that bit, which instantly updates the number in all four base fields. Use the 8-bit, 16-bit, or 32-bit buttons to change the view width.

What is two's complement?

Two's complement is the standard way computers represent signed integers. In this system, the most significant bit (MSB) serves as the sign bit: 0 for positive, 1 for negative. For negative numbers, you invert all bits and add 1. For example, -1 in 8-bit two's complement is 11111111 (0xFF), and -128 is 10000000 (0x80). The bit visualization shows both the signed and unsigned interpretation of the same bit pattern.

Why does clicking the sign bit change the number so dramatically?

The sign bit (leftmost bit, shown in red) determines whether the number is interpreted as positive or negative in two's complement. Toggling it flips the sign interpretation. For example, in 8-bit mode, toggling the sign bit of 00000001 (decimal 1) gives 10000001 (decimal -127). This is because the sign bit represents -128 in 8-bit two's complement, so setting it subtracts 128 from the unsigned value.

What happens when my number is too large for the selected bit width?

A yellow warning appears indicating the value exceeds the signed range for that bit width (e.g., -128 to 127 for 8-bit). The tool displays only the lower N bits of the number, which is equivalent to a truncation or modulo operation. Switch to a wider bit view (16-bit or 32-bit) to see the full representation.

Why do programmers use hexadecimal?

Hexadecimal is compact and maps cleanly to binary — each hex digit represents exactly 4 bits. This makes it ideal for representing memory addresses, color values (#RRGGBB), byte sequences, MAC addresses, and bitfield values. The nibble labels below the bit grid show this mapping: each group of 4 bits corresponds to one hex digit.

What is octal used for?

Octal (base 8) is most commonly used in Unix/Linux file permissions. The chmod command uses three octal digits to represent read (4), write (2), and execute (1) permissions for owner, group, and others. For example, chmod 755 means rwxr-xr-x.

What is the maximum number this tool can convert?

The tool handles integers up to JavaScript's maximum safe integer (2^53 - 1 = 9,007,199,254,740,991). The bit visualization supports 8-bit, 16-bit, and 32-bit signed views. For the conversion fields, larger numbers work but the bit visualization will show only the lower bits with an overflow warning.

Is my data safe?

Yes. All conversions and bit manipulations happen entirely in your browser using JavaScript's built-in functions. No input values are transmitted to any server or stored anywhere.