Encoding tool

ASCII Converter

Convert text to ASCII codes and back in decimal, hex, octal or binary, with a full 0-127 ASCII table. Runs in your browser and uploads nothing.

Last updated

Every character a computer stores is a number. ASCII is the oldest and simplest table of those numbers: 128 characters, from 0 to 127. An ASCII converter turns text into those codes and codes back into text. A is 65, a is 97 and a space is 32.

Direction
Number base

Written in decimal, like 72 105.

11 characters
11 codes

11 characters converted. Runs in your browser. Nothing you type is uploaded.

Type in the left box and it converts as you go. Choose Text to ASCII to get the codes, or ASCII to text to read them back, and set the Number base to write or read them in decimal, hex, octal or binary. Decode this sends the result back round the other way, so a round trip is one click. The ASCII table is below the explanation.

How text becomes ASCII codes

  1. Take each character of the text.
  2. Look up its code in the ASCII table. A is 65.
  3. Write the code in the base you want: 65 is 41 in hex, 101 in octal and 01000001 in binary.
  4. Put a space between the codes so they stay readable.
CharacterDecimalHexOctalBinary
A654110101000001
a976114101100001
0483006000110000
space322004000100000
~1267E17601111110

Upper and lower case letters are 32 apart: A is 65 and a is 97. The digit 0 is 48, not 0, so a digit's value is its code minus 48.

Reading ASCII codes

Split the codes at the spaces or commas, read each one in its base, and look the number up. 72 105 in decimal is H and i. If the base is wrong the answer is wrong or an error: 65 is A in decimal, e in hex, and not a binary number at all. The tool reports the first code it cannot read, with its position, rather than guessing.

ASCII table

All 128 codes. The shaded rows are control characters, which are commands for a terminal or printer rather than shapes to draw. LF is the line break at the end of a line, TAB is the tab key and ESC starts the escape sequences terminals use for colours.

ASCII table, codes 0 to 127
DecHexOctBinaryCharName
00000000000000NULNull
10100100000001SOHStart of heading
20200200000010STXStart of text
30300300000011ETXEnd of text
40400400000100EOTEnd of transmission
50500500000101ENQEnquiry
60600600000110ACKAcknowledge
70700700000111BELBell
80801000001000BSBackspace
90901100001001TABHorizontal tab
100A01200001010LFLine feed (newline)
110B01300001011VTVertical tab
120C01400001100FFForm feed
130D01500001101CRCarriage return
140E01600001110SOShift out
150F01700001111SIShift in
161002000010000DLEData link escape
171102100010001DC1Device control 1
181202200010010DC2Device control 2
191302300010011DC3Device control 3
201402400010100DC4Device control 4
211502500010101NAKNegative acknowledge
221602600010110SYNSynchronous idle
231702700010111ETBEnd of transmission block
241803000011000CANCancel
251903100011001EMEnd of medium
261A03200011010SUBSubstitute
271B03300011011ESCEscape
281C03400011100FSFile separator
291D03500011101GSGroup separator
301E03600011110RSRecord separator
311F03700011111USUnit separator
322004000100000SPSpace
332104100100001!
342204200100010"
352304300100011#
362404400100100$
372504500100101%
382604600100110&
392704700100111'
402805000101000(
412905100101001)
422A05200101010*
432B05300101011+
442C05400101100,
452D05500101101-
462E05600101110.
472F05700101111/
4830060001100000
4931061001100011
5032062001100102
5133063001100113
5234064001101004
5335065001101015
5436066001101106
5537067001101117
5638070001110008
5739071001110019
583A07200111010:
593B07300111011;
603C07400111100<
613D07500111101=
623E07600111110>
633F07700111111?
644010001000000@
654110101000001A
664210201000010B
674310301000011C
684410401000100D
694510501000101E
704610601000110F
714710701000111G
724811001001000H
734911101001001I
744A11201001010J
754B11301001011K
764C11401001100L
774D11501001101M
784E11601001110N
794F11701001111O
805012001010000P
815112101010001Q
825212201010010R
835312301010011S
845412401010100T
855512501010101U
865612601010110V
875712701010111W
885813001011000X
895913101011001Y
905A13201011010Z
915B13301011011[
925C13401011100\
935D13501011101]
945E13601011110^
955F13701011111_
966014001100000`
976114101100001a
986214201100010b
996314301100011c
1006414401100100d
1016514501100101e
1026614601100110f
1036714701100111g
1046815001101000h
1056915101101001i
1066A15201101010j
1076B15301101011k
1086C15401101100l
1096D15501101101m
1106E15601101110n
1116F15701101111o
1127016001110000p
1137116101110001q
1147216201110010r
1157316301110011s
1167416401110100t
1177516501110101u
1187616601110110v
1197716701110111w
1207817001111000x
1217917101111001y
1227A17201111010z
1237B17301111011{
1247C17401111100|
1257D17501111101}
1267E17601111110~
1277F17701111111DELDelete

Gotchas

  • ASCII stops at 127. é, €, a Chinese character and an emoji have no ASCII code. The tool leaves them out and tells you which, with their Unicode code point, rather than inventing a replacement.
  • Extended ASCII is not ASCII. Codes 128 to 255 mean different characters in different code pages, which is why the same file can show different symbols on different computers. Nothing above 127 is converted here.
  • Control characters are invisible. Code 10 is a line break and code 0 is nothing you can see. They are in the table and decode like any other code.
  • The base matters. 41 is ) in decimal and A in hex. Pick the base your codes use before you trust the output.
  • ASCII is not secret. It is another way of writing the same text. Anyone can convert it back, so do not use it to hide anything.

Common questions

How do I convert text to ASCII?

Type or paste the text into the left box with Text to ASCII selected. Each character is replaced by its ASCII code, a number from 0 to 127, and the codes are written with a space between them. The letter A is 65, so Hi cat becomes 72 105 32 99 97 116. Choose Decimal, Hex, Octal or Binary to write the codes in the base you need.

How do I convert ASCII codes to text?

Switch to ASCII to text, pick the base the codes are written in, and paste them. Spaces, commas and line breaks can separate the codes, in any mix, so 72, 105 and 72 105 both read as Hi. In hex an optional 0x in front of each code is fine, and in binary 0b is.

What is an ASCII code?

ASCII is a table from 1963 that gives 128 characters a number: 0 to 127. The digits, the English upper and lower case letters and the common punctuation each have a code, and so do 33 control characters such as line feed and tab. An ASCII code is that number, which can be written in decimal, hex, octal or binary. A capital A is 65, which is 41 in hex, 101 in octal and 01000001 in binary.

Where is the ASCII table?

Below the converter on this page. It lists all 128 codes, 0 to 127, in decimal, hex, octal and binary, with the character next to each one and the name of every control character, such as LF for line feed and ESC for escape.

What happens to letters like é, or an emoji?

They are not ASCII, so they have no ASCII code. Instead of swapping them for a question mark, the converter leaves them out of the codes and shows a warning that names each one with its Unicode code point, such as U+00E9 for é or U+1F431 for the cat emoji. To get the bytes for those characters, use the Binary Translator or the URL Encoder, which write UTF-8.

What is the difference between ASCII and Unicode?

Unicode is the larger table: over a million possible characters from every writing system. ASCII is the first 128 of them, with the same numbers. That is why the code for A is 65 in both. UTF-8, the encoding most of the web uses, writes those first 128 characters as the same single byte as ASCII and every other character as two to four bytes.

Why does it say my code is not ASCII?

Either a code is bigger than 127, which ASCII does not have, or it is not a number in the base you chose. A hex code with a G in it, or a binary code with a 2, is reported with its position. A decimal 200 is over the limit. Check that the base setting matches how your codes are written: 41 is a closing bracket in decimal but the letter A in hex.

Is anything I paste here sent to a server?

No. The conversion runs in your browser and neither box is submitted anywhere. The site records that the tool was used, in which direction and base, and how long the input was, so we know which tools are worth building next. The text itself is never part of that.

See all tools

Want this explained by a cat?

The videos cover the same ground in sixty seconds. If there is a tool you want built next, ask.