Text to ASCII codes converter
Type Hi and get 72 105, or paste 65 66 67 and read ABC: each character becomes its decimal ASCII code and back, and any code outside 0 to 127 is flagged instead of turned into a wrong letter. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Text
- Hi
- Calculation mode
- Encode
- Result
- 72 105
- Encoding
- decimal_ascii
- Codes
- 72, 105
- Quantity
- 2
This text to ASCII codes converter turns ordinary characters into space-separated decimal character codes in the classic ASCII range from zero through one hundred twenty-seven, and it reverses the same mapping when you paste codes back into text. Decoding splits on whitespace, parses each token as a strict decimal integer, and fails with a clear error when a code sits outside the valid range instead of silently emitting a wrong glyph. The path is fully deterministic: the same text and mode always produce the same codes, with no network calls, no random salts, and no date-dependent shortcuts. Small checks include encoding Hi into seventy-two space one hundred five and decoding sixty-five sixty-six sixty-seven back into ABC.
What decimal ASCII codes are and what this tool returns
ASCII assigns a fixed decimal number to each of the one hundred twenty-eight characters in the original American Standard Code for Information Interchange table. Printable letters, digits, and common punctuation occupy codes thirty-two through one hundred twenty-six, while zero through thirty-one and one hundred twenty-seven are control characters such as newline, tab, and delete. This converter exposes that table as plain decimal integers separated by spaces: the letter A is sixty-five, B is sixty-six, space is thirty-two, and digit zero is forty-eight.
On decode, each whitespace-separated token must be an integer inside zero through one hundred twenty-seven inclusive, so two hundred fifty-six, negative one, and floating tokens such as sixty-five point zero are rejected with a message that names the bad position.
Where text to ASCII codes fits in study, debugging, and software
Students meet decimal ASCII when a textbook asks for the codes of a password hint, when a contest problem prints character numbers instead of glyphs, or when they first learn that space is thirty-two and that uppercase A is sixty-five while lowercase a is ninety-seven. Teachers can generate answer keys for short phrases without trusting opaque calculator apps that silently switch to Unicode code points or extended Latin-one values.
Developers call the same contract from scripts to seed deterministic test vectors for parsers that accept space-separated codes, to inspect control characters embedded in logs, or to satisfy programming-challenge statements that demand decimal ASCII rather than hex dumps. Support engineers decode mystery sequences from older devices that still speak seven-bit ASCII over serial lines. Product and education tools use the rewrite when a learner types Hi and the UI must show seventy-two one hundred five without re-deriving the table by hand.
What you can do with it
Homework and ASCII table drills
Convert short phrases to decimal ASCII codes and check student answers against stable 0–127 mappings.
FAQ
What does the text to ASCII codes converter cost?
It is free in your browser on this page.
What is the valid code range?
Only decimal integers from 0 through 127 inclusive.
How are codes separated?
Encode joins codes with a single space. Decode accepts any whitespace (spaces, tabs, newlines) between integer tokens.
What happens with non-ASCII characters on encode?
Accented letters, emoji, and other Unicode scalars are outside the ASCII range 0–127.
Does decode accept hex or binary codes?
No. Only strict decimal integer tokens are accepted. Hex prefixes, binary digits, commas, and floats are rejected.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/enc/decimal-ascii \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"Hi"}'const res = await fetch("https://api.kit.forhosting.com/enc/decimal-ascii", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"text": "Hi"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/enc/decimal-ascii",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"text": "Hi"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/enc/decimal-ascii", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"text":"Hi"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"text":"Hi"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/enc/decimal-ascii", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"text": "Hi"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "enc.decimal_ascii",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_chars | 100000 |
ascii_min | 0 |
ascii_max | 127 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
What decimal ASCII codes are and what this tool returns
On encode, every character in the input must already be a true ASCII code unit; accented letters, emoji, and other Unicode scalars raise invalid_input rather than inventing multi-byte expansions. The JSON response always includes result for the transformed string or code list, mode echoing encode or decode, encoding fixed to decimal_ascii, a codes array of integers for programmatic consumers, count of characters or codes, input_length of the raw payload, and a range object restating min zero and max one hundred twenty-seven. There is no silent clamp and no extended eight-bit Latin-1 path: either every code is valid ASCII or the request fails.
How text and mode are read and how results stay reproducible
Encode walks the string with charCodeAt and emits a single space between consecutive codes without a trailing space, so empty input yields an empty result and a single character yields a single number. Decode trims leading and trailing whitespace, splits on any run of spaces, tabs, or newlines, and builds the string with fromCharCode so control codes such as ten for line feed round-trip cleanly. Non-integer tokens, scientific notation, hex prefixes, and commas as separators are rejected so a pasted spreadsheet cell cannot become a wrong character. The preferred payload field is text, with aliases input, value, s, and codes so forms, query strings, and SDK clients can reuse the same contract without renaming columns. Mode defaults to encode and accepts decode explicitly; aliases op, direction, and action map to the same switch for scripts that already use those names. The length ceiling of one hundred thousand characters keeps Worker memory predictable while still covering textbooks, sample files, and most paste buffers. Pair the free browser run on this page with the priced API when you need the identical mapping inside an automated pipeline without re-implementing the ASCII table yourself. Invalid inputs return invalid_input and are not charged, which keeps validation cheap while successful transforms remain a fixed item price at $0.002.
Where text to ASCII codes fits in study, debugging, and software
On this page the work runs entirely in your browser; through the API each successful lookup costs $0.002, failed validation is not charged, and nothing is stored after the response returns. That split — free interactive exploration and a priced, identical API — matches the rest of the KIT tier-A catalog and lets you move from a classroom demo to an automated pipeline without changing the mathematical result. Pair it with Base64 or hex helpers when you need related encoding steps, and with other text endpoints when you are building a small lab of free, deterministic encoding tools.
Integration use cases
Deterministic test fixtures
Generate reproducible space-separated code strings and round-trip text for unit tests and CI goldens.
Debugging control characters
Inspect or rebuild ASCII-only payloads, including tabs and newlines, as explicit decimal codes.