संख्या आधार कनवर्टर
बाइनरी, ऑक्टल, दशमलव और हेक्साडेसिमल के बीच कनवर्ट करें।
संख्या आधार समझना
संख्या आधार (या रेडिक्स) निर्धारित करता है कि संख्याओं का प्रतिनिधित्व करने के लिए कितने अनूठे अंक सेवा करते हैं। सबसे परिचित बेस 10 (दशमलव) है।
- बाइनरी (बेस 2): सभी डिजिटल सिस्टम द्वारा आंतरिक रूप से उपयोग की जाती है। प्रत्येक अंक एक "बिट" है।
- ऑक्टल (बेस 8): 0-7 अंकों का उपयोग करता है। Unix फ़ाइल अनुमतियों के लिए सामान्य (जैसे chmod 755)।
- दशमलव (बेस 10): मानक मानव संख्या प्रणाली।
- हेक्साडेसिमल (बेस 16): 0-9 और A-F का उपयोग करता है। रंगों (#FF0000), मेमोरी पतों और डेटा के प्रतिनिधित्व के लिए व्यापक रूप से उपयोग होता है।
अक्सर पूछे जाने वाले प्रश्न
क्या यह बहुत बड़ी संख्याओं का समर्थन करता है?
हाँ। यह टूल JavaScript BigInt का उपयोग करता है, जो बिना सटीकता के नुकसान के मनमाने ढंग से बड़े पूर्णांकों का समर्थन करता है।
कंप्यूटिंग में बाइनरी क्यों महत्वपूर्ण है?
कंप्यूटर दो-स्थिति विद्युत संकेत (चालू/बंद) का उपयोग करते हैं, जो स्वाभाविक रूप से बाइनरी (1/0) से मेल खाते हैं।
How positional notation works
A positional number system represents a number using a fixed-size set of digit symbols, where the position of each digit determines its weight. The weight of position i (counted from the right, starting at zero) is base^i. The number's value is the sum of digit × base^i across all positions. The string 352 in base 10 means 3×100 + 5×10 + 2×1 = 352. The string 1011 in base 2 means 1×8 + 0×4 + 1×2 + 1×1 = 11 in decimal.
Positional notation is one of two big inventions in number representation. The other is non-positional (Roman numerals, Egyptian hieratic), where symbols have fixed values regardless of position. Positional systems compress; non-positional systems don't, the number 1,888 takes four digits in decimal but eight characters in Roman: MDCCCLXXXVIII.
A short history of bases
The Babylonians ran a positional base-60 (sexagesimal) system at least as early as the Old Babylonian period, around 1900–1600 BC. Cuneiform tablets from that era already use positional notation. Why 60? It has a uniquely high count of small divisors (1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60), which made fraction arithmetic easier in a pre-decimal-fraction world. The Babylonian legacy is still in your pocket: time (60 seconds in a minute, 60 minutes in an hour) and angles / geographic coordinates (360 degrees in a circle, 60 minutes of arc per degree, 60 seconds of arc per minute) are direct descendants. When you read a clock or a latitude, you're reading sexagesimal.
The decimal positional system as we know it was developed by Indian mathematicians in the early centuries AD. The conceptual leap that distinguishes it from earlier counting boards is a written symbol for zero acting as a placeholder. The earliest unambiguous use of zero in a positional context is generally attributed to Brahmagupta (628 AD), whose treatise Brāhmasphuṭasiddhānta gave rules for arithmetic with zero. The Bakhshali manuscript shows even earlier use of a dot (bindu) as a placeholder.
The decimal system travelled from India to the Islamic world in the 8th–9th century, the Persian polymath al-Khwārizmī wrote On the Calculation with Hindu Numerals around 825 AD ("algorithm" and "algebra" are direct etymological descendants of his name and book titles). Europe lagged. Leonardo of Pisa, known as Fibonacci, formally introduced Hindu-Arabic numerals to Latin Europe in Liber Abaci (1202), demonstrating their superiority over Roman numerals. Roman numerals lingered in European bookkeeping into the 16th century.
Gottfried Wilhelm Leibniz described a fully binary number system in his 1703 paper Explication de l'arithmétique binaire: though his primary motivation was philosophical (correspondence with the I Ching) rather than practical. The leap to binary computing came with Claude Shannon's 1937 master's thesis at MIT, "A Symbolic Analysis of Relay and Switching Circuits," which showed Boolean algebra could model electrical relay networks, making binary the natural language of digital logic.
The conversion algorithms
Decimal to other base, repeated division. To convert a decimal integer N into base b, divide N by b, record the remainder, replace N with the quotient, and repeat until the quotient is 0. The remainders read bottom-to-top are the digits in base b. Worked example for 156 to binary: 156÷2 = 78 r0, 78÷2 = 39 r0, 39÷2 = 19 r1, 19÷2 = 9 r1, 9÷2 = 4 r1, 4÷2 = 2 r0, 2÷2 = 1 r0, 1÷2 = 0 r1, reading remainders bottom-up: 10011100. Verify: 128 + 16 + 8 + 4 = 156.
Other base to decimal, Horner's method. Start with 0; for each digit left-to-right, multiply the running total by the base and add the new digit. Worked example for hex 1F4: 0×16 + 1 = 1, then 1×16 + 15 = 31, then 31×16 + 4 = 500.
Both algorithms run in linear time relative to the number of digits, and JavaScript's BigInt implements them under the hood, which is why this tool has no precision ceiling. A 200-digit number converts cleanly between any two bases without rounding loss, the same way a calculator with arbitrary-precision integer arithmetic would.
The four bases that matter in computing
- Binary (base 2): transistors are on or off, so binary is the natural representation for digital logic. Every piece of data, ultimately, is binary.
- Octal (base 8): historically common in early computing because 3 binary digits map cleanly to 1 octal digit. Less prominent today but still used in Unix file permissions (
chmod 755) and some legacy file formats. - Decimal (base 10): the everyday human number system, almost certainly because we have ten fingers. Used by financial systems, science, anywhere humans read numbers.
- Hexadecimal (base 16): exactly 4 bits per digit, which means 1 byte = 2 hex characters. The de facto standard for compact byte-level representation: hex colour codes (
#FF0000), memory addresses (0x7fff...), Unicode code points (U+1F600), MAC addresses, hash digests.
Powers of 2 worth memorising
| Power | Decimal | Hex | Why it matters |
|---|---|---|---|
| 2⁸ | 256 | 0x100 | One byte; max value of an 8-bit channel (RGB) |
| 2¹⁰ | 1,024 | 0x400 | "1K" in computing context |
| 2¹⁶ | 65,536 | 0x10000 | UTF-16 BMP size; 16-bit integer max |
| 2²⁰ | 1,048,576 | 0x100000 | "1M" in computing context |
| 2²⁴ | 16,777,216 | 0x1000000 | 24-bit RGB ("16.7M colors") |
| 2³² | ~4.3 billion | 0x100000000 | 32-bit unsigned integer max; IPv4 address space |
| 2⁶⁴ | ~1.8×10¹⁹ | 0x100… | 64-bit integer max; well beyond floating-point precision |
When you'd reach for a base converter
- Reading hex dumps from a debugger, network packet capture, or binary file. Translating
0xFFto 255 in your head is fine;0x7F4Ausually isn't. - CSS colour codes:
#FF0000is decimal (255, 0, 0). The hex-to-RGB conversion is exactly base 16 → base 10 on each two-character pair. - Unix file permissions:
chmod 755is octal: 7 = rwx (read+write+execute = 4+2+1), 5 = r-x (read+execute = 4+1), 5 again. Each octal digit is exactly 3 binary bits. - IPv4 octets: addresses like
192.168.1.1are four 8-bit numbers. Subnet masks are easier to reason about in binary (a/24mask is 24 ones followed by 8 zeros). - Unicode code points: characters are catalogued in hex (U+2665 for ♥, U+1F600 for 😀). Decimal equivalents exist but the hex form matches Unicode charts.
- Bitmask arithmetic: feature flags, permission bits, hardware register values are all easier to read as binary or hex than decimal.
- Debugging assembly or disassembled code: addresses, opcodes and immediate values are conventionally written in hex.
Other bases worth knowing
- Base 36: the highest base that fits in alphanumerics with no special characters (10 digits + 26 letters). Used for short URL hashes and some encoding schemes. JavaScript's
Number.toString(36)exposes it directly. - Base 58: used in Bitcoin and Ripple addresses. Skips the easily-confused characters
0(zero),O(capital O),I(capital I) andl(lowercase L) so addresses are robust to handwritten transcription errors. - Base 62: full alphanumeric (digits + lower + upper case). Common in URL shortener slugs (the "abc123" in
example.com/abc123). - Base 64: encodes binary data as printable ASCII for transport over text-only channels (email, JSON, URLs). Different scope from this tool, it operates on byte streams rather than integers.
Source-code prefix conventions
Most modern languages use the same set of literal prefixes to disambiguate base in source code:
- Binary:
0bor0B(Python, Ruby, Java since 7, C++ since C++14, JavaScript since ES6, Rust). Example:0b10011100. - Octal:
0oor0O(Python 3, ES6, Rust). Older C-family languages use a leading zero (0755), which is occasionally a footgun if you accidentally pad a decimal with a zero. - Hex:
0xor0X: universally understood across virtually every programming language. - Decimal: no prefix needed.
More questions
What about negative numbers?
Computers represent negative integers using two's complement: invert all the bits and add 1. So in 8-bit two's complement, −1 is 11111111 (0xFF), −5 is 11111011 (0xFB), and −128 is 10000000 (0x80). The most significant bit indicates the sign. This tool displays negative integers with a leading minus sign rather than a two's-complement representation, because the latter only makes sense at a fixed bit width, and since the tool uses arbitrary-precision BigInt, there's no fixed width to interpret against.
Why does hex use letters A–F?
Because base 16 needs 16 distinct digit symbols and the decimal digits 0–9 only provide ten. The convention of using A–F (case-insensitive) for 10–15 was popularised by IBM System/360 in the 1960s and standardised across the industry. Earlier systems experimented with other glyphs (Bendix's G-15 used u, v, w, x, y, z) but A–F won.
Can this tool handle fractions?
No, it's integer-only. Fractional base conversion is more complex because most decimal fractions don't have an exact representation in binary (the famous 0.1 + 0.2 ≠ 0.3 floating-point problem). For floating-point bit-level inspection, a dedicated IEEE 754 visualiser is the right tool.
Does anything get sent to a server?
No. The conversions run in your browser using JavaScript's native BigInt arithmetic. Nothing about your input leaves the page; the tool works offline once it's loaded.
संबंधित टूल
मुफ़्त इकाई कनवर्टर ऑनलाइन
विभिन्न माप इकाइयों के बीच परिवर्तित करें। लंबाई, वजन, तापमान और अधिक। तुरंत गणना करें।
मुफ़्त हैश जनरेटर
टेक्स्ट या फ़ाइलों से MD5, SHA-1, SHA-256, SHA-384, SHA-512 हैश बनाएं। HMAC हस्ताक्षर समर्थित। ब्राउज़र-आधारित, कोई अपलोड नहीं।
प्रतिशत कैलकुलेटर
प्रतिशत तुरंत कैलकुलेट करें। किसी संख्या का X% निकालें, प्रतिशत परिवर्तन और वृद्धि/कमी जानें। सरल और तेज़ ऑनलाइन प्रतिशत कैलकुलेटर। मुफ़्त।