ASCII / Binary / Hex Converter
Convert text between ASCII, binary, hexadecimal, octal, and decimal representations instantly. Free online tool — runs entirely in your browser.
How to Use This Converter
- Choose your input format from the dropdown: Text (UTF-8), Binary, Hexadecimal, Octal, or Decimal.
- Type or paste your data into the input panel. For numeric formats, separate values with spaces or commas.
- Select the output format you need. The conversion happens instantly as you type.
- Use the separator option to control how numeric output values are delimited — spaces (default), commas, or no separator.
- Click Copy to copy the result, or use the Swap button to reverse the input and output formats.
What Is ASCII?
ASCII (American Standard Code for Information Interchange) is one of the oldest and most fundamental character encoding standards in computing. Published in 1963 and last updated in 1986, ASCII assigns a numeric value to 128 characters: 33 non-printable control characters (such as newline, tab, and null) and 95 printable characters (uppercase and lowercase English letters, digits, punctuation marks, and the space character).
ASCII uses 7 bits to represent each character, giving it a range of 0 to 127. In practice, most systems store ASCII characters in a full 8-bit byte, with the high bit set to zero. This simplicity is why ASCII remains the foundation of virtually all modern character encodings — UTF-8, the dominant encoding on the web, is fully backward-compatible with ASCII for the first 128 code points.
Understanding ASCII values is essential for tasks like debugging network protocols, analyzing binary file formats, writing low-level code, and performing character manipulation. For example, knowing that A is 65 and a is 97 (a difference of 32) makes it trivial to convert between uppercase and lowercase in any programming language using bitwise operations.
Binary Representation of Text
At the lowest level, all data in a computer is stored as binary — sequences of 0s and 1s. Each binary digit (bit) represents a power of 2, and 8 bits form one byte. When you convert text to binary, each character becomes its 8-bit binary equivalent based on its ASCII (or Unicode) code point.
For example, the word "Hello" becomes 01001000 01100101 01101100 01101100 01101111 in binary. Breaking this down: H is code point 72, which in binary is 01001000 (64 + 8 = 72). Each space-separated group of 8 bits represents one character.
Binary representation is used in network protocols, serial communication, embedded systems programming, and understanding how CPUs process data. It is also the basis for bitwise operations — AND, OR, XOR, and bit shifting — which are fundamental to algorithms in cryptography, compression, and graphics.
Hexadecimal in Programming
Hexadecimal (base 16) uses digits 0-9 and letters A-F to represent values. Each hex digit corresponds to exactly 4 binary bits, which means two hex digits represent one byte. This compact representation makes hex the preferred notation for binary data across programming.
You encounter hexadecimal constantly in software development: CSS color codes (#FF5733), memory addresses (0x7FFF5FBFF8AC), Unicode code points (U+00E9 for the character e with an accent), escape sequences in strings (\x1B for the escape character), and when viewing binary files in a hex editor. Network packet captures, cryptographic hashes like SHA-256, and MAC addresses (e.g., 00:1A:2B:3C:4D:5E) all use hexadecimal notation.
Converting between hex and binary is trivial because each hex digit maps to a fixed 4-bit pattern: 0=0000, F=1111. This relationship is why hex became the standard human-readable representation of binary data — it is far more compact than binary while preserving a direct bit-level correspondence.
Octal and Decimal Representations
Octal (base 8) uses digits 0-7, with each digit representing exactly 3 bits. While less common than hex in modern programming, octal is still used in Unix file permissions (e.g., chmod 755), some older programming languages, and the C/C++ escape syntax for characters (e.g., \101 for the letter A). Each octal digit corresponds to a group of 3 permission bits (read=4, write=2, execute=1).
Decimal (base 10) is the standard human number system and how ASCII code points are most commonly referenced in documentation and lookup tables. When someone says "the ASCII value of A is 65," they are using decimal. Decimal values are also used in HTML numeric character references (A renders as A) and in many programming language APIs like JavaScript's String.fromCharCode(72, 101, 108, 108, 111) to produce "Hello."
Common Use Cases
- Debugging network protocols: Convert raw binary or hex packet data back to readable text to inspect HTTP headers, API responses, or WebSocket frames.
- Reverse engineering: Analyze binary file formats by converting hex dumps to text to find embedded strings, magic bytes, and metadata.
- Embedded systems: Convert character data for microcontroller programming where you work directly with byte values in hex or binary.
- CTF challenges and puzzles: Capture-the-flag competitions frequently encode flags in binary, hex, or octal that need to be decoded back to text.
- Learning and education: Understanding how text maps to numbers and binary is fundamental to computer science and helps clarify concepts like character encoding, byte order, and bitwise operations.
- Data validation: Quickly verify that a hex string or binary sequence decodes to the expected text when working with encoding layers in APIs or file formats.
Related Tools
Encode strings for safe transport with Base64 Encoder / Decoder. Convert between number systems with the Number Base Converter. Generate cryptographic hashes with the Hash Generator (MD5/SHA). Encode special characters in URLs with the URL Encoder / Decoder. Convert HTML special characters with the HTML Entity Encoder / Decoder.
Frequently Asked Questions
- What is ASCII?
- ASCII (American Standard Code for Information Interchange) is a character encoding standard that assigns numeric values to 128 characters, including English letters (A-Z, a-z), digits (0-9), punctuation, and control characters. For example, the letter "A" is 65 in decimal, 41 in hexadecimal, and 01000001 in binary.
- How do I convert text to binary?
- Each character in your text has an ASCII code number. To convert to binary, look up the ASCII decimal value and convert it to base 2. For example, "Hi" becomes "01001000 01101001" because H=72 (01001000) and i=105 (01101001). This tool performs the conversion automatically.
- What is the difference between ASCII and Unicode?
- ASCII defines 128 characters using 7 bits, covering only English letters and basic symbols. Unicode is a superset that supports over 149,000 characters from every writing system, emoji, and technical symbols. The first 128 Unicode code points are identical to ASCII, so all ASCII text is valid Unicode.
- Why are hex values used in programming?
- Hexadecimal (base 16) is popular in programming because each hex digit represents exactly 4 binary bits, making it a compact way to express binary data. Two hex digits represent one byte (8 bits). This makes hex ideal for memory addresses, color codes (#FF0000), and byte-level data inspection.
- What are common ASCII values developers should know?
- Key values include: A=65, Z=90, a=97, z=122, 0=48, 9=57, space=32, newline (LF)=10, carriage return (CR)=13, tab=9, null=0. The range 0-31 and 127 are non-printable control characters. The printable characters span 32-126.
- Can this tool handle non-ASCII characters?
- Yes. When you enter characters outside the ASCII range (code points above 127), the tool converts them using their UTF-16 code unit values and displays a warning note. For full Unicode support including emoji and CJK characters, the decimal and hex output will show the correct code point values.
AI agent tools available.
The CodeTidy MCP Server gives Claude, Cursor, and other AI agents
access to 47 developer tools. One command: npx @codetidy/mcp