Overview
Introduction
Hexadecimal is just one of infinitely many positional number bases; sometimes you have a value in binary, octal, base-36, or something in between, and need it in hex.
This tool takes a number in whatever base from 2 to 36 you specify and converts it to hexadecimal, entirely client-side.
What Is Arbitrary Base to Hex Converter?
A general-purpose base converter specialized for hex output: it parses a number you enter in any base from 2 through 36 and outputs its exact value in hexadecimal.
Rather than offering a fixed dropdown of "common" source bases like binary, octal, and decimal, it accepts any integer base in that full range, covering unusual bases you might need for esoteric encodings or puzzles.
How Arbitrary Base to Hex Converter Works
The input is validated digit-by-digit against the chosen base (each character must have a value strictly less than the base), with an optional leading sign accepted.
Each digit is accumulated into a BigInt using the standard positional-notation formula (value = value x base + digit) so arbitrarily large values are supported without precision loss, then the final BigInt is rendered as hexadecimal via `.toString(16)` and uppercased.
When To Use Arbitrary Base to Hex Converter
Use it whenever you have a value expressed in a base other than the usual binary/octal/decimal trio and need it in hex, base-36 identifiers, base-32 encoded data, or any other base a specific format produced.
It also works fine for the common cases (base 2, 8, 10) if you'd rather not switch to a dedicated single-purpose converter like Decimal to Hex.
Often used alongside Hex to Arbitrary Base Converter, Decimal to Hex Converter and Binary to Hex Converter.
Features
Advantages
- Supports the full valid range of positional input bases (2 to 36), not just a handful of preset options.
- Exact for arbitrarily large values thanks to BigInt accumulation, avoiding the precision loss of `parseInt`.
- Handles negative input by preserving the sign in the hexadecimal output.
Limitations
- Input bases above 36 aren't supported, since there's no standard single-character digit set beyond 0-9 and A-Z.
- The tool expects standard positional notation with a single sign character; it doesn't parse other numeral system conventions like Roman numerals.
Examples
Best Practices & Notes
Best Practices
- Double check the input base actually matches your source data; base-32 and base-36 both look similar but interpret the same digit string very differently.
- For a fixed, well-known input base like decimal or binary, a dedicated converter may be marginally clearer, but this tool produces identical results.
Developer Notes
Implemented by walking the input string one character at a time, looking up each character's numeric value in a shared 0-9/a-z digit map, rejecting any character whose value is not strictly less than the chosen base, and folding the digits into a BigInt via `value = value * BigInt(base) + BigInt(digitValue)`; the final BigInt is formatted with `.toString(16).toUpperCase()`, mirroring the BigInt-safety approach the sibling Hex to Arbitrary Base Converter uses in the opposite direction.
Arbitrary Base to Hex Converter Use Cases
- Converting a base-36 short code back into a hex identifier
- Converting binary or octal data you have on hand into hex
- Checking a value's hex form when you only have it in an unusual base
Common Mistakes
- Entering a base outside the 2-36 range and expecting it to work; there's no valid single-character digit set beyond that range.
- Using a digit that's out of range for the chosen base, e.g. entering "9" while the base is set to 8; the tool reports exactly which character is invalid.
- Forgetting that letters in the input represent digit values, not literal alphabetic characters (e.g. "Q" in base 36 means 26, not the letter itself).
Tips
- For base 16, the output will simply match your (uppercased) input, useful as a quick sanity check that the parser read your value correctly.
- Use the Hex to Arbitrary Base Converter instead if you're starting from hex and need a different output base.