Simple Counter is now an Android app.Our Android app is here. Become a founding tester and try it before anyone else.

Join the testers

Converter · Free · Nothing sent anywhere

ASCII, Hex, Binary and Decimal Converter

Short answer

ASCII gives every character a number from 0 to 127: A is 65 in decimal, 41 in hex and 01000001 in binary. Type text and this converter shows its bytes in decimal, hex, binary, octal and Base64, or paste codes in any of those and read the text back. Characters beyond 127 are shown as their UTF-8 bytes.

Text to codes and codes to text.

48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 2113 bytes, 13 characters. All of it is plain ASCII, one byte each.Text read as UTF-8 and shown as bytes.
The same bytes in six forms
FormResult
TextHello, World!
Decimal72 101 108 108 111 44 32 87 111 114 108 100 33
Hex48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21
Binary01001000 01100101 01101100 01101100 01101111 00101100 00100000 01010111 01101111 01110010 01101100 01100100 00100001
Octal110 145 154 154 157 054 040 127 157 162 154 144 041
Base64SGVsbG8sIFdvcmxkIQ==
Byte by byte
CharacterDecimalHexBinaryOctal
H724801001000110
e1016501100101145
l1086C01101100154
l1086C01101100154
o1116F01101111157
,442C00101100054
space322000100000040
W875701010111127
o1116F01101111157
r1147201110010162
l1086C01101100154
d1006401100100144
!332100100001041

Everything happens in this browser; the text is never sent anywhere. Only the menu choices are kept here.

Type text to get its codes, or choose decimal, hex, binary, octal or Base64 and paste codes to get the text. Every row is made from the same bytes, a byte table shows each one, and nothing leaves this page.

ASCII is the 128-character code that gives each letter, digit, symbol and control character a number from 0 to 127; this converter writes those numbers, and the UTF-8 bytes of any character beyond them, in decimal, hex, binary, octal and Base64.

  • No sign-up
  • Nothing sent
  • Both directions
  • UTF-8 aware
  • Works offline

Key facts

ASCII converter at a glance
DetailAnswer
ReadsText, decimal, hex, binary, octal, Base64
WritesText, decimal, hex, binary, octal, Base64, and a byte table
EncodingUTF-8, or plain ASCII that refuses anything above 127
Largest input20,000 characters; the byte table shows the first 256 bytes
Where your text goesNowhere: it is never sent or saved

How to convert ASCII to hex, binary or decimal

Type, read the row you need, and copy it.

  1. Type or paste your text

    Leave “What you are typing” on Text.

  2. Read the six rows

    Decimal, hex, binary, octal and Base64 are made from the same bytes.

  3. Check the byte table

    Each byte has its own row, with the character it belongs to.

  4. Set the layout

    Pick the separator, capital hex letters and 0x or 0b prefixes.

  5. Copy the form you need

    Each row has its own Copy button.

  6. To go back to text

    Change the first menu to Hex, Binary or another form and paste the codes.

Who uses an ASCII converter

Anyone who needs to see what is really in a piece of text.

  • Students of computing

    Checking that A is 65, 41 and 01000001, and why.

  • Programmers

    Reading a byte dump, an escape sequence or a hex string from a log.

  • Network and embedded engineers

    Writing a command as bytes for a serial or socket protocol.

  • Web developers

    Finding why é shows as é on a page.

  • Puzzle and CTF solvers

    Turning a string of binary or hex back into text.

  • Teachers

    Showing how text is stored, bit by bit.

The ASCII table: ranges, patterns and the one-bit case rule

ASCII is the original table of 128 numbered characters, 0 to 127, defined in RFC 20. It fits in seven bits, and a byte’s eighth bit is left at 0. The table has three parts: a block of control codes, the space, and the printable characters.

The ASCII table in ranges
DecimalHexBinaryWhat is there
0 to 3100 to 1F00000000 to 00011111Control characters: NUL, BEL, tab, line feed, carriage return, ESC
322000100000Space
33 to 4721 to 2F00100001 to 00101111Punctuation and symbols: ! " # $ % & ' ( ) * + , - . /
48 to 5730 to 3900110000 to 00111001The digits 0 to 9
58 to 643A to 4000111010 to 01000000Symbols: : ; < = > ? @
65 to 9041 to 5A01000001 to 01011010Capital letters A to Z
91 to 965B to 6001011011 to 01100000Symbols: [ \ ] ^ _ `
97 to 12261 to 7A01100001 to 01111010Lower-case letters a to z
123 to 1267B to 7E01111011 to 01111110Symbols: { | } ~
1277F01111111DEL, the delete control

Three patterns save a lot of table-reading. A digit’s code is its value plus 48, so “7” is 55, hex 37. Capital letters start at 65 (hex 41) and lower-case letters at 97 (hex 61). And a capital and its lower-case letter differ by exactly 32, one bit, which is why the hex pairs run 41 and 61, 42 and 62, up to 5A and 7A.

Upper and lower case differ by one bit (the 32s place)
LetterDecimalBinary
A6501000001
a9701100001
Z9001011010
z12201111010

Control characters: LF, CR, ESC and the rest

Codes 0 to 31 and 127 are not letters. They were instructions to teletypes and terminals, and a handful are still in constant use. Most converters leave their rows blank or print an invisible character, so a text that contains a line break looks as if it lost a byte. This page names each one and draws it with its Unicode picture (␊ for line feed) in the text row, and the byte table gives the abbreviation. To find control codes and zero-width characters already hidden in a text, paste it into the invisible character detector.

The control characters you will actually meet
NameDecimalHexBinaryWhat it does
NUL00000000000Null: ends a string in C, and padding in files
BEL70700000111Bell: the terminal beep
BS80800001000Backspace
HT90900001001Horizontal tab, written \t in code
LF100A00001010Line feed, a new line on Linux and macOS, written \n
CR130D00001101Carriage return, written \r; Windows ends a line with CR then LF
ESC271B00011011Escape: starts terminal colour and cursor sequences
DEL1277F01111111Delete

That CR LF pair is the reason the same text can be one byte longer per line when it comes from a Windows file: type the line break in the box above and the byte table shows 0A, and paste it from Notepad and you may see 0D 0A.

Beyond 127: why one character can be several bytes

ASCII stops at 127. Everything else, from é to € to emoji, is Unicode, and the way almost every web page and file stores it is UTF-8, defined in RFC 3629. UTF-8 is built so that the first 128 characters are exactly ASCII, one byte each, and every other character takes two to four bytes whose first bits say how many belong together. That is why a converter that shows “one number per character” is giving you a Unicode code point, not the bytes you would find in a file.

How many bytes UTF-8 uses
Character rangeBytesExampleIts bytes in hex
U+0000 to U+007F (ASCII)1A41
U+0080 to U+07FF2é (U+00E9)C3 A9
U+0800 to U+FFFF3€ (U+20AC)E2 82 AC
U+10000 to U+10FFFF4😀 (U+1F600)F0 9F 98 80

Type € in the box and the byte table lists E2, 82 and AC on three rows: the first is labelled with the character and “byte 1 of 3”, the next two “byte 2 of 3” and “byte 3 of 3”. Switch “Text is” to plain ASCII and the page refuses the euro sign and tells you why, rather than invent a code. Going the other way, type the three hex bytes E2 82 AC and the text row reads back €. Hand it E2 82 and no more, and it says two bytes are not valid UTF-8 instead of quietly repairing them.

The usual symptom of reading UTF-8 bytes as an older single-byte code page is text like “é” where an “é” should be: its two bytes C3 and A9 are shown as two characters. The converter shows what those bytes are, which is the quickest way to tell which encoding a file is in.

Input formats it reads

Paste codes the way they arrive. The reader accepts the common ways to write bytes and tells you which code it could not read rather than guessing.

What each input form accepts
You are typingThese all read the sameRule
Hex48 65 6C 6C 6F, 48,65,6C,6C,6F, 0x48 0x65, \x48\x65, 48656C6C6FPairs of digits; a glued run needs two digits per byte
Binary01001000 01100101, 0100100001100101Eight digits per byte; a glued run must divide by eight
Decimal72 101 108 108 111Each code 0 to 255, separated by spaces, commas or lines
Octal110 145 154 154 157Each code 0 to 377, separated by spaces, commas or lines
Base64SGVsbG8=Letters, digits, + and /; the - and _ variant and a missing = are accepted

A code over 255 is refused, not wrapped around: 300 is not a byte. If you meant a character such as €, enter its UTF-8 bytes, which is the message the page gives. And switching “What you are typing” does not clear the box: it rewrites it as the same bytes in the new form, so text becomes hex and hex becomes binary without retyping.

Base64 is not another ASCII code

Base64, defined in RFC 4648, is a different job from the others on this page. Hex, binary, decimal and octal are four ways of writing the same byte. Base64 takes three bytes (24 bits) and writes them as four characters from a 64-character alphabet, so that bytes can travel through systems that only handle text. (For a Base64 string that holds a picture, the Base64 to image converter decodes it to the image.) It makes the data a third longer; it does not hide or encrypt anything. The sixth row converts the bytes of your text, so “Hello” becomes SGVsbG8= and “Hello, World!” becomes SGVsbG8sIFdvcmxkIQ==.

Base64 against the other forms for the same text
TextHexBase64
Hi48 69SGk=
Hello48 65 6C 6C 6FSGVsbG8=
A41QQ==

What this converter does not do

This page converts the bytes of text; it does not encrypt, decode ciphers or guess the encoding. Hex and Base64 are not secret: anyone can reverse them, so neither protects a password or a message. It reads and writes UTF-8 and plain ASCII only. A file in Windows-1252, ISO-8859-1 or UTF-16 will show different bytes for any character above 127, and “extended ASCII” is not one standard but a name for several such code pages, so it is not offered. Text written as dots and dashes is a different code altogether, and the Morse code translator reads and writes it.

What this converter does and does not do
It doesIt does not
Text to decimal, hex, binary, octal and Base64, and backEncrypt or hide anything
UTF-8 byte by byte, with each byte tied to its characterRead UTF-16, Windows-1252 or ISO-8859-1
Name control characters and flag invalid UTF-8Repair broken bytes silently
Run entirely in this browserSend your text anywhere

This converter or a typical one

This converter compared with a typical one
 This pageA typical one
Characters above 127UTF-8 bytes, one row per byteOne number per character, or a wrong byte
Control charactersNamed and drawnBlank or invisible
Bad bytesCounted and pointed outSilently replaced
Input formatsSpaces, commas, 0x, \x, gluedOne separator
Changing directionBox rewritten as the same bytesBox cleared
Your text sent to a serverNeverVaries

Frequently asked questions

How do I convert ASCII to hex?

Type the text into the box and read the Hex row. Each character becomes the hex form of its ASCII code, so A is 41 and a is 61, and “Hello” is 48 65 6C 6C 6F. Use the separator and prefix options to match the format you need, then press Copy hex.

How do I convert ASCII to binary?

Type the text and read the Binary row. Each character is shown as eight bits, so A is 01000001 and a space is 00100000. The leading zero is kept because every ASCII code fits in seven bits and bytes are written in eight, which is the form most tools and exercises expect.

How do I convert hex to ASCII?

Choose Hex codes in the first menu and paste the codes, such as 48 65 6C 6C 6F. The Text row shows the characters, here “Hello”. Spaces, commas, 0x, \x and a glued run like 48656C6C6F are all read. A pair that is not valid hex is named so you can fix it.

How do I convert binary to text?

Choose Binary codes and paste the bits in groups of eight, such as 01001000 01101001, which reads “Hi”. A glued run with no spaces works if its length divides by eight. Groups shorter than eight digits are fine when spaces separate them.

What is the ASCII code for A?

A is 65 in decimal, 41 in hex, 101 in octal and 01000001 in binary. Lower-case a is 97, hex 61, exactly 32 more, because capitals and lower-case letters differ by one bit. The digits start at 48, so “0” is 48 and “9” is 57.

What is the difference between ASCII and UTF-8?

ASCII has 128 characters, 0 to 127. UTF-8 is a way of storing all of Unicode, and its first 128 characters are exactly ASCII, one byte each, so any ASCII text is already valid UTF-8. Every other character takes two to four bytes, which this page lists one byte per row.

Why does my text show strange characters like é?

The bytes were written as UTF-8 and read as an older single-byte code page. é is C3 A9 in UTF-8, and a single-byte reader shows C3 as à and A9 as ©. Paste the bytes here as hex to confirm: two bytes for one character means UTF-8, and the file must be opened as UTF-8.

What are the control characters in ASCII?

Codes 0 to 31 and 127 are control characters, not letters. They include NUL (0), tab (9), line feed (10), carriage return (13), escape (27) and delete (127). This page names each one and draws it in the text row, so a line break is visible as ␊ instead of vanishing.

Is extended ASCII a real standard?

No. ASCII is 7 bits, 0 to 127. “Extended ASCII” is a loose name for several 8-bit code pages such as ISO-8859-1 and Windows-1252 that agree on 0 to 127 and differ above it. Today the answer is UTF-8, and this page shows bytes above 127 as UTF-8 for that reason.

Open the ascii, hex, binary and decimal converter

Free, no sign-up, and what you enter stays in your own browser.