Back to Tools

Text to Hex

Convert text into hexadecimal representation (Base16)

0
0 Bytes
Source Text Input

What is Text to Hex?

Hexadecimal is how developers read raw bytes without going cross-eyed. The Text to Hex encoder translates your text into its byte values in hex — "Hi" becomes "48 69". Each byte appears as exactly two hex digits, so the output length always tells you the true encoded size of your text.

Hex output slots directly into the places developers work: pasting byte sequences into code as arrays, comparing what an encoder produced against a spec, writing test fixtures for binary protocols, or documenting exactly which bytes travel over the wire. It is the bridge between human-readable text and machine-readable data.

How to use

  1. Enter the text you want converted to hexadecimal in the input area.
  2. The text is read as UTF-8 bytes first. Plain ASCII characters produce one byte each; accented characters and emoji produce the two to four bytes UTF-8 requires.
  3. Click convert. Every byte renders as two hex digits, separated by spaces — "48 69" rather than "4869" — so bytes stay visually distinct.
  4. Copy the hex for your source code, documentation, or protocol analyzer.

Common use cases

  • Building byte arrays: Firmware and systems code often needs data as hex literals (0x48, 0x69). Generate the exact sequence instead of converting by hand.
  • Verifying encoders: After writing a UTF-8 encoder, compare its output byte-for-byte against this tool to catch encoding bugs immediately.
  • Protocol test data: Network test harnesses accept hex payloads. Convert your sample messages to craft precise packets.
  • Teaching encodings: Showing that "é" becomes two bytes (C3 A9) while "e" is one (65) makes variable-length encoding click for students.

Example

Input:  Hex!
Output: 48 65 78 21

FAQs

Why does "é" produce two hex pairs?

Because UTF-8 encodes it as two bytes: C3 A9. Characters outside ASCII need multi-byte sequences, and the tool shows every byte honestly. That is also why the output is the authoritative answer to "how many bytes is this string".

Uppercase or lowercase hex?

The tool emits uppercase digits (48 69), the convention in most specs and debuggers. Hex is case-insensitive everywhere it matters, so lowercase consumers accept this output without conversion.

Can I get the output without spaces?

Remove them with find-and-replace to produce a continuous string like "48657821". The spaced form is the default because it keeps byte boundaries visible at a glance.

How do I convert back to text?

Use the Hex to Text tool with the same output. Since the encoding here is standard UTF-8, decoding restores your original characters exactly — including multi-byte ones.


Frequently Asked Questions

What does the Text to Hex Converter do?
It converts plain text into hexadecimal (Hex) format instantly.
Why is hexadecimal used in computing?
Hexadecimal is used for compact representation of binary data in programming and systems.
Can I convert long text into hex?
Yes, the tool supports both short and long text inputs.
Does it support special characters?
Yes, all letters, numbers, and symbols are accurately converted into hex values.
Is this tool free to use?
Yes, it is completely free with unlimited usage.
Can I use it on mobile devices?
Yes, it works smoothly on smartphones, tablets, and desktops.
Is my data stored after conversion?
Your input is processed in real-time within the browser and is not stored anywhere.
Support Chat
We typically reply within minutes

Hello! 👋 Before we start, please tell us your name.