Integer Base Converter

Convert integers between bases 2–64

Supports binary, octal, decimal, hexadecimal, base64, and custom bases (2–64)

Last updated: January 24, 2026
Frank Zhao - Creator
CreatorFrank Zhao

Convert

Results

Binary (2)
101010
Octal (8)
52
Decimal (10)
42
Hexadecimal (16)
2a
Base64 (64)
G
Custom (10)
42

Introduction / overview

The Integer Base Converter translates a whole number from one base (radix) to another — anywhere from 22 to 6464. It’s perfect when you bounce between binary, octal, decimal, hexadecimal, and “custom” bases used in programming, data formats, and compact identifiers.

What problem does it solve?

  • Quickly verify conversions (e.g., hex logs to decimal) without mental arithmetic.
  • Move between human-friendly formats (decimal) and machine-friendly formats (binary/hex).
  • Interpret “weird base” digit sets for compact IDs (up to 6464).

This converter runs locally in your browser. If you’re pasting sensitive identifiers, you’re not sending them to a server from this tool.

If you’re working with tokens and IDs, you may also like our Token Generator or UUID Generator to create values, then use this converter to inspect or transform their numeric parts.

How to use / quick start

Step-by-step

1

Enter your number

Type the integer exactly as written in its current base (no prefixes like 0x0x).

2

Set the input base

Choose the base the number is currently in. For binary use 22, for hex use 1616.

3

Pick an output base

You’ll see common outputs (binary/oct/dec/hex/base64) plus a custom output base.

4

Copy the result

Use the copy button next to an output row to paste it into code, a document, or a config file.

Mini diagram (what happens under the hood)

Input

Digits in base bb (input base)

Convert

Output

Same value expressed in base bb (output base)

In practice, the tool converts to an internal integer value and then re-encodes it using the target base’s digit set.

How to interpret outputs

  • If you change the output base, the digits change but the underlying value stays the same.
  • For bases above 1010, digits extend into letters (and above 3636, uppercase letters, then ++ and //).

Digit set used by this tool (bases up to 6464)

This converter uses a fixed digit set in this exact order:

0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/

Example: in base 1616, the digits are 0–9 and a–f.

Real-world examples / use cases

Example 1: Decimal to binary (sanity check)

Background: you see 4242 in a UI, but a config file needs binary.

Inputs: value 4242, input base 1010, output base 22.

421042_{10}==1010102101010_{2}

How to apply it: if you ever doubt the binary output, convert it back to decimal and confirm it returns 4242.

Example 2: Hex to decimal (log parsing)

Background: a system log prints a code like 7b and you need the decimal value.

Inputs: value 7b\text{7b}, input base 1616, output base 1010.

7b16\text{7b}_{16}==7161+111607\cdot 16^1 + 11\cdot 16^0==112+11112 + 11==12310123_{10}

How to apply it: you can now compare the code numerically (thresholds, ordering, etc.). If you’re hashing values for logs, pairing with our Hash Text tool can be handy.

Example 3: Base64 digits (compact integer IDs)

Background: you store an integer ID in a compact base 6464 representation.

Inputs: value 2P\text{2P}, input base 6464, output base 1010.

2P64\text{2P}_{64}==2641+516402\cdot 64^1 + 51\cdot 64^0==128+51128 + 51==17910179_{10}

How to apply it: you can sort IDs numerically, or switch to base 1616 for debugging. If you’re generating IDs, you may prefer ULID Generator for lexicographic ordering.

Example 4: Binary bitmasks (feature flags)

Background: a flag value is stored as binary, but you want its decimal form for an API call.

Inputs: value 10010110\text{10010110}, input base 22, output base 1010.

100101102\text{10010110}_{2}==15010150_{10}

How to apply it: convert back to binary after editing the decimal value so you don’t accidentally flip the wrong bits.

Common scenarios / when to use

These are the moments where a base converter saves real time — especially when you’re switching contexts between code, databases, and debugging tools.

Reading hex in logs

Convert 16161010 to compare values and thresholds.

Editing bitmasks

Convert 221010 to verify which bits are set.

Compact integer IDs

Convert to base 6464 for shorter strings; convert back for sorting/debugging.

Inspecting identifiers

Convert pieces of IDs to check ranges, shards, or embedded timestamps.

Security review notes

Convert numeric constants to confirm key sizes and boundaries.

Copy/paste across tools

Convert once, then copy the output row you need (hex for dev tools, decimal for docs).

When it may not be a fit

  • If you need base64 encoding of bytes or text (RFC 4648), this tool’s “base64” is digit-based integer notation.
  • If you’re working with decimals/fractions, you’ll need a different converter (this one is integers only).

Tips & best practices

1

Normalize your input

Remove spaces and separators before converting. For hex-like values, avoid prefixes like 0x0x and keep letters consistent with the tool’s digit set.

2

Do a quick round-trip check

Convert ABA \to B and then back BAB \to A. If you get the original digits, you can trust the conversion.

3

Watch for invalid digits

In base 22, only 00 and 11 are allowed. Any other digit should be treated as an error.

4

Remember: base64 here is not text encoding

This tool’s base 6464 uses digits 090\ldots 9, letters, plus ++ and //. It does not perform byte-to-text base64 encoding.

Common mistakes to avoid

  • Mixing digit sets: A is not the same as a in this digit order.
  • Copying prefixes/suffixes: avoid 0x, b, underscores, and commas.
  • Leading minus sign: negative integers are not supported by this converter.

Calculation method / formula explanation

Base conversion relies on positional notation. If a number has digits dkdk1d1d0d_k d_{k-1}\ldots d_1 d_0 in base bb, its value is the weighted sum of each digit.

N=i=0kdibiN = \sum_{i=0}^{k} d_i\, b^i

(positional value in base b)

Variables explained

  • bb is the base (radix), where 2b642 \le b \le 64.
  • did_i is the value of the digit at position ii (starting from the right at i=0i=0).
  • NN is the resulting integer value.

Worked conversion (shown as a multi-step layout)

Convert 1a16\text{1a}_{16} to decimal:

1a16\text{1a}_{16}==1161+101601\cdot 16^1 + 10\cdot 16^0==16+1016 + 10==261026_{10}

The only “trick” is remembering that the digit aa means 1010 in base 1616.

Related concepts / background

Positional notation

In any base bb, the place values are powers of b0,b1,b2,b^0, b^1, b^2, \ldots. That’s why a single digit can “mean” different things depending on where it sits.

Digit sets and case sensitivity

For bases above 1010, the tool uses letters as additional digits. In this converter, lowercase and uppercase are distinct digits once you go above 3636.

Practical tip: if you’re expecting “classic hex” with uppercase A–F, either keep your input lowercase, or switch to a consistent format before converting.

Why base conversion matters

  • Debugging: quickly interpret machine-oriented values (hex addresses, bitmasks).
  • Storage: represent the same integer using fewer characters with larger bases.
  • Interop: some systems require a specific notation (e.g., config expects base 22 or 1616).

Frequently asked questions (FAQs)

Q

What bases does this converter support?

Any integer base from 22 to 6464. That includes binary, octal, decimal, hexadecimal, and a base 6464 digit set.

Q

Does it support negative numbers?

No — inputs must be non-negative integers. A leading minus sign is treated as an invalid digit.

Q

Why does my value show “invalid digit”?

It means at least one character isn’t allowed in the input base. For example, base 22 allows only 00 and 11.

  • Remove spaces, underscores, or prefixes (like 0x).
  • Double-check letter case when working above base 3636.
Q

Is “Base64 (64)” the same as Base64 encoding?

Not exactly. “Base 6464” here means “write an integer using 6464 possible digits.” Base64 encoding (RFC 4648) converts bytes to text and uses padding rules; this converter doesn’t do that.

Q

How can I double-check a conversion manually?

Use positional notation: multiply each digit by a power of the base and sum them. For a quick check, a small number is easiest.

10112\text{1011}_{2}==123+022+121+1201\cdot 2^3 + 0\cdot 2^2 + 1\cdot 2^1 + 1\cdot 2^0==111011_{10}
Q

Can this handle very large integers?

Yes, up to your browser’s practical limits. Under the hood, this kind of converter typically uses arbitrary-size integers (like JavaScript BigInt\text{BigInt}) so you’re not constrained by 25312^{53}-1 the way normal numbers are.

Limitations / disclaimers

  • Integers only: no decimals, fractions, or scientific notation.
  • No negative sign support.
  • The digit set is fixed (shown above). If another system uses a different digit order, results may differ.
  • This tool is for convenience and education; always validate critical conversions in your target system.

External references / sources

Integer Base Converter - Convert Between Bases 2 to 64