Text to Hex Converter
Part of our Text Tools
Convert text to hexadecimal and hex back to text. Supports ASCII and UTF-8 encoding with space-separated or continuous hex output.
How to Convert Text to Hexadecimal
- Enter text: Type or paste your text into the left editor. The tool supports all ASCII and UTF-8 characters including letters, numbers, symbols, and emojis.
- Convert to hex: Click "Text to Hex" to convert. Each character becomes a two-digit hexadecimal number separated by spaces.
- Convert back: Paste hex code into either editor and click "Hex to Text" to decode it back to readable text.
- Format options: Use "Uppercase Hex" to convert hex digits to capital letters (A-F instead of a-f).
- Copy results: Use the "Copy" buttons to copy the text or hex output to your clipboard.
What is Hexadecimal?
Hexadecimal (hex) is a base-16 numeral system that uses 16 distinct symbols: 0-9 to represent values zero to nine, and A-F (or a-f) to represent values ten to fifteen. Each hex digit represents four binary digits (bits), making hex a more compact and human-readable way to represent binary data. In computing, hex is widely used for memory addresses, color codes, character encoding, and low-level programming.
When converting text to hex, each character is first converted to its ASCII or UTF-8 numeric value, then that number is expressed in hexadecimal. For example, the letter 'A' has an ASCII value of 65 in decimal, which equals 41 in hex. The letter 'a' is 97 in decimal or 61 in hex. This two-character hex representation is much shorter than the 8-digit binary equivalent.
Understanding Hex Encoding
Two-digit pairs: Each standard ASCII character converts to a two-digit hex number (00-FF), representing values 0-255.
Example conversions: 'A' = 41, 'a' = 61, '0' = 30, space = 20, '!' = 21
Case in hex: Hex digits A-F can be written in uppercase or lowercase (41 = 41, both are valid). This tool defaults to lowercase but provides an uppercase option.
UTF-8 characters: Special characters and emojis use multiple bytes and will produce longer hex sequences (4, 6, or 8 hex digits).
Common Use Cases
Web Development: HTML color codes use hex format (#FF0000 for red). Character encoding and URL encoding also use hex representations.
Programming: Represent byte values, memory addresses, and binary data in a compact, readable format. Hex literals in code use 0x prefix (0x41).
Data Analysis: Examine file contents at the byte level, debug binary protocols, or analyze data streams in hexadecimal format.
Cryptography: Display hash values, encryption keys, and cryptographic signatures in hex format for easy copying and verification.
Network Protocols: Debug network packets, analyze protocol data, or examine raw network traffic in hexadecimal.
Embedded Systems: Program microcontrollers, write firmware, or work with low-level hardware using hex values.
Hexadecimal Number System
Hexadecimal uses positional notation like decimal, but with base 16 instead of base 10. Each position represents a power of 16: ...4096, 256, 16, 1. The hex number 2F equals (2 × 16) + (15 × 1) = 47 in decimal. This makes hex particularly convenient for computers because 16 is a power of 2, and each hex digit maps perfectly to four binary bits. Two hex digits (one byte) can represent 256 different values, exactly matching the capacity of an 8-bit byte.
Hex in Color Codes
One of the most common uses of hexadecimal in everyday computing is HTML/CSS color codes. A color like #FF5733 uses six hex digits: FF (255 red), 57 (87 green), and 33 (51 blue). Each color channel ranges from 00 (no color) to FF (full intensity). This compact notation is why web developers and designers work extensively with hex values. Understanding hex-to-decimal conversion helps you interpret and create custom colors for websites and applications.
Working with Hex Data
When working with hex data, spaces between byte pairs (like 48 65 6C 6C 6F) improve readability but aren't required - continuous hex strings work too. Some applications prefix hex values with "0x" (like 0x48), while others use different notations. This tool accepts hex input in multiple formats: with or without spaces, with or without 0x prefixes. It automatically handles the conversion and produces clean, space-separated hex output for maximum compatibility.