Text to Hex Converter

Konversi teks ke kode heksadesimal secara online gratis.

Cara menggunakan Text to Hex Converter

1

Tempel teks Anda ke dalam input field

Klik area teks besar yang berlabel 'Enter Text Here' dan tempel atau ketik teks yang ingin Anda konversi ke format hexadecimal. Anda dapat memasukkan hingga 50.000 karakter.

2

Pilih format encoding Anda

Pilih antara UTF-8 (default), ASCII, atau UTF-16 dari menu dropdown 'Encoding' di bawah text field. UTF-8 direkomendasikan untuk sebagian besar use case.

3

Klik tombol Convert

Tekan tombol biru 'Convert to Hex' untuk langsung menghasilkan output hexadecimal di panel sebelah kanan.

4

Salin kode hex Anda

Klik tombol 'Copy to Clipboard' di sebelah hex output untuk menyalin semua kode yang telah dikonversi, atau pilih dan salin bagian individual secara manual.

5

Opsional: Unduh atau hapus

Klik 'Download as .txt' untuk menyimpan konversi hex Anda ke dalam file, atau klik 'Clear All' untuk mengatur ulang kedua field dan memulai konversi baru.

Alat Terkait

Text to hex converter: encode and decode text in hexadecimal free

Text to hex converter: encode and decode text in hexadecimal free

Convert any text to hexadecimal encoding and hex back to readable text, ToolHQ's text to hex converter supports multi-line text and both spaced and compact output. Converted in your browser, no data is sent anywhere.

A text to hex converter maps each character to its two-digit hexadecimal (base 16) equivalent using the ASCII character table. The letter "A" becomes 41, the lowercase "a" becomes 61, the digit "0" becomes 30, and a space becomes 20. The reverse direction reads hex values and produces the original characters.

Hexadecimal is the most practical way to represent binary data for human use. Every byte (8 bits) maps to exactly two hex digits, making hex more compact than binary while remaining precise and unambiguous. It is the standard representation in memory dumps, packet captures, color codes, Unicode code points, and nearly every security and networking tool.

Key takeaways

  • Hex uses base 16: digits 0-9 plus letters A-F (or a-f)
  • Each character maps to exactly two hex digits: A=41, a=61, 0=30, space=20
  • ToolHQ converts text to hex AND hex back to text, with spaced or compact output
  • Converted in your browser, no data is sent anywhere
  • Hex is more compact than binary and is the standard format in debugging tools

What hexadecimal is and why it matters

Hexadecimal is a base-16 number system that uses digits 0-9 and letters A-F to represent values from 0 to 15 in a single character. A single byte (8 bits) holds values from 0 to 255, which requires two hexadecimal digits (00 to FF).

This makes hex extraordinarily useful for representing binary data:

  • Binary: 01000001 (8 characters for one byte)
  • Decimal: 65 (2-3 characters)
  • Hexadecimal: 41 (exactly 2 characters, always)

The consistency is why hex is the default representation in memory editors, network analyzers, hash outputs, and color codes. The Wikipedia ASCII article shows the full ASCII table with decimal and hexadecimal equivalents for every character.

In web development, hex shows up constantly. CSS colors like #3b82f6 are three two-digit hex values (3B for red, 82 for green, F6 for blue). Unicode code points like U+0041 (the letter A) are in hex. SHA-256 hashes like 2cf24dba... are 64 hex characters representing 32 bytes.


Quick reference: hex values for common characters

Character ASCII decimal Hex
A (uppercase) 65 41
a (lowercase) 97 61
0 (digit zero) 48 30
(space) 32 20
Z (uppercase) 90 5A
z (lowercase) 122 7A
! (exclamation) 33 21
@ (at sign) 64 40

The pattern: uppercase letters are in the 41-5A range, lowercase in 61-7A, digits in 30-39. The 20-hex difference between uppercase and lowercase (decimal 32) is why toggling case is a simple bit operation.


When you need text to hex conversion

Debugging data encoding: When you receive garbled text, unexpected characters, or encoding errors, looking at the hex values reveals exactly what bytes are present. A zero-width space (hex E2 80 8B) or a BOM (EF BB BF) is invisible in plain text but immediately visible in hex.

Security research and CTF challenges: Hex encoding is fundamental in cybersecurity. Malware analysis, network packet inspection, and CTF (Capture the Flag) challenges frequently present data in hex form. Converting between text and hex is a basic skill in the field.

Inspecting hidden characters: Copy-pasting from PDFs, Word documents, and web pages often introduces invisible characters (smart quotes, non-breaking spaces, zero-width joiners) that cause downstream issues in code or data pipelines. Hex encoding reveals them.

Generating test data: When you need specific byte sequences for testing (null bytes, specific control characters, extended ASCII), encoding them as hex is the clean way to specify them.

URL encoding verification: Hex encoding helps verify how characters appear in URL-encoded strings, where %20 is the space character and %41 is uppercase A. The values are the same as in text-to-hex, URL percent encoding uses the same hex values.

Cryptography and hashing: Hash outputs like MD5 and SHA-256 are traditionally displayed as hex strings. Understanding how text maps to hex helps in understanding digest computation.

Tomoko, a data engineer at a healthcare company, was processing CSV exports from a legacy system. Some patient name fields were displaying with extra characters that caused database import errors. She piped a problem row through ToolHQ's text to hex converter and immediately spotted C2 A0 (non-breaking space, UTF-8 encoding) in several fields. The legacy system had been inserting non-breaking spaces instead of regular spaces. She added a hex-based cleaning step to her pipeline to strip them. The import errors disappeared.

Convert text to hex now, free, instant, browser-based


How to use ToolHQ's text to hex converter

Text to hex:

  1. Open https://www.toolhq.app/tools/text-to-hex.
  2. Paste or type your text in the input field. Multi-line text is supported.
  3. Choose your output format: spaced (e.g., 48 65 6C 6C 6F) or compact (e.g., 48656C6C6F).
  4. The hex output appears immediately.
  5. Copy the hex string for use in your tool, script, or analysis.

Hex to text:

  1. Switch to the decode direction.
  2. Paste hex values, either space-separated or compact.
  3. The tool parses the hex and outputs the corresponding ASCII text.

The converter runs entirely in your browser, no data is sent anywhere. Works for any ASCII text including multi-line content.


Spaced vs. compact hex output

Both formats represent the same data. Spaced hex (41 61 30 20) is easier to read character by character. Compact hex (41613020) is shorter and is the format used in hash outputs, some protocol representations, and code strings.

Choose spaced output when:

  • You are analyzing text character by character
  • You need to match specific bytes visually
  • You are documenting hex values for a team member

Choose compact output when:

  • You are pasting into a code string or configuration value
  • You need to match the output format of a hash or digest tool
  • You are generating test input for a system that expects continuous hex

For binary encoding of the same text (less compact but showing individual bits), the text to binary converter outputs the 8-bit binary for each character. Hex is equivalent but two characters per byte instead of eight.

For URL encoding (the %20 style used in web addresses), the URL encoder decoder handles that format. For cryptographic hashes (MD5, SHA-1, SHA-256 in hex), the hash generator produces one-way hex digest outputs.

Kai, a penetration tester, was analyzing a web application that was returning suspicious responses. The response body looked like garbled text. He pasted it into ToolHQ's text to hex converter to see the raw byte values. He spotted a sequence of hex values that matched a known XOR obfuscation pattern. He decoded the original bytes and identified the obfuscated payload. The hex view made the structure visible in seconds.


Hex encoding and character sets

Standard text to hex conversion uses ASCII values for the 128 standard characters (hex 00-7F). For characters outside ASCII (accented letters, emoji, non-Latin scripts), the hex values depend on the encoding:

  • ASCII (7-bit): Characters 00-7F. Only covers standard English characters.
  • Latin-1 (ISO-8859-1): Characters 00-FF. Adds accented European characters in 80-FF range.
  • UTF-8: Variable-length encoding. ASCII characters use one byte (same hex values). Accented characters use two bytes (e.g., é is C3 A9). Emoji use three or four bytes.

When you hex-encode café in UTF-8, you get 63 61 66 C3 A9, the ASCII chars c, a, f as single bytes, then é as the two-byte sequence C3 A9.

ToolHQ's converter uses UTF-8 by default, which handles the full Unicode character set correctly.


Frequently asked questions

What is the hex value for the letter A?

Uppercase A is decimal 65, which is 41 in hexadecimal. Lowercase a is decimal 97, which is 61 in hex. The difference of 20 in hex equals decimal 32, which is the ASCII case offset.

How do I convert a single hex value back to a character?

Take the hex value (e.g., 4A), convert it to decimal (J = 74), then look up the ASCII character. In decimal: 4×16 + 10 = 64 + 10 = 74 = J.

What is the difference between text to hex and text to binary?

Both encode characters using their ASCII values. Hex uses base 16 (0-9, A-F), two characters per byte. Binary uses base 2 (0 and 1), eight characters per byte. Hex is more compact and is the standard format in most technical tools.

Does text to hex support emoji?

Yes, when using UTF-8 encoding. Emoji require three or four bytes, so they produce six or eight hex characters per emoji rather than two.

Why does my hash output look like hex but I cannot decode it to text?

Hash functions (MD5, SHA-256) produce fixed-length hex strings, but they are one-way digests, you cannot reverse a hash to recover the original input. The hex format of a hash output looks like encoded text but represents a completely different value.


The short version

Hexadecimal encoding maps each text character to exactly two hex digits using its ASCII value. A=41, a=61, 0=30, space=20. Hex is the standard format for representing binary data in debugging tools, security research, color codes, and hash outputs.

ToolHQ's text to hex converter handles both directions in your browser, supports multi-line text, and lets you choose spaced or compact output. No data is sent anywhere.

For the binary equivalent (8 bits instead of 2 hex chars per byte), use the text to binary converter. For the number base system itself, the number base converter converts between binary, octal, decimal, and hex.

Convert text to hex free, browser-based, instant at ToolHQ