TOP

Free browser-based decimal converter

ASCII to Decimal Converter

Convert each ASCII character into its decimal code instantly. Use UTF-8 Bytes when your text includes accents, non-Latin scripts, symbols, or emoji.

No signup Free online conversion

Interactive tool

Convert ASCII characters to decimal codes

Ready

Output layout

ASCII mode emits one base-10 value from 0 to 127 per character and marks unsupported characters instead of guessing an encoding.

Conversion guide

How to Convert ASCII to Decimal

Standard ASCII assigns every character a base-10 value from 0 to 127. The capital letter A is decimal 65, lowercase a is 97, and a space is 32.

The converter reads the text from left to right and outputs one decimal value per character. For example, Hi becomes 72 105. Spaces, tabs, and line breaks also have numeric codes, so separators make the boundaries explicit.

CharacterASCII decimalCategory
A65Uppercase letter
B66Uppercase letter
a97Lowercase letter
048Digit
Space32Whitespace

ASCII to Decimal in JavaScript

JavaScript can read each character with charCodeAt(0). Validate values above 127 before calling the result ASCII, then join the decimal values with the separator your destination expects.

function asciiToDecimal(text) {
  return Array.from(text, (character) => {
    const value = character.charCodeAt(0);
    if (value > 127) throw new Error("Non-ASCII character");
    return String(value);
  }).join(" ");
}

asciiToDecimal("Hi");
// 72 105

ASCII to Decimal in Python

Python's ord function returns the numeric value of a character. Checking that every value is below 128 keeps the conversion strictly ASCII before the values are joined as decimal strings.

def ascii_to_decimal(text):
    if any(ord(char) > 127 for char in text):
        raise ValueError("Non-ASCII character")
    return " ".join(str(ord(char)) for char in text)

print(ascii_to_decimal("Hi"))
# 72 105

ASCII Decimal Values, Code Points, and Bytes

For standard ASCII, the character code, Unicode code point, and UTF-8 byte have the same numeric value. A is ASCII decimal 65, Unicode U+0041, and the UTF-8 byte 65 when written in decimal.

This one-to-one rule stops at 127. A decimal list without a named encoding is ambiguous once non-ASCII characters are involved.

One standard ASCII character equals one decimal value.

Use the UTF-8 Bytes mode when a character may require more than one byte.

ASCII Decimal vs UTF-8 Decimal Bytes

ASCII is a subset of UTF-8, so English letters, digits, punctuation, and controls produce the same decimal byte values. Non-ASCII characters may need multiple bytes: é becomes 195 169, while becomes 228 189 160.

The Unicode code point for é is 233, but its UTF-8 bytes are 195 169. The UTF-8 mode intentionally outputs encoded bytes, not Unicode code points, so the result can be decoded without guessing.

Advertisement

Sponsored link