Convert text to ASCII codes in decimal, hex, octal, or binary — or decode ASCII codes back to text. Full character-code table shown instantly.
Enter text on the left to see converted ASCII codes
ASCII (American Standard Code for Information Interchange) is a foundational character encoding standard established in 1963. It specifies a 7-bit binary code representing 128 unique values (integers 0 through 127). These values correspond to English letters, numerals, common punctuation marks, and non-printable control characters that manage teleprinters and teletype devices.
Modern software builds upon ASCII through the Universal Character Set (Unicode). Unicode assigns a unique integer code point to more than 149,000 characters spanning global writing systems, scientific notation, and emojis. Because the first 128 code points in Unicode align identically with standard ASCII, ASCII text is inherently compatible with modern Unicode architectures.
A common point of confusion is the distinction between a character's integer code point and its encoded byte representation:
A has decimal code 65, hexadecimal 0x41, and binary 01000001).0–127) occupy exactly one byte in UTF-8 matching their code point, characters beyond code 127 consume between two and four bytes.This tool converts text to four primary numeral bases and allows customising separators and prefixes.
Decimal representation expresses code points using standard base-10 digits (0–9). It is the most intuitive format for human reading, mathematical analysis, and introductory computer science courses.
A → 65, B → 66, space → 32Hexadecimal representation groups each byte into two 4-bit nibbles expressed through digits 0–9 and A–F. It is significantly more compact than binary and maps directly to computer memory addresses.
A → 0x41 (or 41), ~ → 0x7EBinary displays characters in raw bit patterns of zeros and ones (0 and 1). Each standard ASCII character is represented as an 8-bit byte (padded with a leading zero) or extended bit widths for larger Unicode values.
A → 01000001, B → 01000010Octal uses base-8 digits (0–7), where each digit represents three binary bits.
A → 0o101 (or 101), newline → 0o012chmod), legacy telecommunication hardware, and escape sequences in C compilers.The table below illustrates how common characters across ASCII and Unicode appear in each format:
| Character | Description | Decimal | Hexadecimal | Octal | Binary |
|---|---|---|---|---|---|
NUL | Null character | 0 | 0x00 | 0o000 | 00000000 |
TAB | Horizontal tab | 9 | 0x09 | 0o011 | 00001001 |
LF | Line feed (newline) | 10 | 0x0A | 0o012 | 00001010 |
CR | Carriage return | 13 | 0x0D | 0o015 | 00001101 |
SP | Space | 32 | 0x20 | 0o040 | 00100000 |
0 | Digit Zero | 48 | 0x30 | 0o060 | 00110000 |
9 | Digit Nine | 57 | 0x39 | 0o071 | 00111001 |
A | Uppercase A | 65 | 0x41 | 0o101 | 01000001 |
Z | Uppercase Z | 90 | 0x5A | 0o132 | 01011010 |
a | Lowercase a | 97 | 0x61 | 0o141 | 01100001 |
z | Lowercase z | 122 | 0x7A | 0o172 | 01111010 |
DEL | Delete | 127 | 0x7F | 0o177 | 01111111 |
£ | Pound sign | 163 | 0xA3 | 0o243 | 10100011 |
€ | Euro sign | 8364 | 0x20AC | 0o20254 | 0010000010101100 |
When decoding numbers into text ("Codes → Text" mode), the parser accepts values separated by spaces, commas, semicolons, tabs, or newlines.
You do not need to clean or normalise input delimiters manually before pasting:
72 101 108 108 111 or 72, 101, 108, 108, 111 → Hello0x48 0x65 0x6C 0x6C 0x6F or 48 65 6C 6C 6F → Hello01001000 01100101 01101100 01101100 01101111 → Hello0o110 0o145 0o154 0o154 0o157 → HelloThe conversion engine checks every token to prevent silent corruption:
0 to 1,114,111).0xD800 through 0xDFFF).Standard ASCII reserves codes 0 through 31 and code 127 for device control. While most modern applications do not rely on teleprinter signals, several control characters remain essential in everyday programming:
\n).\r\n).Converting characters to numeric codes and back is a standard programming task. Here is how to perform conversions in popular programming languages:
// Text to ASCII Decimal codes
const text = "Hello";
const codes = Array.from(text).map((ch) => ch.codePointAt(0)!);
console.log(codes); // [72, 101, 108, 108, 111]
// Decimal codes back to text
const decoded = String.fromCodePoint(...codes);
console.log(decoded); // "Hello"
// Hexadecimal formatting
const hexCodes = codes.map((c) => "0x" + c.toString(16).toUpperCase());
console.log(hexCodes); // ["0x48", "0x65", "0x6C", "0x6C", "0x6F"]
# Text to ASCII and Hex
text = "Hello"
decimals = [ord(char) for char in text]
hex_vals = [f"0x{ord(char):02X}" for char in text]
binary_vals = [f"{ord(char):08b}" for char in text]
print(decimals) # [72, 101, 108, 108, 111]
print(hex_vals) # ['0x48', '0x65', '0x6C', '0x6C', '0x6F']
print(binary_vals) # ['01001000', '01100101', '01101100', '01101100', '01101111']
# Codes back to text
reconstructed = "".join(chr(code) for code in decimals)
print(reconstructed) # "Hello"
package main
import (
"fmt"
"strings"
)
func main() {
text := "Hello"
var hexList []string
for _, r := range text {
hexList = append(hexList, fmt.Sprintf("0x%02X", r))
}
fmt.Println(strings.Join(hexList, " ")) // 0x48 0x65 0x6C 0x6C 0x6F
// Reconstruct rune back to string
codes := []rune{72, 101, 108, 108, 111}
fmt.Println(string(codes)) // Hello
}
fn main() {
let text = "Hello";
// Character to decimal and binary
let decimals: Vec<u32> = text.chars().map(|c| c as u32).collect();
let binaries: Vec<String> = text.chars().map(|c| format!("{:08b}", c as u32)).collect();
println!("{:?}", decimals); // [72, 101, 108, 108, 111]
println!("{:?}", binaries); // ["01001000", "01100101", "01101100", "01101100", "01101111"]
// Decode codes back to text
let decoded: String = decimals.into_iter().filter_map(char::from_u32).collect();
println!("{}", decoded); // "Hello"
}
This tool is provided for general informational and utility purposes only. Results may be inaccurate, incomplete, outdated, or contain errors. Always verify results before relying on or using them.
Some tools may use AI, automated processing, third-party services, or server-side processing. Do not rely on these tools as a substitute for professional advice.
Use at your own risk. BestToolOnline makes no guarantees regarding the accuracy, reliability, completeness, availability, or suitability of results, to the maximum extent permitted by applicable law.
See our Terms of Service and Privacy Policy for complete details.