ASCII & Unicode Value Calculator
Convert any character to ASCII decimal, hex, octal, binary, and UTF-8 bytes, or decode character codes back to text. Full ASCII table included.
Start typing above to see ASCII and Unicode values live.
What Is the ASCII & Unicode Value Calculator?
This tool goes beyond a simple ASCII lookup table. It converts between characters and their complete numeric representations, decimal, hexadecimal, octal, binary, and UTF-8 byte sequences, with full Unicode support for every code point from U+0000 to U+10FFFF.
- ▸Text → Codes (live): Type or paste any text and instantly see every character's decimal, hex, octal, binary, UTF-8 bytes, Unicode code point, and category. Updates in real time, no button click needed.
- ▸Codes → Text: Enter a list of character codes in any base, plain decimal, 0x hex, 0b binary, or 0o octal, and reconstruct the original string. Comma or space separated.
- ▸ASCII Reference Table: Browse all 128 standard ASCII characters. Filter by category (control, digit, uppercase, lowercase, symbol) or search by name, decimal, or hex code. Click any row for a full detail card.
- ▸String statistics: For any input, see total character count, UTF-8 byte size, unique character count, and ASCII vs non-ASCII breakdown.
Formula
ASCII maps each character to a 7-bit integer (0–127). Modern systems extend this with Unicode, but every ASCII character has the identical code point in UTF-8, UTF-16, and UTF-32, making ASCII a universal subset.
7 bits → 0 to 127 128 unique code points
Covers English letters, digits, punctuation, and 33 control characters.
8 bits → 128 to 255 +128 additional characters
Adds accented letters (é, ü, ñ) and symbols. ISO-8859-1 / Windows-1252 are common variants.
lowercase = uppercase | 0x20 uppercase = lowercase & ~0x20
All uppercase letters are 32 below their lowercase counterpart. Toggling bit 5 flips case, XOR with 0x20.
n = char - '0' e.g. '7' (55) - '0' (48) = 7
ASCII digits 48–57 form a consecutive block, so subtracting 48 (or '0') converts a digit character to its integer value.
U+0000 – U+007F 0xxxxxxx (7 data bits)
All standard ASCII characters encode to a single UTF-8 byte identical to their ASCII code. No overhead.
U+0080–U+07FF → 110xxxxx 10xxxxxx U+0800–U+FFFF → 1110xxxx 10xxxxxx 10xxxxxx
Characters beyond ASCII require 2, 3, or 4 bytes. The leading bits identify byte count; continuation bytes start with 10.
How to Use
- 1
Text → Codes: type your text
Switch to the Text → Codes tab. Start typing or paste any string. The table populates immediately, no button needed. Scroll right to see all columns including UTF-8 byte sequences.
- 2
Copy individual values
Each decimal and hex value has a copy button inline. Use the copy button in the table footer to export the entire result as CSV for spreadsheet import.
- 3
Codes → Text: enter your codes
Switch to Codes → Text. Paste space- or comma-separated codes. Mix formats freely: 72 0x65 0b01101100 will all be parsed correctly.
- 4
Browse the ASCII Table
Switch to the ASCII Table tab. Use the filter buttons to narrow by category, or type in the search box to find a specific character by name or code. Click any row to expand the full detail card.
- 5
Check string statistics
In Text → Codes mode, the stat row above the table shows total length, UTF-8 byte count, unique character count, and how many characters are standard ASCII vs extended Unicode.
Example Calculation
Example 1 | ASCII values for "Hello"
| Char | Decimal | Hex | Binary | UTF-8 |
|---|---|---|---|---|
| H | 72 | 0x48 | 01001000 | 48 |
| e | 101 | 0x65 | 01100101 | 65 |
| l | 108 | 0x6C | 01101100 | 6C |
| l | 108 | 0x6C | 01101100 | 6C |
| o | 111 | 0x6F | 01101111 | 6F |
Example 2 | Important ASCII ranges
| Range | Decimal | Hex | Notes |
|---|---|---|---|
| 0–9 (digits) | 48–57 | 0x30–0x39 | Subtract 48 to get integer value |
| A–Z (uppercase) | 65–90 | 0x41–0x5A | Bit 5 = 0 |
| a–z (lowercase) | 97–122 | 0x61–0x7A | Bit 5 = 1 (uppercase + 32) |
| Space | 32 | 0x20 | First printable character |
| Control chars | 0–31, 127 | 0x00–0x1F, 0x7F | Non-printable: NUL, TAB, LF, CR… |
Example 3 | UTF-8 encoding for non-ASCII characters
| Character | Decimal | Unicode hex | UTF-8 bytes |
|---|---|---|---|
| é (U+00E9) | 233 | 0xE9 | C3 A9 (2 bytes) |
| € (U+20AC) | 8364 | 0x20AC | E2 82 AC (3 bytes) |
| 😀 (U+1F600) | 128512 | 0x1F600 | F0 9F 98 80 (4 bytes) |
Understanding ASCII & Unicode Value
What Is ASCII and Why Does It Still Matter?
ASCII was published by the American Standards Association in 1963, born from the need to standardise how teletypes and early computers communicated. Before ASCII, every manufacturer used their own character codes, making interoperability impossible. By assigning a unique 7-bit number to every character that English text needs, 26 uppercase letters, 26 lowercase letters, 10 digits, common punctuation, and 33 control codes, ASCII gave the computing world a shared language.
Sixty years on, ASCII is the invisible skeleton inside all modern text. Every email, web page, and source code file is built on it. UTF-8, the dominant encoding of the web, was explicitly designed so that ASCII files need no conversion, the first 128 code points are byte-for-byte identical.
The Structure of the ASCII Table
| Range | Dec | Hex | Contents |
|---|---|---|---|
| Control characters | 0–31 | 0x00–0x1F | NUL, TAB, LF, CR, ESC… (non-printable) |
| Space | 32 | 0x20 | First printable character |
| Symbols & punctuation | 33–47 | 0x21–0x2F | ! " # $ % & ' ( ) * + , - . / |
| Digits | 48–57 | 0x30–0x39 | 0 1 2 3 4 5 6 7 8 9 |
| Symbols | 58–64 | 0x3A–0x40 | : ; < = > ? @ |
| Uppercase letters | 65–90 | 0x41–0x5A | A B C D … Z |
| Symbols | 91–96 | 0x5B–0x60 | [ \ ] ^ _ ` |
| Lowercase letters | 97–122 | 0x61–0x7A | a b c d … z |
| Symbols | 123–126 | 0x7B–0x7E | { | } ~ |
| Delete | 127 | 0x7F | DEL (control character) |
The Case-Conversion Bit Trick
The 32-unit gap between uppercase and lowercase letters was not accidental. In binary:
'A' = 65 = 01000001 (bit 5 = 0)
'a' = 97 = 01100001 (bit 5 = 1)
Toggle case: char ^ 0x20 (XOR with 32 flips bit 5)
This means a C program can uppercase a letter with a single bitwise AND: c & 0xDF, and lowercase it with OR: c | 0x20. Similarly, digit characters '0'–'9' (48–57) can be converted to their integer values by subtracting 48: c - '0'. These tricks are baked into virtually every language runtime.
ASCII, Extended ASCII, Unicode, and UTF-8 Compared
| Standard | Bits | Range | Characters covered | Status |
|---|---|---|---|---|
| ASCII | 7 | 0–127 | 128 (English only) | Universal subset |
| Extended ASCII (ISO-8859-1) | 8 | 0–255 | +128 Latin chars | Legacy, region-specific |
| Unicode | 21 | 0–1,114,111 | 149,000+ across all scripts | Global standard |
| UTF-8 | Variable 1–4 bytes | 0–0x10FFFF | All of Unicode | Dominant web encoding |
| UTF-16 | 16/32 bits | 0–0x10FFFF | All of Unicode | Used in Windows, Java, JS |
| UTF-32 | 32 bits | 0–0x10FFFF | All of Unicode | Simple but memory-heavy |
How UTF-8 Encodes ASCII and Beyond
UTF-8 uses a variable number of bytes per character. The leading bits identify how many bytes make up the character:
- ▸1 byte (0xxxxxxx): Code points U+0000–U+007F. Identical to ASCII. Text that uses only these characters takes the same space in ASCII and UTF-8.
- ▸2 bytes (110xxxxx 10xxxxxx): U+0080–U+07FF. Covers most Latin-script languages, Greek, Cyrillic, Arabic, Hebrew, and more.
- ▸3 bytes (1110xxxx 10xxxxxx 10xxxxxx): U+0800–U+FFFF. Covers Chinese, Japanese, Korean, and most other living scripts.
- ▸4 bytes (11110xxx 10xxxxxx 10xxxxxx 10xxxxxx): U+10000–U+10FFFF. Covers emoji, rare historic scripts, and mathematical symbols.
ASCII in Programming, Practical Applications
- ▸Parsing text files: Detecting newlines (LF = 10, CR = 13), tabs (9), and null terminators (0) requires knowing ASCII codes.
- ▸Writing a lexer or tokeniser: Checking if a character is a digit (
c >= 48 && c <= 57) or letter (c >= 65 && c <= 90 || c >= 97 && c <= 122) is done directly via ASCII comparisons. - ▸Network protocols: HTTP headers, SMTP commands, FTP, and most internet protocols use ASCII framing. Understanding ASCII is essential for low-level networking.
- ▸Hex editors and debugging: When inspecting binary data, recognising ASCII bytes (printable chars are 0x20–0x7E) helps identify embedded strings in binary files.
- ▸Embedded systems: Microcontrollers with limited memory often use ASCII codes directly rather than string functions, making lookup table knowledge critical.
- ▸Cryptography basics: Classical ciphers (Caesar cipher, ROT13, Vigenère) operate on ASCII values. ROT13 is literally
((c - 'A' + 13) % 26) + 'A'for uppercase letters.
Control Characters and Their Modern Relevance
The 33 control characters (0–31 and 127) originate from teletype machine operations but many remain in everyday use:
| Code | Name | Abbr | Modern use |
|---|---|---|---|
| 0 | Null | NUL | C string terminator; padding in protocols |
| 7 | Bell | BEL | Terminal beep (\a in C) |
| 8 | Backspace | BS | Cursor back one position (\b) |
| 9 | Horizontal Tab | HT | Text indentation, TSV files (\t) |
| 10 | Line Feed | LF | Unix newline, HTTP line ending (\n) |
| 13 | Carriage Return | CR | Windows uses CR+LF; Mac OS 9 used CR alone (\r) |
| 26 | Substitute | SUB | Ctrl+Z on Windows, signals EOF in text mode |
| 27 | Escape | ESC | Terminal escape sequences (colour, cursor movement) |
Common ASCII Value Questions
- ▸ASCII value of space: 32 (0x20). The first printable character.
- ▸ASCII value of enter / newline: 10 (LF, 0x0A) on Unix/Mac; CR (13) + LF (10) on Windows.
- ▸ASCII value of tab: 9 (HT, 0x09).
- ▸ASCII of 0–9: 48–57. To get the integer value: subtract '0' (48).
- ▸ASCII of A–Z: 65–90. Of a–z: 97–122.
Frequently Asked Questions
What is ASCII?
ASCII (American Standard Code for Information Interchange) is a 7-bit character encoding standard published in 1963 that maps 128 characters, English letters, digits, punctuation, and 33 control codes, to integers 0–127. Despite being over 60 years old, ASCII is still the foundation of modern text encoding because every major encoding (UTF-8, UTF-16, Latin-1) is a superset that preserves the original ASCII assignments.
What is the ASCII value of A, B, C…?
Uppercase letters run from A = 65 to Z = 90, in alphabetical order. So B = 66, C = 67, … Z = 90. Lowercase letters start at a = 97 and go to z = 122. The 32-unit gap between cases is intentional, it allows case conversion by toggling a single bit.
How do I convert a character to its ASCII number?
In most programming languages: JavaScript/Python, char.charCodeAt(0) or ord(char). C/C++, (int)char. Java, (int)char. The result is the Unicode code point, which is identical to ASCII for characters 0–127. This calculator shows all formats (decimal, hex, octal, binary) simultaneously.
Why does uppercase A = 65 and lowercase a = 97?
The 32-unit difference (0x20, or binary 00100000) is a deliberate design choice. Bit 5 acts as a case flag: 0 for uppercase, 1 for lowercase. Flipping bit 5 (XOR with 0x20) toggles between cases, making case conversion a single CPU instruction. The digits 0–9 are at 48–57, so subtracting 48 gives the integer value directly.
What are ASCII control characters?
Control characters (codes 0–31 and 127) are non-printable characters used for formatting and device control. Key ones: NUL (0) = string terminator in C; TAB (9) = horizontal tab; LF (10) = line feed / newline (Unix line endings); CR (13) = carriage return (Windows uses CR+LF); ESC (27) = escape sequences in terminals; DEL (127) = delete. These originate from teletype machine operations.
What is the difference between ASCII, extended ASCII, and Unicode?
Standard ASCII covers 128 characters (7-bit). Extended ASCII extends this to 256 (8-bit), adding accented letters and symbols, but different vendors defined the extra 128 differently (ISO-8859-1, Windows-1252, etc.), causing compatibility issues. Unicode is the global standard covering over 149,000 characters across all world scripts, emoji, and symbols, identified by code points from U+0000 to U+10FFFF.
What is UTF-8 and how does it relate to ASCII?
UTF-8 is a variable-width encoding for Unicode. Its key property: the first 128 code points (U+0000 to U+007F) encode to exactly one byte each, identical to their ASCII values. This means any file containing only ASCII characters is simultaneously valid UTF-8, there is no conversion needed. Characters beyond U+007F require 2, 3, or 4 bytes, with continuation bytes starting with the binary prefix 10.
How do I convert a decimal number to its ASCII character?
Use String.fromCharCode(n) in JavaScript, chr(n) in Python, or (char)n in C/C++. For example, String.fromCharCode(65) = 'A'. You can also enter the number in the Codes → Text tab of this calculator, it supports decimal, hex (0x41), binary (0b01000001), and octal (0o101) input.
What are some common ASCII values every programmer should know?
The most useful ones: '0' = 48, 'A' = 65, 'a' = 97, Space = 32, Tab = 9, Newline/LF = 10, Carriage Return = 13, Null = 0, DEL = 127. In hex: 0x41 = 'A', 0x61 = 'a', 0x30 = '0', 0x20 = Space. Knowing these helps when reading hex dumps, writing parsers, or working with binary protocols.
Can this calculator handle Unicode characters beyond ASCII?
Yes. The Text → Codes tab supports the full Unicode range (U+0000 to U+10FFFF). For any character you type, it shows the Unicode code point (U+XXXX), the UTF-8 byte sequence, and the character's category. Characters like emoji (😀 = U+1F600) and accented letters (é = U+00E9) are fully supported.