ASCII to Any Base Converter

Converts plain text to space-separated character codes in a base you choose from 2 to 36, using uppercase letters for digits above 9, strictly validating that every character actually falls within the 0-127 ASCII range before encoding it. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-27

Overview

Introduction

Binary, octal, decimal, and hex are just the most common of infinitely many positional number bases, and sometimes you need ASCII character codes in a less common one, base 32 or base 36 for compact identifiers, for instance.

This tool converts plain text to its character codes in whatever base from 2 to 36 you choose, while strictly enforcing that every character actually fits in the 7-bit ASCII space.

What Is ASCII to Any Base Converter?

A general-purpose ASCII-to-base encoder that walks each character of the input, looks up its ASCII code, and formats that code in your chosen base.

Rather than offering only fixed presets like binary and hex, it accepts any integer base from 2 through 36, covering unusual bases you might need for compact identifiers or puzzles.

How ASCII to Any Base Converter Works

The input is split into individual characters by Unicode code point, and each character's code point is checked against the 0-127 range before the base is validated as an integer between 2 and 36.

If every character passes, each one's decimal code is converted to the chosen base with `.toString(base)` and uppercased, then joined with single spaces in original order. If any character fails the ASCII check, conversion stops immediately and reports that character.

When To Use ASCII to Any Base Converter

Use it whenever you need ASCII character codes in a base other than the usual binary/octal/decimal/hex options, base-36 identifiers or base-32 encoded puzzle data, for example.

For the common cases (base 2, 8, or 16), a dedicated single-purpose converter like ASCII to Binary Converter is equally correct if you'd rather not think about base selection.

Features

Advantages

  • Supports the full valid range of positional output bases (2 to 36), not just a handful of preset options.
  • Catches non-ASCII characters immediately with a precise error instead of silently producing an incorrect value.
  • Reports the exact character and position of any validation failure, making it fast to locate and fix problem input.

Limitations

  • Cannot encode any text containing accented letters, non-Latin scripts, emoji, or other characters above code point 127; it errors out instead.
  • Output bases above 36 aren't supported, since there's no standard single-character digit set beyond 0-9 and A-Z.

Examples

Encoding to base 36

Input

Hi

Output

20 2X

'H' (72 decimal) is "20" in base 36, and 'i' (105 decimal) is "2X" in base 36.

Encoding to base 16

Input

Hi

Output

48 69

Base 16 output matches the ASCII to Hex Converter exactly, since both encode the same underlying codes.

Rejecting a non-ASCII character

Input

Héllo

Output

Character "é" at position 2 has code point 233 (0xE9), which is outside the 7-bit ASCII range (0-127).

'é' is code point 233, above the 127 limit, so conversion is rejected regardless of the chosen base.

Best Practices & Notes

Best Practices

  • Double check the base you've selected before relying on the output; base 32 and base 36 both look similar structurally but produce very different digit strings.
  • For a fixed, well-known base like binary or hex, a dedicated converter may be marginally clearer, but this tool produces identical results for those bases too.

Developer Notes

Implemented by validating the input as strict ASCII via the shared `validateStrictAscii` helper, then calling `.toString(base).toUpperCase()` per character's code point; the base itself is validated as an integer strictly between 2 and 36 inclusive before any encoding happens.

ASCII to Any Base Converter Use Cases

  • Generating compact base-36 identifiers or tokens from ASCII text
  • Exploring how ASCII character codes look across different number bases for teaching purposes
  • Producing base-32-style puzzle or novelty encodings from plain text

Common Mistakes

  • Assuming any "plain-looking" text is ASCII; smart quotes, em dashes, and other characters pasted from word processors are often outside the 0-127 range and will be rejected.
  • Entering a base outside the 2-36 range and expecting it to work; there's no valid single-character digit set beyond that range.

Tips

  • Set the base to 16 to reproduce the exact output of ASCII to Hex Converter, or to 2 for ASCII to Binary Converter, as a sanity check that the two tools agree.
  • Round-trip the output through Any Base to ASCII Converter (with the same base selected) to confirm the encoding matches what you expect.

References

Frequently Asked Questions