RADIX CONVERSION · NUMBER SYSTEMS
Number Base Converter
Convert a number between any two bases from 2 to 36, including fractional values, with exact integer arithmetic. Free, instant and entirely client-side.
One converter covers every pair of bases from 2 to 36, so binary, octal, decimal, hex and base-36 are all one click apart.
Convert a number between any two bases from 2 to 36, including fractional values, with exact integer arithmetic.
- Supported bases
- 2–36
- Source: Digits 0–9, A–Z
- Fraction digits
- 24
- Source: Configurable
- Prefixes accepted
- 0x / 0b / 0o
- Client-side
- 100%
- Source: No upload
Quick answer
Convert a number between any two bases from 2 to 36, including fractional values, with exact integer arithmetic. The calculator applies value = Σ dᵢ·bⁱ for integer digits + Σ dⱼ·b⁻ʲ for fractional digits and shows every intermediate value.
On this page
- 1Quick Answer
- 2Interactive Calculator
- 3Number Base Converter: Technical Breakdown
- 4Key Takeaways
- 5Developer Statistics
- 6Implementation Plans
- 7Reference Tables
- 8Formulas & How to Use
- 9Worked Examples
- 10Advanced Education: Number Base Converter
- 11Language Playbooks
- 12Glossary
- 13Mistakes & Pro Tips
- 14Use Cases
- 15Related Calculators
- 16Long-Tail Answers
- 17FAQs (14)
- 18References
Interactive Calculator
Enter a value — every result updates instantly, in your browser. Free forever, no sign-up.
Number Base Converter
All inputs are calculated locally with exact integer arithmetic where possible.
Live result
FF
Base 16
FF
Decimal
255
Input normalized
255
Integer part
FF
Number Base Converter: Technical Breakdown
Raw patterns, intermediate values and every step behind the result.
| Base 16 | FF Converted result (exact) |
|---|---|
| Decimal | 255 Exact rational value shown as a decimal expansion |
| Input normalized | 255 Base 10 |
| Integer part | FF Whole digits in the target base |
| Fraction digits | 0 Terminating fraction |
| Integer bit length | 8 Excluding the sign |
Step-by-step calculation
- 1Parse “255” in base 10.
- 2Convert the integer part 255 by repeated division by 16, collecting remainders from least to most significant.
- 3Convert the fraction by repeated multiplication by 16, collecting carry digits until the remainder is zero or 24 digits are reached.
- 4Combine the integer and fraction digits and apply the sign.
Key Takeaways
The 30-second version — the exact answers Google loves to feature.
- 1One converter covers every pair of bases from 2 to 36, so binary, octal, decimal, hex and base-36 are all one click apart.
- 2Fractional inputs are supported: the radix point is converted digit by digit, not rounded through a floating-point detour.
- 3Prefixes 0x, 0b and 0o are recognised automatically, while spaces and underscores are ignored for readability.
- 4The default precision is 24 fractional digits, enough to expose a repeating expansion and confirm where it was cut.
- 5Bases 2 through 36 are supported; digits above 9 use the letters A through Z.
Developer Statistics & Reference Facts
Numbers worth remembering. Use them to sanity-check inputs, ranges and boundary values before shipping code.
- Supported bases
- 2–36
- Source: Digits 0–9, A–Z
- Fraction digits
- 24
- Source: Configurable
- Prefixes accepted
- 0x / 0b / 0o
- Client-side
- 100%
- Source: No upload
- Integer math
- Exact
- Source: BigInt
- Radix point allowed
- 1
Implementation Plans Compared: Which Workflow Fits?
Three practical ways to use this calculator. Match the plan to the risk level of your project, then follow its safeguards.
Quick check
Best for: Everyday conversions, homework and code reviews
- Method: Paste the value into the calculator and read the headline radix conversion result.
- Precision: Exact for integers; floating-point displays are rounded for readability.
- Safeguards: Cross-check one boundary value and one ordinary value before trusting the pattern.
Production implementation
Best for: Shipping code that parses or emits binary data
- Method: Use fixed-width integer types, explicit byte order and the same width on both sides of the conversion.
- Precision: Match the exact bit width and signedness used by the file format or protocol.
- Safeguards: Add unit tests for 0, 1, −1, minimum, maximum and one-past-maximum values.
Protocol / test vector
Best for: Firmware, network protocols and interoperability work
- Method: Reproduce the published test vector in the calculator, then compare the raw hex byte-for-byte.
- Precision: Use the protocol’s declared width, polynomial, endianness and initial/final XOR values.
- Safeguards: Keep a golden vector in the repository and run it in CI on every change.
Quick Reference Tables
Widths, ranges, boundary values and language types — the lookup tables you will come back to.
Common radix boundaries
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 |
| 7 | 111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 15 | 1111 | 17 | F |
| 16 | 10000 | 20 | 10 |
| 255 | 11111111 | 377 | FF |
| 256 | 100000000 | 400 | 100 |
Formulas & How to Use This Calculator
Core relationship
value = Σ dᵢ·bⁱ for integer digits + Σ dⱼ·b⁻ʲ for fractional digits
Verification
1. Normalize the input to the stated width. 2. Apply the operation with explicit masking. 3. Compare the decimal, hex and binary readings. 4. Reverse the operation or repeat it with a boundary value.
How to use — step by step
- Choose the bit width or input format that matches your data.
- Enter the value (or values) in the input panel. Results update as you type.
- Read the headline result, then check the decimal, hex and binary rows for consistency.
- Open the technical breakdown to inspect the bit groups, mask or intermediate values.
- Compare one boundary value (0, 1, minimum or maximum) to confirm the behavior.
- Copy the result into your code or test vector, and keep the width and byte order documented.
Worked Examples
Real numbers and raw bits, fully worked — copy the pattern for your own code or protocol.
255 decimal to hexadecimal
Inputs
255, base 10 → base 16
Math
255 ÷ 16 = 15 remainder 15 (F); 15 ÷ 16 = 0 remainder 15 (F)
Result
0xFF
0.625 decimal to binary
Inputs
0.625, base 10 → base 2
Math
0.625 × 2 = 1.25 → 1; 0.25 × 2 = 0.5 → 0; 0.5 × 2 = 1.0 → 1
Result
0.101₂
0xBEEF to decimal
Inputs
BEEF, base 16 → base 10
Math
11×4096 + 14×256 + 14×16 + 15
Result
48,879
Advanced Education: Number Base Converter
Beyond the calculator — the mental models, language rules and edge cases professionals use.
How Number Base Converter works, step by step
The Number Base Converter reads a value in a source radix, separates the integer part from the fraction, and rewrites both in the target radix. Integer digits are produced by repeated division: divide by the target base, record the remainder as the next least-significant digit, and continue with the quotient until it reaches zero. Fraction digits are produced by repeated multiplication: multiply the fraction by the target base, record the integer carry as the next digit, and continue with the new fraction. The two sequences are then joined at the radix point. Because every step is exact integer arithmetic, there is no floating-point drift in the integer part. Convert a number between any two bases from 2 to 36, including fractional values, with exact integer arithmetic.
Why the radix point changes everything
Most conversion bugs happen to the right of the radix point. A fraction terminates in the target base only when its denominator divides a power of that base. One half terminates in binary because 2 is a power of 2; one tenth does not, because 10 contains a factor of 5. The Number Base Converter keeps multiplying until the remainder is zero or the configured digit limit is reached, and it marks a non-terminating expansion with an ellipsis. That distinction matters for money, measurement and protocol fields: a value that looks short in decimal can require an infinite repeating expansion in binary. When exactness matters, keep the rational form or use a decimal type rather than rounding a binary float.
Choosing between binary, octal, hexadecimal and base 36
Binary exposes the hardware bit pattern but is tedious to read. Octal groups three bits per digit and remains common in Unix file permissions. Hexadecimal groups four bits per digit and is the default for memory dumps, colour codes and protocol constants. Base 36 uses all ten digits plus twenty-six letters and is popular for compact identifiers. The Number Base Converter supports every base from 2 to 36, so you can move between the machine view and the human view without rewriting the value. Pick the base that matches the consumer of the result: hex for a register, octal for a permission mask, base 36 for a short URL-safe token.
Integer and fraction precision limits
JavaScript BigInt makes the integer part exact at any practical length, but fractional digits still need a stopping rule. The Number Base Converter defaults to 24 fraction digits, which is enough to reproduce binary32 and binary64 mantissas and to expose repeating patterns. Increasing the limit gives more digits but also makes long strings harder to read. In production code, store the exact numerator and denominator, or a scaled integer, rather than a truncated string. If a protocol specifies a fixed number of fractional bits, convert to that fixed-point scale first and only then format the result. That prevents a display rounding from leaking into a checksum or a wire field.
Prefixes, separators and sign handling
The Number Base Converter accepts 0x, 0b and 0o prefixes, ignores spaces and underscores, and accepts a leading plus or minus sign. Prefixes are convenient in source code but dangerous in protocol parsers: a field that is defined as raw hex should not silently accept a decimal-looking string. Normalize the input before parsing, reject stray characters, and decide explicitly whether a leading minus sign is allowed for the field. For unsigned formats, a negative value usually means the sender used two’s complement, so read the raw pattern and reinterpret it rather than taking the absolute value. Consistent normalization is the difference between a reliable converter and a source of silent data corruption.
Verifying a conversion with the inverse operation
A conversion is only trustworthy when it round-trips. Take the result from the Number Base Converter, convert it back to the original base, and compare the normalized strings. For fractions, compare enough digits to cover the original precision, not just the visible ones. A second check is modular: the last digit in an even base reveals parity, and digit sums reveal divisibility by base − 1. If the round trip fails, the usual causes are a dropped sign, a misplaced radix point, or a parser that treated a leading zero as octal. Keep one known-good vector for each format in your test suite so a future refactor cannot change the result silently.
Performance: when conversion cost matters
Converting a single value is cheap, but converting millions of values inside a parser or a serializer is not. Repeated division by a small base is O(number of digits) and is usually fast enough. For fixed bases, lookup tables or bit shifts are faster: binary, octal and hexadecimal map directly to groups of 1, 3 and 4 bits. The Number Base Converter is a browser tool, so it favours clarity and correctness over micro-optimization. In production, choose the conversion routine that matches your hot path, avoid building intermediate strings when you only need bytes, and benchmark with realistic payload sizes rather than a single short number.
Common real-world radix tasks
Developers use radix conversion for memory addresses, colour values, file permissions, network fields, assembly listings and compact identifiers. A hexadecimal address such as 0x7FFE1234 is easier to compare with a map file than its decimal form; an octal permission such as 0755 maps directly to owner, group and other bits; a base-36 slug is shorter than a decimal ID. The Number Base Converter keeps the integer and fraction parts separate, so it works for both register-style integers and measurement-style decimals. When you move a value between systems, record the base alongside the digits. “101” is five in binary, one hundred one in decimal, and sixty-five in hexadecimal.
Language & Platform Playbooks
The same bit pattern behaves differently in every language. Here is how to adapt the conversion safely.
C / C++
Use fixed-width types from <stdint.h> and make the width part of the type: uint32_t, int16_t, uint64_t. For number base converter, keep the value unsigned while manipulating bits, then cast only at the boundary. Enable -Wall -Wextra -Wconversion and test with UBSan to catch shifts and signed overflow.
Java / Kotlin
Java’s int and long are 32 and 64-bit two’s complement; byte and short are promoted to int in expressions. Use Integer.toUnsignedLong, Long.toUnsignedString and Integer.reverseBytes when number base converter crosses an unsigned or byte-order boundary. Kotlin’s unsigned types are experimental but useful for parsing.
Python
Python integers are arbitrary precision, so mask to the target width after every operation: value & ((1 << width) - 1). Use int.from_bytes and int.to_bytes with an explicit byteorder for number base converter, and use struct for fixed binary layouts. Never rely on the default byte order in portable code.
JavaScript / TypeScript
JavaScript bitwise operators coerce to 32-bit signed integers. Use BigInt for 64-bit number base converter, mask with BigInt.asUintN, and remember that JSON cannot serialize BigInt. DataView is the reliable way to read and write float and integer fields in an ArrayBuffer.
Rust
Rust makes width and signedness explicit: u8, i32, u64. Use wrapping_*, checked_* or overflowing_* for arithmetic, from_le_bytes and from_be_bytes for byte order, and count_ones, leading_zeros and trailing_zeros for bit operations. The Number Base Converter results map directly to these methods.
Go
Go’s integer types have defined widths; int is platform-dependent, so use int32 or int64 when the width matters. Use encoding/binary with an explicit byte order for number base converter, and math/bits for population count, leading zeros and rotations. Go panics on some out-of-range shifts, so validate the amount.
C# / .NET
C# has checked and unchecked contexts; use unchecked explicitly when wraparound is intended. Convert.ToInt32 and BitConverter respect the platform’s endianness, so use BinaryPrimitives.ReadInt32LittleEndian or the big-endian variant for number base converter. System.Numerics.BitOperations provides popcount and zero counts.
Embedded / bare metal
On a microcontroller, confirm the register width and access size before writing. Use volatile pointers for memory-mapped registers, mask reserved bits, and respect write-1-to-clear semantics. For number base converter, keep the arithmetic in the register’s native width and avoid 64-bit division on small cores unless the library is available.
Glossary: Key Terms Explained
- Radix
- The base of a positional number system. Binary is radix 2, octal radix 8, decimal radix 10 and hexadecimal radix 16.
- Radix point
- The separator between integer and fractional digits. It is called a decimal point only in base 10.
- Positional weight
- The value of a digit is its face value multiplied by the base raised to its position index.
- Terminating fraction
- A fraction whose expansion ends because the remainder reaches zero. 0.5 is terminating in binary; 0.1 is not.
- Bit
- A binary digit: 0 or 1. Bits are grouped into bytes, words and registers.
- Byte
- Eight bits. A byte is the smallest addressable unit on most CPUs and the usual unit for file sizes.
- Word
- The natural register width of a CPU. On modern 64-bit systems a word is usually 64 bits, though C’s int is often 32 bits.
- MSB / LSB
- Most significant bit and least significant bit. The MSB carries the largest positional weight and is the sign bit in signed integers.
Common Mistakes & Pro Tips
Mistakes that break conversions
- Mixing widths in one expression: a 32-bit value read as 16 bits silently loses the high half.
- Assuming decimal text is already a raw bit pattern; use the correct input format and radix.
- Forgetting that signed right shifts and signed overflow are implementation-defined in C and C++.
- Comparing floating-point results with exact equality instead of a magnitude-aware tolerance.
Pro tips for production code
- Write the width and signedness into type names or variable names so the reader cannot misread them.
- Add boundary vectors to CI: 0, 1, −1, minimum, maximum and one-past-maximum.
- When debugging, print the raw hex first; decimal formatting hides byte-order mistakes.
- Prefer standard library conversion functions over hand-rolled parsers for untrusted input.
Who Should Use This Calculator?
- ▸ Code review: confirm that a constant, mask or serialized field matches the specification.
- ▸ Test-vector generation: produce expected hex and binary values for unit tests.
- ▸ Debugging: decode a register dump, packet capture or file header without writing a script.
- ▸ Teaching: show the intermediate steps behind a representation change.
Related Programming Calculators
Keep going — every tool below links directly into this workflow.
People Also Search For
Tap a long-tail question to jump to the matching FAQ answer.
Frequently Asked Questions (14)
Long-tail answers: each question targets a real Google search about number base converter — click to expand.
Showing 14 of 14 answers.
How do I convert a fraction between bases?
Why is 0.1 not exact in binary?
Is the Number Base Converter exact?
Can I use the Number Base Converter for 64-bit values?
Why does the Number Base Converter show a different result from my code?
What is a safe way to test number base converter results?
Does the Number Base Converter send my data anywhere?
Why do I see an error or an empty result in the Number Base Converter?
What is the number base converter used for?
How do I read the number base converter result?
What formula does the number base converter use?
What is a common mistake when using number base converter?
How do I verify a number base converter result by hand?
Does the number base converter work offline?
Resources & Authoritative References
Further reading
- cppreference — integer types — Widths, ranges and integer conversion rules for C and C++.
- MDN — JavaScript bitwise operators — How JavaScript coerces operands to 32-bit integers.
- Python — int.from_bytes — Byte order and signed interpretation in Python.
- Rust — primitive types — Width-specific methods such as rotate_left and count_ones.
- Intel — intrinsic guide — POPCNT, LZCNT, TZCNT and other bit-manipulation instructions.
- RFC 1071 — Internet checksum — The one’s complement checksum used by IPv4, TCP and UDP.
Authoritative sources
Was this calculator helpful?
Last updated: October 2026 · Free forever · No sign-up · Part of Programming Calculators at Atlascalcs.com · All math runs in your browser