Converter · Free · Nothing sent anywhere
ASCII, Hex, Binary and Decimal Converter
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.
| Form | Result |
|---|---|
| Text | Hello, World! |
| Decimal | 72 101 108 108 111 44 32 87 111 114 108 100 33 |
| Hex | 48 65 6C 6C 6F 2C 20 57 6F 72 6C 64 21 |
| Binary | 01001000 01100101 01101100 01101100 01101111 00101100 00100000 01010111 01101111 01110010 01101100 01100100 00100001 |
| Octal | 110 145 154 154 157 054 040 127 157 162 154 144 041 |
| Base64 | SGVsbG8sIFdvcmxkIQ== |
| Character | Decimal | Hex | Binary | Octal |
|---|---|---|---|---|
| H | 72 | 48 | 01001000 | 110 |
| e | 101 | 65 | 01100101 | 145 |
| l | 108 | 6C | 01101100 | 154 |
| l | 108 | 6C | 01101100 | 154 |
| o | 111 | 6F | 01101111 | 157 |
| , | 44 | 2C | 00101100 | 054 |
| space | 32 | 20 | 00100000 | 040 |
| W | 87 | 57 | 01010111 | 127 |
| o | 111 | 6F | 01101111 | 157 |
| r | 114 | 72 | 01110010 | 162 |
| l | 108 | 6C | 01101100 | 154 |
| d | 100 | 64 | 01100100 | 144 |
| ! | 33 | 21 | 00100001 | 041 |
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
| Detail | Answer |
|---|---|
| Reads | Text, decimal, hex, binary, octal, Base64 |
| Writes | Text, decimal, hex, binary, octal, Base64, and a byte table |
| Encoding | UTF-8, or plain ASCII that refuses anything above 127 |
| Largest input | 20,000 characters; the byte table shows the first 256 bytes |
| Where your text goes | Nowhere: it is never sent or saved |
How to convert ASCII to hex, binary or decimal
Type, read the row you need, and copy it.
Type or paste your text
Leave “What you are typing” on Text.
Read the six rows
Decimal, hex, binary, octal and Base64 are made from the same bytes.
Check the byte table
Each byte has its own row, with the character it belongs to.
Set the layout
Pick the separator, capital hex letters and 0x or 0b prefixes.
Copy the form you need
Each row has its own Copy button.
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.
| Decimal | Hex | Binary | What is there |
|---|---|---|---|
| 0 to 31 | 00 to 1F | 00000000 to 00011111 | Control characters: NUL, BEL, tab, line feed, carriage return, ESC |
| 32 | 20 | 00100000 | Space |
| 33 to 47 | 21 to 2F | 00100001 to 00101111 | Punctuation and symbols: ! " # $ % & ' ( ) * + , - . / |
| 48 to 57 | 30 to 39 | 00110000 to 00111001 | The digits 0 to 9 |
| 58 to 64 | 3A to 40 | 00111010 to 01000000 | Symbols: : ; < = > ? @ |
| 65 to 90 | 41 to 5A | 01000001 to 01011010 | Capital letters A to Z |
| 91 to 96 | 5B to 60 | 01011011 to 01100000 | Symbols: [ \ ] ^ _ ` |
| 97 to 122 | 61 to 7A | 01100001 to 01111010 | Lower-case letters a to z |
| 123 to 126 | 7B to 7E | 01111011 to 01111110 | Symbols: { | } ~ |
| 127 | 7F | 01111111 | DEL, 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.
| Letter | Decimal | Binary |
|---|---|---|
| A | 65 | 01000001 |
| a | 97 | 01100001 |
| Z | 90 | 01011010 |
| z | 122 | 01111010 |
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.
| Name | Decimal | Hex | Binary | What it does |
|---|---|---|---|---|
| NUL | 0 | 00 | 00000000 | Null: ends a string in C, and padding in files |
| BEL | 7 | 07 | 00000111 | Bell: the terminal beep |
| BS | 8 | 08 | 00001000 | Backspace |
| HT | 9 | 09 | 00001001 | Horizontal tab, written \t in code |
| LF | 10 | 0A | 00001010 | Line feed, a new line on Linux and macOS, written \n |
| CR | 13 | 0D | 00001101 | Carriage return, written \r; Windows ends a line with CR then LF |
| ESC | 27 | 1B | 00011011 | Escape: starts terminal colour and cursor sequences |
| DEL | 127 | 7F | 01111111 | Delete |
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.
| Character range | Bytes | Example | Its bytes in hex |
|---|---|---|---|
| U+0000 to U+007F (ASCII) | 1 | A | 41 |
| U+0080 to U+07FF | 2 | é (U+00E9) | C3 A9 |
| U+0800 to U+FFFF | 3 | € (U+20AC) | E2 82 AC |
| U+10000 to U+10FFFF | 4 | 😀 (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.
| You are typing | These all read the same | Rule |
|---|---|---|
| Hex | 48 65 6C 6C 6F, 48,65,6C,6C,6F, 0x48 0x65, \x48\x65, 48656C6C6F | Pairs of digits; a glued run needs two digits per byte |
| Binary | 01001000 01100101, 0100100001100101 | Eight digits per byte; a glued run must divide by eight |
| Decimal | 72 101 108 108 111 | Each code 0 to 255, separated by spaces, commas or lines |
| Octal | 110 145 154 154 157 | Each code 0 to 377, separated by spaces, commas or lines |
| Base64 | SGVsbG8= | 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==.
| Text | Hex | Base64 |
|---|---|---|
| Hi | 48 69 | SGk= |
| Hello | 48 65 6C 6C 6F | SGVsbG8= |
| A | 41 | QQ== |
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.
| It does | It does not |
|---|---|
| Text to decimal, hex, binary, octal and Base64, and back | Encrypt or hide anything |
| UTF-8 byte by byte, with each byte tied to its character | Read UTF-16, Windows-1252 or ISO-8859-1 |
| Name control characters and flag invalid UTF-8 | Repair broken bytes silently |
| Run entirely in this browser | Send your text anywhere |
This converter or a typical one
| This page | A typical one | |
|---|---|---|
| Characters above 127 | UTF-8 bytes, one row per byte | One number per character, or a wrong byte |
| Control characters | Named and drawn | Blank or invisible |
| Bad bytes | Counted and pointed out | Silently replaced |
| Input formats | Spaces, commas, 0x, \x, glued | One separator |
| Changing direction | Box rewritten as the same bytes | Box cleared |
| Your text sent to a server | Never | Varies |
More converters
Every converter on the site runs in your browser, needs no sign-up, and sends nothing anywhere.
Numbers & code7
Binary, hex, octal and any base, number systems, and codes generated in the browser.
Data storage converter
GB and GiB apart, why 1 TB shows 931 GB, Mbps against MB/s, and download time at your speed.
Open data storage converter →Binary converter
Binary, octal, decimal, hex or any base 2 to 36, exact at any size, fractions and two's complement, with steps.
Open binary converter →Binary to decimal
Each bit times its power of 2, binary fractions after the point, and signed patterns read at 8 to 64 bits.
Open binary to decimal →Decimal to binary
Repeated division by 2 shown step by step, 0.1 as the repeating 0.0(0011), negatives in two's complement.
Open decimal to binary →Decimal to hex
Division by 16 with A to F named, RGB channels to a #RRGGBB code, and negatives as hex patterns.
Open decimal to hex →Hex to decimal
Powers of 16 shown, #RGB to #RRGGBBAA colour codes read as channels, signed bytes and 0x addresses.
Open hex to decimal →Password generator
Random characters or EFF-word passphrases from the browser's crypto, no modulo bias, exact entropy, nothing sent.
Open password generator →
All 35 converters, by category: Length (10) · Weight & mass (5) · Temperature (3) · Cooking (1) · Currency (1) · Numbers & code (8) · Text (2) · Images (3) · Dates & time (2)
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.
Related guides
Longer answers to the questions behind the numbers.
- Counting
Why word counts differ between tools
The same sentence is 26 words to one counter and 39 to another. Four counting rules side by side, and how to meet a hard limit whichever one a form uses.
- Tallying
Tally marks explained
Groups of five, the five-bar gate, and why the convention has survived for centuries.
- Reference
Types of counters explained
Synchronous vs asynchronous, mod-N, ring and Johnson, industrial and PLC counters, plus mechanical and software counters.
- Counting
Count to 1,023 on your fingers
The value of each of ten fingers, worked examples, how to count up, and why the top is 1,023.
- Tallying
Tally marks in Excel and Google Sheets
The REPT, INT and MOD formula for five-bar gates, tested on every count from 0 to 120; a tally chart from raw answers with COUNTIF; and why LEN miscounts typed tallies.