Hex ↔ String Converter

Online Hex to String & String to Hex Converter

Our free online Hex String Converter allows you to convert text to hexadecimal representation and vice versa. Perfect for debugging, analyzing data, and working with low-level protocols.

Features:

  • String to Hex: Convert any text to its hexadecimal representation.
  • Hex to String: Decode hexadecimal values back to readable text.
  • Multiple Formats: Choose space-separated, continuous, or 0x-prefixed output.
  • UTF-8 Support: Properly handles Unicode characters and emojis.
  • Flexible Input: Accepts hex with or without spaces, with 0x prefix.

1. What is Hexadecimal?

Hexadecimal (hex) is a base-16 number system using digits 0-9 and letters A-F. Each hex digit represents 4 bits, making it convenient for representing binary data. Two hex digits represent one byte (0x00 to 0xFF, or 0 to 255 in decimal).

2. Hex in Programming

Memory Addresses: 0x7fff5fbff8c0
Color Codes: #FF5733 (RGB in hex)
Binary Data: File headers, network packets
Character Codes: ASCII/Unicode values
Debugging: Viewing raw byte values

3. ASCII to Hex Examples

'A' → 0x41 (65 decimal)
'a' → 0x61 (97 decimal)
'0' → 0x30 (48 decimal)
Space → 0x20 (32 decimal)
Newline → 0x0A (10 decimal)

4. Reading Hex Dumps

Hex dumps show raw file or memory contents in hexadecimal format. They typically display 16 bytes per line with the ASCII representation alongside. Non-printable characters are usually shown as dots (.).

5. Common Hex Patterns

File Signatures: PDF starts with 25 50 44 46 (%PDF)
PNG: 89 50 4E 47 0D 0A 1A 0A
ZIP: 50 4B 03 04 (PK..)
UTF-8 BOM: EF BB BF


This Hex converter tool helps developers work with hexadecimal data easily.

100% client-side processing ensures your data remains private.

Related Tools

binary-decimal-converter

base64-encoder-decoder

url-encoder-decoder

Understanding Hexadecimal

Number Systems Comparison:

Binary (Base 2): 0, 1
Decimal (Base 10): 0-9
Hexadecimal (Base 16): 0-9, A-F
Example: Decimal 255 = Binary 11111111 = Hex FF

Why Use Hexadecimal?

• More compact than binary (1 hex digit = 4 binary digits)
• Direct mapping to bytes (2 hex digits = 1 byte)
• Easy mental conversion to/from binary
• Standard in low-level programming and hardware
• Human-readable representation of binary data

Hex Notation Conventions:

0x prefix: C, JavaScript - 0xFF
# prefix: CSS colors - #FF5733
h suffix: Assembly - FFh
\x escape: String literals - \xFF
% prefix: URL encoding - %20

Working with Hex in Code:

JavaScript: parseInt("FF", 16) → 255
JavaScript: (255).toString(16) → "ff"
Python: int("FF", 16) → 255
Python: hex(255) → "0xff"