Letters to Digits Converter

Maps each letter in the text to its 1-based alphabet position (a/A=1 through z/Z=26), producing a space-separated output where every character becomes its own token; non-letters pass through unchanged as their own token. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-23

Overview

Introduction

Converting letters to their alphabet position numbers is a classic simple cipher used in puzzles, games, and basic cryptography exercises.

This tool runs entirely client-side, so nothing you paste is ever uploaded to a server.

What Is Letters to Digits Converter?

A converter that maps every letter in your text to its 1-based alphabet position number, known as the A1Z26 scheme (a=1 through z=26).

It's part of this site's String Tools collection and works entirely in your browser, converting text instantly as you type.

How Letters to Digits Converter Works

The tool inspects each character of the input individually; if it's a letter (case-insensitive), it's converted to its position number by subtracting the character code of 'a' minus 1.

Every character, whether it converts to a number or not, becomes its own token in the output, and all tokens are joined with a single space.

When To Use Letters to Digits Converter

Use it to encode a word or phrase into the A1Z26 letter-number cipher for a puzzle, game, or educational demonstration.

It's also handy for quickly checking a letter's alphabet position without counting manually.

Often used alongside Case Converter and Find & Replace Tool.

Features

Advantages

  • Non-letter characters are preserved as their own token rather than silently dropped.
  • Case-insensitive, so uppercase and lowercase letters convert identically.
  • Emits every character as its own token, so the output token count always matches the input character count and the two can be lined up directly.

Limitations

  • Only handles the basic Latin alphabet; letters from other scripts are not converted.
  • Spaces become tokens in their own right rather than acting as separators, which makes word boundaries hard to pick out of the numeric output.

Examples

Converting a short word

Input

cab

Output

3 1 2

'c' is the 3rd letter, 'a' is the 1st, and 'b' is the 2nd, each output as its own space-separated token.

Best Practices & Notes

Best Practices

  • Use the companion Digits to Letters Converter to reverse the process and decode a number sequence back to letters.
  • Strip spaces and punctuation before converting when the output is meant to be decoded again, since the paired decoder expects numbers only.
  • Keep a copy of the original text, because capitalization is lost in conversion and cannot be recovered from the numbers.

Developer Notes

For each character, the lowercase char code is checked against the range 97-122 (a-z); a match returns `String(code - 96)`, otherwise the original character is returned as-is, and all resulting tokens are joined with `.join(" ")`.

Letters to Digits Converter Use Cases

  • Encoding a phrase for an A1Z26 puzzle or escape-room clue
  • Teaching basic substitution cipher concepts
  • Quickly looking up a letter's position in the alphabet

Common Mistakes

  • Expecting non-Latin letters to convert; only the basic a-z/A-Z range is mapped.
  • Assuming the output can be fed straight back into the Digits to Letters Converter; any non-letter tokens carried through will be rejected as invalid.

Tips

  • Pair this with the Digits to Letters Converter to build a simple encode/decode round trip.
  • Non-letters pass through unchanged, so a punctuation mark or digit appearing in the output marks exactly where one sat in the source.

References

Frequently Asked Questions