Text to ASCII Converter
Last updated: 17 August 2026
Reviewed by Gavin ยท Research and drafting assisted by AI
Text โ ASCII Converter
Convert text to ASCII code points (decimal, hex, or binary) and back. Source authority: ASA X3.4-1977 / ANSI X3.4-1986 / ISO/IEC 646 / RFC 20.
Code stream
Per-character breakdown
| # | Char | Dec | Hex | Binary | Class |
|---|---|---|---|---|---|
| 1 | 'H' | 72 | 0x48 | 0b01001000 | printable ASCII |
| 2 | 'e' | 101 | 0x65 | 0b01100101 | printable ASCII |
| 3 | 'l' | 108 | 0x6C | 0b01101100 | printable ASCII |
| 4 | 'l' | 108 | 0x6C | 0b01101100 | printable ASCII |
| 5 | 'o' | 111 | 0x6F | 0b01101111 | printable ASCII |
Quick test cases
How the conversion works
ASCII is a 7-bit encoding: 128 code points numbered 0 to 127. Code points 32 to 126 are printable characters (space and the visible glyphs). Code points 0 to 31 plus 127 are control characters (NUL through US, plus DEL). When converting text โ codes, each character becomes one numeric code; the converter supports decimal (e.g. 72 101), hexadecimal (0x48 0x65), and binary (0b01001000 0b01100101), separated by space, comma, or run-on. When converting codes โ text, each token is parsed individually โ decimal, hex (with or without 0x prefix), or binary (with or without 0b prefix) โ and the matching code points are reassembled into a single string. Code points above 127 are valid Unicode but fall outside the ASCII range; the converter still processes them, classified as extended (128โ255) or Unicode (โฅ 256).
Where it shows up
- Programming: inspecting byte sequences, debugging character-encoding bugs (e.g. "mojibake" from UTF-8 / Latin-1 mismatches).
- Networking: HTTP headers, SMTP, telnet โ all defined to carry ASCII (RFC 20).
- Crypto and hashing: many protocols hash the raw bytes of the input, and ASCII prints are an easy on-the-wire representation.
- CTAs and steganography: converting strings to decimal or hex makes them easier to inspect byte-by-byte.
- Educational contexts: teaching how character sets map numbers to glyphs, and why ASCII extended into Latin-1, then Unicode.
Common mistakes
- Confusing code point with byte:
'A'is code point 65 in ASCII and UTF-8, but the UTF-8 byte is 0x41 (still one byte). Code points above 127 become 2, 3, or 4 UTF-8 bytes. - Treating control characters as printable:
\\nis code point 10 (LF),\\tis 9 (HT); the converter flags these as "control". - Mixing hex-with-prefix and hex-without-prefix:
0x41and41both decode to 65 โ but mixed sequences can confuse the parser. Stick to one form per round-trip. - Assuming a leading zero changes the value:
065is just 65 in decimal; only0x41changes base.
Text to ASCII Converter, Encode & Decode Code Points (Dec, Hex, Bin)
The Text to ASCII converter translates any string into its numeric code points and back, supporting decimal (e.g. 72 101 108 108 111 for Hello), hexadecimal (0x48 0x65 0x6C 0x6C 0x6F), and binary (0b01001000 0b01100101 โฆ) output. Paste any text and the matching code stream appears instantly; paste a stream and the original text comes back round-trip. Every code point is classified (printable ASCII, control, extended, or Unicode), the conversion is bidirectional and lossless within the 0..0x10FFFF range, and nothing leaves your browser, the whole algorithm runs as a JavaScript state machine on the client.
How to use
- Pick the direction. Use the Text โ Codes tab to encode any string into numeric code points, or Codes โ Text to paste a code stream and decode it back.
- Type or paste. Either text or the code stream updates the other side live as you edit.
- Choose the output base, decimal, hex, or binary, and the separator (space, comma, or run-on). When using hex or binary you can also toggle a
0x/0bprefix. - Load a Quick test case below the editor to verify the converter against the canonical ASCII table.
The ASCII standard
ASCII (American Standard Code for Information Interchange) was first published as ASA X3.4-1963 and revised to ASA X3.4-1977 then ANSI X3.4-1986. The standard defines 128 code points, 7 bits, numbered 0 through 127:
- Codes 0..31 (plus 127) are control characters with names like NUL, SOH, STX, ETX, BEL, LF, CR, ESC, and DEL. They predate ASCII being used as a text encoding and were originally designed for controlling teleprinters, line printers, and teletypes rather than being displayed.
- Codes 32..126 are printable characters: space (32), digits 0 to 9 (48 to 57), uppercase A-Z (65 to 90), lowercase a-z (97 to 122), and the visible punctuation marks.
- Code 127 is DEL, the canonical "rub-out" character.
The international standardisation counterpart ISO/IEC 646 (1991) keeps the same 128 positions but lets each country swap a small number of code points for local letters (for example, #, $, @, [, \, ], ^, `, {, |, }, ~ in the US variant, ASCII proper, are replaced by accented letters in national variants). RFC 20 (1969) restates ASCII for network interchange and is the authority cited by HTTP, SMTP, and telnet specifications.
Worked examples
The following six examples are the Quick test cases pre-loaded into the converter; click any one to load it.
| Input | Decimal code stream | Hex (with 0x prefix) | Binary (8-bit) |
|---|---|---|---|
A | 65 | 0x41 | 0b01000001 |
Hello | 72 101 108 108 111 | 0x48 0x65 0x6C 0x6C 0x6F | 0b01001000 0b01100101 0b01101100 0b01101100 0b01101111 |
space | 32 | 0x20 | 0b00100000 |
tilde ~ | 126 | 0x7E | 0b01111110 |
newline \n | 10 (control flag) | 0x0A (control flag) | 0b00001010 (control flag) |
abc | 97 98 99 | 0x61 0x62 0x63 | 0b01100001 0b01100010 0b01100011 |
Round-trip tests (72 101 108 108 111 โ "Hello" โ 72 101 108 108 111) close exactly. Plain numbers without a 0x or 0b prefix are interpreted as decimal by default; the decoder accepts 0xFF, 0b1010, 65, and even raw hex FF in mixed sequences (the parser tries decimal first, then hex).
Code stream examples in different bases
The Text โ Codes tab supports any of three numeric bases and any of three separators:
- Decimal, space-separated (default for
Hello):72 101 108 108 111. - Hex with
0xprefix, comma-separated:0x48, 0x65, 0x6C, 0x6C, 0x6F. - Binary with
0bprefix, run-on (no separator):0b010010000b011001010b011011000b011011000b01101111.
When you need to embed a code stream in source code, the comma + hex form is the most readable. When debugging byte streams or writing them into a hex dump, raw 0x with spaces is standard. When teaching byte-level encoding, run-on binary illustrates the 8-bit structure most clearly.
Decoding rules
The decoder accepts the following token shapes:
| Token | Interpretation | Example | Decimal value |
|---|---|---|---|
42 | Decimal | 42 | 42 |
0x2A | Hex with prefix | 0x2A | 42 |
2A | Hex without prefix (matched last) | 2A | 42 |
0b00101010 | Binary with prefix | 0b00101010 | 42 |
Tokens are split on whitespace (space, tab, newline) and commas. A run-on sequence like 0x48 0x65 0x6C 0x6C 0x6F is fine; 0x480x65โฆ (no separator) is not, at least one whitespace or comma must appear between tokens. Out-of-range codes (below 0 or above 0x10FFFF) and unparseable tokens are surfaced as red rows in the per-token breakdown and the decoded-text panel shows "Invalid code sequence".
Where it shows up
ASCII predates modern computing and has surprising staying power:
- Internet standards (HTTP, SMTP, telnet, NNTP). RFC 20 is referenced directly. Most protocol headers are restricted to printable ASCII plus CRLF line endings; non-ASCII bytes must be encoded (typically as UTF-8).
- Programming and debugging. When you
hexdumpa file, every printed ASCII byte is the result ofcp < 0x80. The actual on-disk bytes for an English sentence are identical to its ASCII code points. Beyond that, character-encoding bugs (the classic mojibake, "Mรผller" appearing as "Mรยผller") are usually a single byte being interpreted with the wrong code-page, and inspecting code points is the first diagnostic. - Cryptography and hashing. Many hashing algorithms (MD5, SHA-1, SHA-256) operate on the raw bytes of the input, regardless of how those bytes are displayed. The hex representation of a hash is just 32 (or 20, or 64) ASCII code points reading the bytes back out as text.
- Steganography and forensics. Messages hidden inside image files are often written as ASCII strings to make them copy-pasteable; seeing them as decimal code points makes the structure (32..126 printable range vs. binary noise) obvious.
- Teaching. Students learning about character sets hit ASCII first, then move on to Latin-1, then Unicode and UTF-8. The converter's per-character table makes every byte in any printable string explicit and clickable.
Common mistakes
- Confusing code point with byte. The code point for
Ais 65 in ASCII and in Unicode (specifically the Basic Latin block). In UTF-8, the dominant encoding on the web, code points 0..127 are still encoded as one byte, but code points 128 and above become 2, 3, or 4 bytes. A string of 10 non-ASCII code points can easily become 30 bytes on disk. - Treating a control character as printable.
0(NUL) and10(LF) are ASCII code points but they don't render as anything on a screen, pasting them into a "render the character" function gives you whitespace, not a glyph. The converter's per-character breakdown flags every control code point separately. - Mixing
0x-prefixed and bare hex in a single round-trip.0x41and41are both valid for 65, but a sequence like0x41 42 0x43works only because42happens to also be valid as decimal;0x41 4B 42is ambiguous. Stick to one form per decode. - Forgetting leading-zero padding.
0x05and0x5are the same code point (5), but the byte representation is05and5respectively. If you're aligning output to a hex-dump style, pad to two hex digits (05) so columns line up. - Confusing Latin-1 (extended) bytes with ASCII. Code points 128..255 are not ASCII. If you see an
0xFFbyte and treat it as ASCII, you'll get theรฟglyph at most, not the original character the file was written with. Use the per-character breakdown, where 128..255 are flagged "extended".
Worked numerical examples (with hand-verified arithmetic)
The seven pre-loaded Quick test cases are derived from the canonical ASCII table and checked manually:
Aโ 65 /0x41/0b01000001. The uppercase letter A is the first code point in the alphabet, and it is the smallest example that flips all six high bits to the right state. Convert to hex by reading the bits two at a time from the right:0001(4) becomes the leading nibble,0001(1) the trailing; pad to 0x41. Convert to binary the same way, padded to 8 bits.Helloโ 72 101 108 108 111. Each letter of "Hello" maps to its standard decimal: H=72, e=101, l=108, l=108, o=111. The full sequence is the canonical documentation example for terminal emulators, network packets, andecho 'Hello' | xxdstyle diagnostic commands. Hex:0x48 0x65 0x6C 0x6C 0x6F.- Space (32 / 0x20 /
0b00100000). Space is the lowest printable code point. Inhexdumpoutputs space renders as a single character on its own line, and in telnet protocol trailers the space character separates<CR><LF>markers. Crucially,0x20is 32 in decimal, it is the boundary between control (0..31) and printable (32..126). - Tilde
~โ 126 / 0x7E / 0b01111110. Tilde is the highest printable code point in ASCII. Above 126 starts the "delete" code point (127) and above 127 the code points are out-of-ASCII. This is the same constant that anchors the "printable range" checks in many Cctype.hmacros and in many assertion libraries. \nโ 10 / 0x0A / 0b00001010. The newline character, also called LF (Line Feed). In the converter's per-character table this is flagged "control" rather than "printable ASCII". It appears in source code as the two-character escape\nbut in memory and on the wire it is one byte.abcโ 97 98 99. Lowercase letters sit 32 above their uppercase counterparts, a property of the ASCII table preserved through Unicode's Basic Latin block. SoA = 65,a = 97, the difference is exactly 32. This is why the C standard library'stolowermacro isc | 0x20andtoupperisc & 0xDF.- Round-trip
72 101 108 108 111โ "Hello". Pasting the decimal code stream from example 2 back into the Codes โ Text tab yields the original "Hello". The reverse direction yields the same code stream back. This bidirectional round-trip is the strongest test that the converter is correctly handling the table.
Code point ranges at a glance
The ASCII standard partitions the 128 code points into named ranges that you can use as a quick mental filter:
| Range (decimal) | Range (hex) | Class | Notes |
|---|---|---|---|
| 0..31 | 0x00..0x1F | Control characters | NUL, SOH, STX, โฆ, GS, RS, US |
| 32..47 | 0x20..0x2F | Printable / punctuation | Space, !"#$%&'()*+,-./ |
| 48..57 | 0x30..0x39 | Digits | 0 through 9, same order as their numeric values |
| 58..64 | 0x3A..0x40 | Printable / punctuation | :;<=>?@ |
| 65..90 | 0x41..0x5A | Uppercase letters | A through Z |
| 91..96 | 0x5B..0x60 | Printable / punctuation | [\]^_ ` |
| 97..122 | 0x61..0x7A | Lowercase letters | a through z |
| 123..126 | 0x7B..0x7E | Printable / punctuation | `{ |
| 127 | 0x7F | DEL | The single delete control character |
All 95 printable code points are exactly the character set printers and terminals were designed to render, and the entire ASCII standard is what an 8-bit byte with the high bit cleared looks like. Code points 128..255 are outside ASCII and live in extended encodings like Latin-1 (ISO-8859-1) or Windows-1252; for full Unicode coverage (which extends to code points in the millions), the standard also defines UTF-8, UTF-16, and UTF-32 encodings that take more than one byte per code point.
Common queries (technical reference)
A few one-line lookups that come up often in code, debugging, and protocol work:
- Decimal of a digit:
48 + dfor digitd(e.g.'7'โ 55). - Hex of a digit:
0x30 + d. - Decimal of a letter, given its index
ifrom 0: uppercase = 65 + i (soA=65,Z=90); lowercase = 97 + i (soa=97,z=122). - Toggle case: uppercase letter
cโ lowercase isc ^ 0x20, this works for every English letter in ASCII because the only difference is the 0x20 bit. - Numeric value of a digit character:
c - '0'(or equivalentlyc - 48). - Convert an alphabet letter to its zero-based index: for uppercase
c,c - 'A'; for lowercasec,c - 'a'. Both return 0 forA/aand 25 forZ/z.
Because these relations hold exactly across the entire ASCII table, entire generations of C, JavaScript, and shell tools use them as fast, branchless byte-flipping primitives. They are still the recommended way to convert digits and letters today; the rest of the standard (accents, CJK, emoji) lives in code points above 127.
ASCII vs Latin-1 vs Unicode (a 30-second reminder)
ASCII gives you 7-bit (128 code points). Latin-1 (ISO-8859-1) keeps the same 128 code points in the lower half and uses the upper 128 for the common accented letters of Western Europe (รฉ, รฑ, รผ, ร, รธ, รฟ). Windows-1252 is a superset of Latin-1 used historically by Microsoft Windows. Unicode extends the table to 1,114,112 code points organised into 17 planes of 65,536 each, encompassing every modern script plus many historical scripts, mathematical symbols, and emoji. UTF-8, UTF-16, and UTF-32 are encodings for the same Unicode code points, UTF-8 uses one byte for code points 0..127, two bytes for 128..2047, three bytes for 2048..65535, and four bytes above that. Because UTF-8 was designed to be a byte-for-byte superset of ASCII, every ASCII string is automatically a valid UTF-8 string and decodes to the same code points, which is the single most important reason ASCII has lasted this long.
Frequently Asked Questions
What does "ASCII" actually mean? American Standard Code for Information Interchange, a 7-bit character encoding standardising 128 code points (0..127). The first 32 plus 127 are control characters; the remaining 95 (codes 32..126) are printable. ASCII was published as ASA X3.4-1963 and revised through ANSI X3.4-1986; ISO/IEC 646 is the international standardisation.
Can this converter handle non-ASCII characters like รฉ or ไธญ? Yes, but those characters are Unicode code points, not ASCII. Code point U+00E9 (รฉ) sits at decimal 233, well outside the ASCII 7-bit range (0..127). The converter processes it via JavaScript's String.codePointAt and String.fromCodePoint and classifies it as "extended" (128..255) or "Unicode" (โฅ 256). For full multi-byte character work, pair this converter with a UTF-8 encoder, UTF-8 outputs 1, 2, 3, or 4 bytes per code point depending on the codepoint value.
How does this differ from the chars-to-bytes conversion in my programming language? Most languages treat strings as sequences of UTF-8 code units (JavaScript) or Unicode code points (Python 3, Rust). When you ask for Hello.getBytes() in Java or 'Hello'.encode() in Python 3, you get an array of five bytes, [72, 101, 108, 108, 111], which are the code points themselves for ASCII characters. Outside ASCII, the byte array diverges from the code-point array because UTF-8 expands higher code points.
Can I decode a hex-dump that has no separator? Not reliably. Run-on hex like 48656C6C6F is ambiguous without length cues, is 48 65 6C 6C 6F (Hello) or 4 86 56 C6 C6 F (and C6 is not in ASCII anyway)? Always paste a separator (space, comma, tab, newline) between tokens. The converter accepts spaces, tabs, newlines, and commas as inter-token separators.
What is the highest printable ASCII code? Code point 126, the tilde ~. Code 127 is DEL (a control character), and from 128 onward you leave ASCII entirely, those values are inherited from Latin-1 / extended ASCII but were never part of the original standard.
can the Text To Ascii be used for professional or commercial purposes? yes, the Text To Ascii provides mathematically correct results that are suitable for professional, commercial, and educational use. For the Text To Ascii, For the Text To Ascii, For high-stakes applications (medical, legal, financial), verify results with a domain expert. For the Text To Ascii, the Text To Ascii formulas used are well-established and validated against reference standards.
For the Text To Ascii, How often are the underlying formulas updated? For the Text To Ascii, the Text To Ascii formulas are based on established scientific, mathematical, or industry-standard references and rarely require updates. When standards change (e.g., new physical constants, revised tax brackets, updated standards), the Text To Ascii is updated to reflect the current authoritative source. For the Text To Ascii, For the Text To Ascii, Each calculator's references section lists the specific sources used.
References
- ASA X3.4-1977, American National Standard Code for Information Interchange (ASCII).
- ANSI X3.4-1986, Coded Character Sets, 7-Bit American National Standard Code for Information Interchange.
- ISO/IEC 646:1991, Information technology, ISO 7-bit coded character set for information interchange.
- RFC 20 (1969), ASCII format for network interchange, IETF.
- IETF STD 3, RFC 2119, RFC 7230 (HTTP/1.1), all cite RFC 20 as the printable character set.
- Unicode Standard, Chapter 2, General Structure (covers relationship between ASCII and Unicode).
- Wikipedia, ASCII, historical timeline and variant-table summary.
- Kernighan, B. W., & Ritchie, D. M. (1988). The C Programming Language, 2nd ed., ยง2.7, code-point example: each ASCII character maps to its byte value.