Text to ASCII Converter
ED-13Paste text to get the code of each character in decimal, hex, binary or octal, or paste codes to read the text. Choose Unicode code points or UTF-8 bytes for characters beyond ASCII.
Runs in your browser. Nothing is uploaded.
Text or character codes
Result
How to use it
- Paste your text or your list of codes into the input box.
- Press Text to codes or Codes to text.
- Set Codes are to decimal, hexadecimal, binary or octal.
- Set Characters as to Unicode code points or UTF-8 bytes, and pick a separator.
- Copy the result.
ASCII, code points and UTF-8 bytes
ASCII defines only codes 0 to 127. For those characters, the Unicode code point and the UTF-8 byte are the same number, so H is 72 in both modes. Beyond ASCII they differ. The letter ö is code point 246 but two UTF-8 bytes, 195 and 182, and an emoji such as U+1F600 is code point 128512 but four bytes. Choose the mode that matches what you need: code points for a character table, bytes for what a file or network message holds.
Reading codes back
Codes to text uses the same two settings, so choose the ones you used to produce the codes. Numbers can be separated by spaces, commas, semicolons or line breaks and may carry 0x or 0b prefixes. A value above U+10FFFF, a surrogate on its own, or a byte value above 255 in bytes mode is reported with its position. In bytes mode, the bytes must form valid UTF-8.
What it does not cover
The tool does not convert to older 8-bit code pages such as Windows-1252 or ISO 8859-1, where code 233 means é but the UTF-8 bytes would be different. Control characters are shown by number, so a line break is 10. The output is a list of codes, not a formatted ASCII table. For escapes like \u00e9, use the Unicode Escape tool.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
"x" at line 1, column 4 is not a decimal number. Change the "Codes are" setting if the numbers use another base. | A code is not a valid number in the base selected. | Correct the value, or change the Codes are setting. |
"1114112" at line 1, column 1 is above U+10FFFF (1114111), the largest Unicode code point. | The number is larger than any Unicode character. | Use a value from 0 to 1114111, or 10FFFF in hex. |
"300" at line 1, column 1 is above 255, so it is not a byte. Switch to "Unicode code points" for larger values. | In UTF-8 bytes mode, every value must be from 0 to 255. | Use bytes up to 255, or switch Characters as to Unicode code points. |
Questions people ask
How do I convert text to ASCII codes?
Paste the text, leave Codes are on Decimal and press Text to codes. Each character appears as its number, so Hello gives 72 101 108 108 111. Switch to hexadecimal or binary for other bases.
How do I convert ASCII codes to text?
Paste the numbers, separated by spaces, commas or line breaks, and press Codes to text. Pick the base the numbers are written in. Decimal 72 101 108 108 111 gives Hello.
What is the difference between ASCII and Unicode?
ASCII has 128 characters, numbered 0 to 127. Unicode includes those same 128 as its first block and adds over a million code points for other scripts, symbols and emoji. The numbers for English letters are identical in both.
Why are accented letters not ASCII?
Letters such as é and ö are not among the 128 ASCII characters. This tool gives them their Unicode code point by default, or their UTF-8 bytes if you choose that setting. Neither is an ASCII code.
What is the ASCII code for a space or a newline?
A space is 32 (hex 20), a line feed is 10 (hex 0a) and a carriage return is 13 (hex 0d). Paste a space or a line break into the input with Text to codes selected to see them.
How do I get the ASCII code in binary or hex?
Change Codes are to Binary or Hexadecimal. Binary codes are padded to 8 bits and hex codes to 2 digits, for example 01001000 or 48 for the letter H. Tick Uppercase hex letters for A to F in capitals.
About this tool
ASCII defines codes 0 to 127. Characters beyond that, such as ö or an emoji, are not ASCII. By default this tool gives their Unicode code point (ö is 246, the emoji U+1F600 is 128512), which matches the first 128 values of ASCII. Choose "UTF-8 bytes" to get the bytes a file or network message would hold instead: ö becomes 195 182. Decoding uses the same two settings, so pick the same ones you used to encode. Codes may be separated by spaces, commas or line breaks and may carry 0x or 0b prefixes. It does not convert between ASCII and other legacy code pages.