TToolbox
2·16

Radix Converter

Binary, decimal and hex conversion

About this tool

Number bases (Radix) form the foundation of computer architectures and digital logic. While processors operate on binary (Base 2), humans rely on decimal (Base 10) alongside octal (Base 8) and hexadecimal (Base 16) to inspect memory addresses, byte offsets, and bitwise masks. This tool provides bidirectional radix conversions across any base from 2 to 36, supporting arbitrary-precision integers and two's complement arithmetic.

How to Use This Tool (Step-by-Step)

1

Enter Number in Any Base

Type or paste your number into any base field: Binary, Octal, Decimal, or Hexadecimal. BigInt support handles massive values.

2

Real-Time Synchronized Conversion

Editing any input field instantly updates all other base equivalents in parallel alongside byte length and ASCII character mapping.

3

Copy Converted Radix Output

Copy the target base representation with a single click, ready for embedding in embedded C firmware, disassemblers, or packet analyzers.

Arbitrary-Precision BigInt Support

Leverages native BigInt engines to bypass the standard 53-bit floating-point limit, handling massive 64-bit and 128-bit values without precision loss.

Arbitrary Base 2 to 36 Range

Beyond standard 2/8/10/16 formats, supports custom bases up to Base36 (alphanumeric 0-9 and a-z), ideal for compact URL shortener algorithms.

100% Client-Side Air-Gapped

All radix transformations execute entirely in local browser memory without network latency, safeguarding proprietary hardware tokens.

Bitwise Concepts & Two's Complement

  • •Computers represent negative numbers via Two's Complement: Invert bits and add 1. This unifies subtraction into addition circuitry and eliminates negative zero.
  • •1:4 mapping between Hex and Binary: Exactly 4 binary bits map to 1 hexadecimal digit. 0xA5 maps directly to 1010 (A) and 0101 (5), allowing instant mental decoding.
  • •Why Linux chmod uses Octal: Read (4), Write (2), and Execute (1) sum to 0–7, cleanly occupying 3 binary bits. Octal '755' maps directly to rwxr-xr-x.

Code & Transformation Examples

Common Radix Representation Comparison

Standard Bases
• 十进制 (Decimal, Base 10)     : 255
• 二进制 (Binary, Base 2)       : 11111111
• 八进制 (Octal, Base 8)        : 377
• 十六进制 (Hexadecimal, Base 16): FF
Language Prefix Conventions
• 二进制前缀   : 0b11111111
• 八进制前缀   : 0o377
• 十六进制前缀 : 0xFF

* Modern languages standardize on 0b, 0o, and 0x prefixes for numeric literals.

JavaScript Radix Conversion Snippet

Number to Radix String
const num = 255;
console.log(num.toString(2));  // "11111111"
console.log(num.toString(16)); // "ff"
console.log(num.toString(36)); // "73"
Parse Radix String to Number
console.log(parseInt("11111111", 2)); // 255
console.log(parseInt("FF", 16));       // 255
console.log(BigInt("0xffffffffffffffff")); // 支持超大数

* Number.prototype.toString(radix) natively accepts any base between 2 and 36.

Frequently Asked Questions

Q: Why do computers use binary instead of decimal?

A: Binary transistors need only distinguish two stable physical states: on (high voltage) and off (low voltage), providing maximum noise tolerance at minimum cost.

Q: Does letter casing matter in hexadecimal?

A: Mathematically and syntactically, casing is irrelevant (a-f equals A-F, representing 10–15). Standard coding guidelines recommend consistent lowercase.

Q: Where is Base36 commonly used?

A: Base36 combines 0–9 and A–Z (case-insensitive). It is widely adopted to compact huge numerical database IDs into short, human-friendly URLs and redeem codes.

Related Tools

All processing happens locally in your browser. Your data is never uploaded to a server.
/