Text to Hex Converter

Text to hex converter — turn any string into hexadecimal bytes (UTF-8), free online.

About

About the Text to Hex Converter

Type or paste any text and see the exact bytes it's stored as, written in hexadecimal. Each byte becomes a two-digit hex value from 00 to ff, so you can compare strings byte for byte, spot hidden whitespace or invisible characters, or copy the hex straight into code, a packet or a hex editor.

A byte holds a value from 0 to 255, which in hexadecimal is exactly two digits, 00 to ff — that's why hex editors, network tools and debuggers all show raw data in hex. Seeing text as hex answers questions the text itself hides: is that a normal space (20) or a non-breaking space (c2 a0)? Does the line end in a Unix newline (0a) or a Windows one (0d 0a)? Is there a byte order mark (ef bb bf) at the start? Plain English characters match the classic ASCII table — A is 41, a is 61 — while everything else is encoded as UTF-8, the encoding used by the web.

Choose what to view about this tool

Guide

Using the Text to Hex Converter

  1. 1

    Step 1

    Type or paste your text into the Text box — Hexadecimal is already selected as the byte format.

  2. 2

    Step 2

    Click "Convert to hex" to encode it, entirely in your browser.

  3. 3

    Step 3

    Each byte appears as two lowercase hex digits, separated by a space.

  4. 4

    Step 4

    Copy the hex, or paste hex into the box and click "Hex to text" to go the other way.

  • Converts any text or string into hexadecimal bytes in one click
  • Shows every byte as two lowercase hex digits, separated by spaces
  • Encodes as UTF-8, so é, €, Chinese characters and emoji give their real multi-byte values
  • Reveals invisible characters — spaces (20), tabs (09), new lines (0a) and non-breaking spaces (c2 a0)
  • Decodes hex back into text in the same box, with or without spaces or 0x prefixes
  • Runs entirely in your browser, so nothing you type is uploaded
  • Free, with no sign-up and no limit on how much text you convert

Developers

Developers use it to get the exact bytes of a string for a test fixture, a byte array or a protocol message.

Debugging encodings

Anyone chasing a mojibake or whitespace bug uses it to see which bytes a string really contains.

Security and CTF work

Security researchers and CTF players use it to build hex payloads and compare them byte for byte.

Students

Students use it to see how UTF-8 turns characters into one, two, three or four bytes.

More text and byte conversions

Examples

Text to Hex Converter examples

4 worked examples

01

A single word

"Code" converts to 43 6f 64 65 — a capital C is 43 and the lowercase letters fall in the 61–7a range.

02

Spaces are bytes too

"A B" converts to 41 20 42 — the space in the middle is the byte 20.

03

A non-ASCII character

"ñ" converts to c3 b1 — two bytes, because UTF-8 needs more than one byte for anything outside basic ASCII.

04

Digits as text

The text "2026" converts to 32 30 32 36 — the characters 0–9 are bytes 30–39, not the numbers themselves.

FAQ

Frequently asked questions

Quick answers to common questions about the Text to Hex Converter.

How do I convert text to hex?

Type your text above and click "Convert to hex". The text is encoded as UTF-8 and every byte is shown as a two-digit hexadecimal value, all inside your browser.

What is "Hello" in hex?

48 65 6c 6c 6f — one byte each for H, e, l, l and o.

Is the output uppercase or lowercase?

Lowercase, for example 6c rather than 6C. Hex digits are case-insensitive, so either form means the same value, and the Hex to text side accepts both.

Can I get the hex without spaces, or with a 0x prefix?

The output is always space-separated two-digit bytes. To remove the spaces, paste the result into any find-and-replace; going the other way, the hex to text converter accepts unspaced hex and 0x or \x prefixes.

Why does one character turn into several hex bytes?

Characters outside basic ASCII need more than one byte in UTF-8. é is c3 a9, € is e2 82 ac and most emoji take four bytes, so the hex output can be longer than the text.

Is text to hex the same as decimal to hex?

No. Text to hex encodes characters into their byte values. If you have a number, like 255, and want its hex form (ff), use the decimal to hex converter instead.

Is this the same as hex encoding or Base16?

Yes. Hex encoding and Base16 both mean writing each byte as two hexadecimal digits, which is exactly what this converter produces, just with a space between bytes for readability.

Does it show spaces and line breaks?

Yes. Every character is encoded, including invisible ones: a space is 20, a tab is 09 and a new line is 0a, which makes it easy to find stray whitespace.

Is my text uploaded anywhere?

No. The conversion runs entirely on your device, and nothing you type is sent to a server. It's free, with no sign-up and no limit on use.

Still have a question? Contact us

Report a problem

Text to Hex Converter

What went wrong?
    or paste a screenshot