Number Base Converter
Convert integers between binary, octal, decimal, hexadecimal and custom number bases from 2 to 36. Supports very large integers, negative values and instant browser-based conversion.
Convert Number Bases
Convert integers between binary, octal, decimal, hexadecimal and any custom base from 2 through 36.
Prefixes such as
0b,
0o
and
0x
are recognised for binary, octal and hexadecimal.
Valid: 0–9
Source
Decimal (10)
Target
Hexadecimal (16)
Common Base Results
The same integer represented simultaneously in the four most common number systems.
Binary
Base 2
-
- digits
Octal
Base 8
-
- digits
Decimal
Base 10
-
- digits
Hexadecimal
Base 16
-
- digits
Custom Conversion
Hexadecimal Output
-
- output digits
Number Details
Inspect the current representation and conversion settings.
Input Digits
-
Sign
-
Source Base
Decimal (10)
Target Base
Hexadecimal (16)
Common Number Systems
Each base uses a different number of available digit values.
| System | Base | Digits | Example for 255 |
|---|---|---|---|
| Binary |
2
|
0–1 |
11111111
|
| Octal |
8
|
0–7 |
377
|
| Decimal |
10
|
0–9 |
255
|
| Hexadecimal |
16
|
0–9, A–F |
FF
|
| Base 36 |
36
|
0–9, A–Z |
73
|
How Positional Number Bases Work
Each digit is multiplied by a power of the base according to its position.
Binary 101101
1
2⁵
32
0
2⁴
0
1
2³
8
1
2²
4
0
2¹
0
1
2⁰
1
32 + 0 + 8 + 4 + 0 + 1 =
45
Hexadecimal Digit Values
Hexadecimal needs six additional symbols after decimal digit 9.
A
decimal 10
B
decimal 11
C
decimal 12
D
decimal 13
E
decimal 14
F
decimal 15
Common Programming Prefixes
Many programming languages use prefixes to make a number's base explicit.
0b101101
Binary
The
0b
prefix identifies base 2.
0o755
Octal
The
0o
prefix identifies base 8.
0xFF
Hexadecimal
The
0x
prefix identifies base 16.
Large Integer Conversion
Large integer conversion requires special care in JavaScript because the normal Number type cannot represent every large integer exactly.
Example Large Integer
12345678901234567890123456789012345678901234567890
SwiftVecto uses JavaScript
BigInt
for the browser conversion so large integers can remain exact instead of being
silently rounded by floating-point arithmetic.
Negative Values Use Mathematical Sign and Magnitude
This converter treats negative values mathematically. For example,
decimal
-5
becomes binary
-101.
Computers often store signed integers using two's complement, but a two's-complement representation requires a fixed width such as 8, 16, 32 or 64 bits. There is no single universal two's-complement bit pattern for an arbitrary negative integer without choosing that width first.
This Version Converts Integers Only
Decimal points and fractional base conversions are intentionally excluded from this version.
Fractions can become repeating values when converted between number systems, which requires an explicit precision and rounding policy. Keeping this tool integer-based ensures that every supported conversion remains exact.
Private Browser-Based Number Conversion
Number-base conversion happens directly inside your browser.
- No file upload is required.
- Numbers do not need to be sent to SwiftVecto's server.
- Large integer conversion uses JavaScript BigInt locally.
- Binary, octal, decimal, hexadecimal and custom-base outputs are calculated locally.
Continue with These Tools
Finished using Number Base Converter? Here are some related tools that people commonly use next to complete their workflow faster.
Unix Timestamp Converter
Convert Unix timestamps to readable dates or convert dates back to Unix time. Work with seconds, milliseconds, UTC, ISO 8601 and timezones directly in your browser.
Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to readable text instantly. Supports UTF-8 and Base64URL with private browser-based processing.
Hash Generator
Generate SHA-1, SHA-256, SHA-384 and SHA-512 hashes instantly from text. Create lowercase or uppercase hexadecimal hashes with private browser-based processing.
UUID Generator
Generate secure random UUID v4 identifiers instantly online. Create single or bulk UUIDs, choose uppercase or lowercase output, remove hyphens and copy or download results directly in your browser.
JSON Formatter & Validator
Format, beautify, minify and validate JSON online instantly. Detect invalid JSON, organise nested data and create clean, readable JSON directly in your browser.
How to Convert Numbers Between Bases
Use the SwiftVecto Number Base Converter to convert integers between binary, octal, decimal, hexadecimal and any custom base from 2 through 36. Enter a number, choose its source base and instantly view equivalent values in common number systems.
Overview
A number base, also called a radix, determines which digits are available and how place values are calculated. Decimal uses base 10 and digits 0 through 9. Binary uses base 2 and only digits 0 and 1. Octal uses base 8, while hexadecimal uses base 16 and extends the available symbols with A through F. Higher bases up to 36 continue using letters through Z. The SwiftVecto Number Base Converter converts integers without relying on normal JavaScript floating-point numbers, allowing very large values to be handled accurately using BigInt in the browser. The server fallback also uses arbitrary-length string arithmetic so large integer conversions do not depend on PHP integer limits.
Benefits
How It Works
Choose the base of the input number.
Enter an integer using digits valid for that base.
Each digit is interpreted using positional notation.
The rightmost digit has a place value of base raised to power zero.
Each position to the left increases the power of the base by one.
The number is normalized into an arbitrary-length integer representation.
That integer is then repeatedly divided by the target base to produce the converted digits.
Bases above 10 use letters to represent digit values greater than 9.
A represents 10, B represents 11 and the sequence continues through Z representing 35.
Negative numbers preserve their sign while the magnitude is converted.
The browser implementation uses BigInt for exact integer conversion.
The server fallback uses decimal string arithmetic to avoid PHP integer overflow.
How to Use This Tool
-
1Choose the source number base.
-
2Enter the integer you want to convert.
-
3Review the Binary, Octal, Decimal and Hexadecimal equivalents.
-
4Choose a custom target base if required.
-
5Review the custom conversion result.
-
6Switch between uppercase and lowercase alphabetic digits when needed.
-
7Copy any output value directly.
-
8Use Swap when converting between two custom bases.
-
9Clear the tool before starting a different conversion.
Helpful Tips
- Binary uses only 0 and 1.
- Octal uses digits 0 through 7.
- Decimal uses digits 0 through 9.
- Hexadecimal uses digits 0 through 9 and letters A through F.
- Base 36 uses digits 0 through 9 and letters A through Z.
- Letters are case-insensitive when reading an input number.
- Hexadecimal FF is equal to decimal 255.
- Binary 11111111 is also equal to decimal 255.
- Octal 377 is equal to decimal 255.
- Leading zeros do not change the numeric value.
- Negative numbers can be converted by placing - before the number.
- This tool converts mathematical integer values rather than signed two's-complement bit patterns.
- The binary representation of -5 is therefore shown as -101 rather than a fixed-width two's-complement sequence.
- Use explicit bit-width tools when you need 8-bit, 16-bit, 32-bit or 64-bit two's-complement representations.
- Fractional number-base conversion is intentionally excluded from this version to avoid ambiguous recurring-fraction precision rules.
Common Uses
Convert decimal 255 to hexadecimal FF.
Convert hexadecimal FF to binary 11111111.
Convert binary 101101 to decimal 45.
Convert octal 755 to decimal.
Convert decimal values into base 36 identifiers.
Convert a hexadecimal mask into binary for bit inspection.
Convert binary permission values into octal.
Convert large numeric identifiers without losing precision.
Convert a negative decimal integer into hexadecimal magnitude notation.
Check whether a string is valid for a particular number base.
Worked Examples
The following examples demonstrate how this tool can be used in realistic scenarios.
Decimal 255
Decimal 255 converts to binary 11111111, octal 377 and hexadecimal FF.
Binary 101101
Binary 101101 equals 32 + 8 + 4 + 1, producing decimal 45.
Hexadecimal FF
F represents decimal 15. Therefore FF is 15 × 16 + 15, which equals decimal 255.
Base 36
In base 36, Z represents the digit value 35. Therefore the single-digit value Z converts to decimal 35.
Very Large Integer
A value such as 123456789012345678901234567890 can be converted without relying on floating-point arithmetic, avoiding the precision loss that would occur with JavaScript Number.
Common Mistakes
Avoid these common mistakes to achieve the most accurate results.
- Entering the digit 2 in a binary number.
- Entering digits 8 or 9 in an octal number.
- Entering G in a hexadecimal number.
- Assuming hexadecimal letters are separate symbols rather than digit values.
- Forgetting that hexadecimal A represents decimal 10.
- Confusing a numeric value with its textual representation.
- Assuming binary 10 means decimal ten rather than decimal two.
- Using ordinary JavaScript Number conversion for integers larger than the safe integer limit.
- Expecting negative output to use two's complement automatically.
- Confusing octal 10 with decimal 10.
- Assuming leading zeros change the numeric value.
- Trying to use decimal points even though this version intentionally supports integers only.
- Entering a base below 2 or above 36.
- Assuming base 36 is case-sensitive.
- Treating hexadecimal prefixes such as 0x as part of the number when a raw base-16 value is expected.
Glossary
Definitions of the most important terms used by this tool.
Base
The number of distinct digit values available in a positional number system.
Radix
Another term for the base of a number system.
Binary
Base 2, using only digits 0 and 1.
Octal
Base 8, using digits 0 through 7.
Decimal
Base 10, using digits 0 through 9.
Hexadecimal
Base 16, using digits 0 through 9 and letters A through F.
Base 36
A positional system using digits 0 through 9 and letters A through Z.
Digit
A symbol representing one numeric value within a number system.
Place Value
The numeric contribution of a digit based on its position and a power of the number base.
Positional Notation
A number representation where the value of a digit depends on both the digit itself and its position.
BigInt
A JavaScript numeric type capable of representing integers beyond the normal Number safe-integer limit without integer precision loss.
Safe Integer
An integer JavaScript Number can represent exactly, bounded by Number.MAX_SAFE_INTEGER and Number.MIN_SAFE_INTEGER.
Two's Complement
A binary representation commonly used by computers for signed integers with a fixed bit width.
Magnitude
The absolute numeric size of a value without considering its positive or negative sign.
Integer
A whole number with no fractional component.
Frequently Asked Questions
What is a number base?
A number base determines how many distinct digit values a positional number system uses. Decimal is base 10, binary is base 2 and hexadecimal is base 16.
What is binary?
Binary is base 2 and uses only the digits 0 and 1.
What is hexadecimal?
Hexadecimal is base 16 and uses digits 0 through 9 followed by A through F for values 10 through 15.
What is octal?
Octal is base 8 and uses digits 0 through 7.
What is base 36?
Base 36 uses digits 0 through 9 and letters A through Z, allowing one digit to represent values from 0 through 35.
How do I convert binary to decimal?
Each binary digit is multiplied by a power of two according to its position and the resulting values are added together.
How do I convert decimal to binary?
A common algorithm repeatedly divides the integer by 2 and collects the remainders, which form the binary digits.
How do I convert hexadecimal to decimal?
Each hexadecimal digit is interpreted as a value from 0 through 15 and multiplied by the corresponding power of 16.
What is FF in decimal?
Hexadecimal FF equals decimal 255.
What is 255 in hexadecimal?
Decimal 255 is hexadecimal FF.
What is 255 in binary?
Decimal 255 is binary 11111111.
What is binary 101101 in decimal?
Binary 101101 equals decimal 45.
Why can binary only contain 0 and 1?
Base 2 has exactly two digit values. Those values are represented by 0 and 1.
Can hexadecimal contain the letter G?
No. Base 16 only requires digit values 0 through 15, represented by 0-9 and A-F. G first becomes available in base 17.
What does A mean in hexadecimal?
A represents decimal digit value 10.
What does F mean in hexadecimal?
F represents decimal digit value 15.
Does lowercase hex have a different value?
No. FF and ff represent the same hexadecimal value. Letter case only changes presentation.
Can this tool convert very large integers?
Yes. The browser implementation is designed to use JavaScript BigInt, and the server fallback uses arbitrary-length string arithmetic rather than depending on PHP integer size.
Why not use JavaScript Number for every conversion?
JavaScript Number cannot represent all large integers exactly beyond its safe-integer range. BigInt avoids that integer precision loss.
Can this tool convert negative numbers?
Yes. Negative integers preserve their sign while the magnitude is converted between number bases.
Does a negative binary result use two's complement?
No. This general-purpose number converter shows a mathematical sign and magnitude representation such as -101. Two's-complement output requires a chosen bit width and is a separate representation problem.
Can this tool convert fractions?
The initial version intentionally supports integers only. Fractional base conversion introduces recurring fractions and precision rules that require a separate policy.
Can I convert between any bases?
Yes, for integer values from base 2 through base 36.
Does SwiftVecto send the number to the server?
The interactive Number Base Converter is designed to perform ordinary conversion directly inside your browser.
Is the Number Base Converter free?
Yes. SwiftVecto provides this developer utility for converting integers between common and custom number bases.
Things to Know
- The tool supports integer conversion only.
- Supported bases range from 2 through 36.
- Input alphabetic digits are case-insensitive.
- Output can be displayed using uppercase or lowercase letters.
- Negative integers are supported.
- The browser implementation should use BigInt for exact integer conversion.
- The PHP fallback uses arbitrary-length decimal string arithmetic.
- The tool does not automatically produce fixed-width two's-complement values.
- Prefixes such as 0b, 0o and 0x should be normalized by the interface where practical rather than treated as ordinary digits.
- Normal interactive conversion is intended to happen directly inside the browser.
Disclaimer
This version converts mathematical integers and does not model fixed-width machine integer overflow.
Negative output uses an explicit minus sign rather than two's-complement representation.
Fractional values are intentionally unsupported in the initial version.
Users working with protocol fields or machine integers should separately account for bit width, signedness and overflow rules.
Users remain responsible for validating output against the representation required by their target system.
Official References
The following official resources were used when developing this tool and are useful for further reading.