ASCII Converter

Convert text to ASCII codes and vice versa. View decimal, hexadecimal, binary, and octal values.

Enter Text

Result

72 101 108 108 111 32 87 111 114 108 100

Character Details

CharDecimalHexBinaryOctal
H720x4801001000110
e1010x6501100101145
l1080x6C01101100154
l1080x6C01101100154
o1110x6F01101111157
Space320x200010000040
W870x5701010111127
o1110x6F01101111157
r1140x7201110010162
l1080x6C01101100154
d1000x6401100100144

About ASCII: ASCII (American Standard Code for Information Interchange) uses 7 bits to represent 128 characters including letters, digits, and symbols.

What Is ASCII and Why Does It Matter?

ASCII — the American Standard Code for Information Interchange — is the foundational character encoding standard that underlies virtually all modern computing. Developed in the early 1960s and officially published as ANSI X3.4-1968, ASCII maps each of 128 printable and control characters to a unique integer from 0 to 127. Every time you press a key on your keyboard, every time a web server transmits a page, and every time a program stores a string of text, ASCII (or one of its supersets, like UTF-8) is almost certainly involved.

The original ASCII table covers the full English alphabet (uppercase and lowercase), the digits 0–9, common punctuation marks, and 33 non-printing control characters such as newline (10), carriage return (13), and the null character (0). This compact 7-bit encoding was deliberately constrained so that a single byte — which has 8 bits — could hold one character with a spare bit left over for error detection.

Understanding ASCII codes is valuable in many practical contexts. Programmers use ASCII values when writing parsers, validating input, or working with low-level binary protocols. Security professionals inspect ASCII representations to detect hidden or non-printable characters that might indicate injection attacks. Students learning about data representation benefit from seeing how every letter and symbol ultimately becomes a number inside a computer. Our ASCII converter calculator makes all of these tasks instant: paste any text and immediately see every character's decimal, hexadecimal, binary, and octal code.

Because modern systems commonly extend ASCII into Unicode (which uses the same 0–127 code points for ASCII characters), this converter works correctly for standard ASCII text. Characters beyond code point 127 are handled by their Unicode scalar value, giving you a flexible tool for a wide range of text-to-number conversion tasks.

How ASCII Conversion Works

Converting text to ASCII is fundamentally straightforward: every character in a string has a unique numeric code point, and the converter simply reads each character's code one by one. In JavaScript — the language powering this calculator — that value is retrieved with charCodeAt(0). The resulting decimal number can then be expressed in any number base: decimal (base 10), hexadecimal (base 16), binary (base 2), or octal (base 8).

The text-to-ASCII direction works character by character. The converter splits your input string into an array of individual characters, calls charCodeAt(0) on each to get the decimal code point, and joins the resulting numbers with your chosen separator (space, comma, dash, or none). Simultaneously, it computes each character's hex representation using toString(16) padded to at least two digits, its 8-bit binary string using toString(2) padded to eight digits, and its octal value using toString(8).

The ASCII-to-text direction reverses the process. The calculator splits your sequence of numbers using the selected separator, parses each token as a base-10 integer with parseInt(value, 10), and reconstructs the text character by character using String.fromCharCode(value). The result is the original string — or any string of your choosing if you are constructing text from scratch.

The details table displayed below the result shows all four representations side by side, making it easy to cross-reference formats without any additional calculation. This is particularly useful when debugging binary file formats, reading network packet dumps, or studying how encoding systems relate to one another.

ASCII Conversion Formulas

Decimal = charCodeAt(0) | Hex = decimal.toString(16).toUpperCase().padStart(2,"0") | Binary = decimal.toString(2).padStart(8,"0") | Octal = decimal.toString(8)

Where:

  • charCodeAt(0)= JavaScript method returning the UTF-16 code unit (0–65535) of a character — identical to the ASCII value for characters 0–127
  • Decimal= The base-10 integer ASCII code point (0–127 for standard ASCII)
  • Hex= Base-16 representation, uppercase, zero-padded to at least 2 digits (e.g., "41" for A)
  • Binary= Base-2 representation, zero-padded to 8 bits (e.g., "01000001" for A)
  • Octal= Base-8 representation without padding (e.g., "101" for A)
  • String.fromCharCode(n)= Reverse operation: converts a decimal ASCII/Unicode code point back to its character

ASCII Table Quick Reference

The ASCII standard defines 128 code points. The first 32 (0–31) and the final one (127) are control characters not typically displayed as glyphs. The remaining 95 characters are printable. Here is a concise reference for the most commonly used printable ASCII characters:

Character Decimal Hex Binary Octal
Space32200010000040
048300011000060
957390011100171
A654101000001101
Z905A01011010132
a976101100001141
z1227A01111010172
!33210010000141
@644001000000100
~1267E01111110176

A key pattern worth noting: uppercase letters start at decimal 65 (A) and run to 90 (Z), while lowercase letters start at 97 (a) and run to 122 (z). The difference between a letter's uppercase and lowercase code is always exactly 32 — the same value as the space character. This regularity makes case conversion trivially fast in low-level programming by simply toggling bit 5 (the 32-bit position).

Decimal, Hex, Binary, and Octal Explained

The ASCII converter displays each character's code in four number bases simultaneously. Understanding the relationship between these bases helps you read technical documentation, debug protocols, and work effectively with data at the byte level.

Decimal (base 10) is the everyday counting system. ASCII decimal values range from 0 to 127. When you see "72" in a decimal column, it simply means the 72nd entry in the ASCII table — the uppercase letter H.

Hexadecimal (base 16) uses digits 0–9 and letters A–F. Each hex digit represents exactly 4 bits, so one byte (8 bits) is always two hex digits. Hex is ubiquitous in programming: memory addresses, color codes (#FF5733), HTML character references, and network packet dumps all use hex. The hex value for H is 0x48 — where "48" in hex equals 4×16 + 8 = 72 in decimal.

Binary (base 2) is the language of hardware. Every ASCII character occupies exactly 8 bits (one byte) when stored in memory. The letter H in binary is 01001000. Reading from right to left: bit positions 3 and 6 are set (values 8 and 64), giving 8 + 64 = 72. Binary representations make bitwise operations, flags, and masks immediately readable.

Octal (base 8) uses digits 0–7 and groups bits in threes rather than fours. Octal was popular on older systems — Unix file permissions are still expressed in octal (e.g., chmod 755). The letter H in octal is 110, because 72 in decimal = 1×64 + 1×8 + 0×1 = 110 in octal. While less common than hex today, octal still appears in C-style escape sequences and Unix tooling.

The ability to switch between these representations instantly is one of the most practical features of a good ASCII text-to-code converter. Whether you are reading a C header file that uses hex constants, a shell script that uses octal permissions, or documentation that uses binary bit masks, you can cross-reference any character code without mental arithmetic.

Practical Use Cases for an ASCII Converter

An online ASCII converter serves a surprisingly wide range of users. Below are the most common real-world scenarios where converting text to ASCII codes — or reversing the process — saves significant time.

Programming and Debugging

When writing parsers, you often need to compare characters against their code points. Knowing that the newline character is decimal 10, that a tab is 9, and that the tilde (~) is 126 lets you write compact, readable conditions. This converter helps you quickly look up any character without consulting a separate ASCII chart.

Data Encoding and Protocol Work

Many binary protocols specify message fields in terms of ASCII byte values. Converting field values to and from ASCII codes lets you construct or validate messages manually. This is especially useful when crafting test payloads for TCP/IP services or working with serial communication protocols.

Security and CTF Challenges

Capture-the-flag competitions frequently hide flags encoded as sequences of decimal or hex ASCII values. Pasting the number sequence into the ASCII-to-text mode of this converter instantly reveals the hidden text. Similarly, security researchers inspect suspicious strings by viewing their byte values to detect non-printable or unexpected characters.

Education and Learning

Computer science students studying data representation, encoding, and number systems use ASCII converters to ground abstract concepts. Seeing that the letter "A" is 65 in decimal, 41 in hex, 01000001 in binary, and 101 in octal makes the relationship between character encoding and binary data tangible.

Encoding Puzzles and Ciphers

Some simple ciphers encode messages as sequences of ASCII values offset by a constant. Using the text-to-ASCII and ASCII-to-text modes together makes encoding and decoding these puzzles straightforward.

Worked Examples

Convert "Hi!" to ASCII Codes

Problem:

Find the decimal, hex, binary, and octal ASCII values for each character in "Hi!"

Solution Steps:

  1. 1H: charCodeAt(0) = 72 → Decimal 72, Hex 48, Binary 01001000, Octal 110
  2. 2i: charCodeAt(0) = 105 → Decimal 105, Hex 69, Binary 01101001, Octal 151
  3. 3!: charCodeAt(0) = 33 → Decimal 33, Hex 21, Binary 00100001, Octal 41
  4. 4Join with space separator → Output: "72 105 33"

Result:

ASCII codes: 72 105 33 (space-separated). The details table shows all four bases for each character simultaneously.

Decode ASCII Sequence to Text

Problem:

Convert the ASCII decimal sequence "65 66 67" back to readable text.

Solution Steps:

  1. 1Split input by space separator → ["65", "66", "67"]
  2. 2Parse each token: parseInt("65", 10) = 65, parseInt("66", 10) = 66, parseInt("67", 10) = 67
  3. 3String.fromCharCode(65) = "A", String.fromCharCode(66) = "B", String.fromCharCode(67) = "C"
  4. 4Join all characters → "ABC"

Result:

Decoded text: "ABC". Each decimal ASCII value maps directly back to its corresponding uppercase letter.

Convert "Hello" to All Number Bases

Problem:

Show the full four-base breakdown for the word "Hello".

Solution Steps:

  1. 1H → Decimal 72, Hex 48, Binary 01001000, Octal 110
  2. 2e → Decimal 101, Hex 65, Binary 01100101, Octal 145
  3. 3l → Decimal 108, Hex 6C, Binary 01101100, Octal 154
  4. 4l → Decimal 108, Hex 6C, Binary 01101100, Octal 154 (same as previous "l")
  5. 5o → Decimal 111, Hex 6F, Binary 01101111, Octal 157
  6. 6Space-separated output: "72 101 108 108 111"

Result:

Five characters produce five sets of values. Repeated characters ("l" appears twice) produce identical rows, confirming the deterministic one-to-one mapping.

Use Comma Separator for CSV-Friendly Output

Problem:

Encode "OK" using a comma separator to produce output compatible with CSV format.

Solution Steps:

  1. 1O → charCodeAt(0) = 79
  2. 2K → charCodeAt(0) = 75
  3. 3Join with "," separator → "79,75"
  4. 4To reverse: switch to ASCII-to-text mode, set separator to comma, enter "79,75" → "OK"

Result:

"79,75" — comma-separated ASCII values for "OK". Switching the separator and mode lets you round-trip any text through ASCII encoding.

Tips & Best Practices

  • Use the comma separator when you need ASCII output that can be pasted directly into a spreadsheet or CSV field.
  • Remember that uppercase letters A–Z span decimal 65–90 and lowercase a–z span 97–122; the difference between any letter pair is always exactly 32.
  • To check for hidden characters in a string, paste it into text-to-ASCII mode and look for unexpected code points outside the 32–126 printable range.
  • The hex column is prefixed with "0x" in the table — when pasting into code, include this prefix to signal a hexadecimal literal in most programming languages.
  • Binary values are always 8 digits wide (zero-padded); if you see a value with fewer bits, the leading zeros were stripped — pad back to 8 for correct byte representation.
  • To decode ASCII art or encoded messages from CTF challenges, switch to ASCII-to-text mode and paste the number sequence, making sure to match the separator used in the encoded string.
  • Digits 0–9 have ASCII codes 48–57, so the numeric character "5" is code 53 — not 5. Always distinguish between the character and its numeric value.
  • Use the "None" separator carefully; without a delimiter, multi-digit codes like 72 and 101 merge into "72101", which cannot be correctly parsed in reverse.

Frequently Asked Questions

The space character has ASCII code 32 in decimal, 20 in hexadecimal, 00100000 in binary, and 40 in octal. It is the first printable character in the ASCII table and sits between the control characters (0–31) and the printable symbols. In this converter, a space character is labeled "Space" in the character details table to make it visually distinct.
ASCII is a 128-character encoding (7 bits) covering basic English letters, digits, punctuation, and control characters. Unicode is a far larger standard that assigns code points to over 140,000 characters covering virtually every human writing system and many symbols. The first 128 Unicode code points (U+0000 to U+007F) are identical to ASCII, so ASCII is a strict subset of Unicode. UTF-8, the dominant web encoding, represents ASCII characters with the same single byte values, ensuring full backward compatibility.
Different computing contexts use different bases. Decimal is the natural human-readable form. Hexadecimal is widely used in programming, memory addresses, and color codes because one byte maps to exactly two hex digits. Binary is the actual representation inside hardware and makes bitwise operations explicit. Octal appears in Unix file permissions (like chmod) and some legacy systems. Showing all four simultaneously lets you compare representations without separate conversions.
The converter uses JavaScript's charCodeAt(0), which returns the UTF-16 code unit for each character. For standard ASCII characters (code points 0–127), this is identical to the ASCII value. For extended characters like é (233) or characters above 127, it returns the Unicode code point rather than an ASCII value, since those characters have no ASCII representation. Emoji and other characters outside the Basic Multilingual Plane may produce surrogate pair values.
The separator you choose when decoding must match the separator used when the ASCII codes were originally encoded. If the codes are separated by spaces (e.g., "72 101 108"), choose the Space separator. If they are comma-separated (e.g., "72,101,108"), choose Comma. Choosing the wrong separator will prevent the parser from correctly splitting the number sequence, resulting in garbled or empty output. The "None" separator is useful only for encoding very short sequences where numbers do not overlap ambiguously.
The converter always pads binary representations to exactly 8 digits (one full byte) using leading zeros. For example, the exclamation mark (!) has decimal value 33, which in raw binary is 100001 — only 6 bits. The converter displays it as 00100001 by prepending two zeros. This 8-bit padding is the standard representation because computers store and transmit data in byte-aligned units, making the full 8-bit form the most interoperable format.
ASCII code points 0–31 and 127 are control characters originally designed to control hardware devices like teletypes and printers. Examples include NUL (0), which terminates C-style strings; TAB (9); LF/newline (10); CR (13); and ESC (27). These characters perform actions rather than rendering a visible glyph. Some, like TAB and newline, have visible effects in text; others like NUL and BEL (7) are mostly invisible in modern applications. You can still convert them to their numeric representations using this calculator.

Sources & References

Last updated: 2026-06-05

💡

Help us improve!

How would you rate the ASCII Converter?

<>

Editorial Note

MyCalcBuddy Editorial Team

This page is maintained as an educational calculator reference.

Source

Formula Source: Standard Mathematical References

by Various

UpdatedLast reviewed: May 2026
CheckedFormula checks are based on standard references and internal QA review.