LocalExcelTool
Get started

Number Base Converter

Convert between binary, octal, decimal and hexadecimal.

Runs in your browserNo account neededFree

What is Number Base Converter

A number base converter switches a number between binary, octal, decimal and hexadecimal representations, commonly used in programming and networking.

🔒 Everything runs in your browser. Nothing is uploaded.

What this tool actually does with your file

Where it runs
In your browser, on this page
Upload
None — the file never leaves your device
Offline
Works with the network disconnected

Radix conversion, with arbitrary precision where it matters

Any base from 2 to 36 is supported; digits above 9 are letters a–z, and case is not significant on input. The conversion is done with BigInt rather than Number, because JavaScript's Number loses integer precision above 2^53 — a 20-digit hexadecimal value would otherwise come back with its last digits rounded to zeros.

That precision boundary is not theoretical. Snowflake IDs, Ethereum wei amounts, and Bitcoin satoshi values all exceed 2^53 routinely, and a conversion that goes through Number silently returns a different number. BigInt handles them exactly, at the cost of working with strings rather than numbers.

The prefixes and the invalid digits

Input is read as digits in the stated base, with an optional 0x, 0b or 0o prefix for hexadecimal, binary and octal. Reading '010' as decimal 10 rather than octal 8 is the modern convention; older JavaScript parseInt treated a leading zero as octal, which is why some legacy systems still disagree about the same literal.

A digit outside the base is rejected rather than guessed at. '19' in base 8 is an error, not 17. Where a tool silently accepts it — by clamping to the largest digit, for example — the result is a plausible number that is simply wrong, which is harder to notice than a message.

Reading base-36 and base-62 output

Base 36 is what JavaScript's toString(36) produces — digits plus lowercase letters, no symbols. Bases above 36 are not expressible with a single case-insensitive alphabet, so implementations that offer base 62 pick a case-sensitive alphabet, and those alphabets differ between libraries. Never decode a base-62 value without knowing whose alphabet produced it.

For any base above 36, treat the string as opaque and use the same library on both ends. Round-tripping through a documented conversion is safe; hand-rolling one against an undocumented alphabet is how IDs are silently corrupted.

How to use it

  1. 1.Enter a number
  2. 2.Pick input and output bases
  3. 3.Copy the result

How Number Base Converter works under the hood

Encoding tools convert between representations of the same bytes: Base64, percent-encoding, hex, HTML entities, Unicode escapes. A correct encoder is reversible; a lossy one silently changes the data.

  1. 1

    Get the exact bytes

    Text is encoded to UTF-8 bytes with TextEncoder first; binary input is read as an ArrayBuffer. Encoding the wrong byte sequence is the most common cause of a wrong result.

  2. 2

    Apply the encoding rule

    Each format has an exact specification: Base64 uses a 64-symbol alphabet with padding, percent-encoding escapes reserved characters as UTF-8 bytes.

  3. 3

    Decode back to verify

    Round-tripping the output back to the input is the only honest proof that an encoder is correct. The tool keeps the reverse path available on the same page.

  4. Processing pipeline

Base64 is not encryption

Base64 increases size by about a third and hides nothing: anyone can decode it. It exists to carry binary data through text-only channels such as JSON, email headers and data URLs. If you need confidentiality, use encryption with a key, not an encoding.

Where encoders break

Percent-encoding applied twice turns %20 into %2520; Base64 without padding fails strict decoders; UTF-16 input decoded as UTF-8 produces replacement characters that cannot be recovered. When output looks wrong, check the byte sequence before checking the tool.

Verify it yourself

Encoders are pure functions over bytes. Decode the output again and you should get the input back exactly.

  1. 1.Open DevTools on this page and switch to the Network tab
  2. 2.Keep the filter on Fetch/XHR and run the tool
  3. 3.Confirm no request carries your file — you should see only page assets and fonts

Frequently asked questions

Which bases are supported?

Binary (2), octal (8), decimal (10) and hexadecimal (16).

Does it handle large numbers?

It converts values within JavaScript's safe integer range accurately.

What this kind of conversion cannot keep

Encoding and hashing run through the browser's Web Crypto API or a pure-JavaScript implementation. The output is deterministic: the same input always produces the same digest, so you can verify a result against any other tool.

More in Encoding