Loading Techie Utils…

Text to Hex Converter

Convert text into hexadecimal bytes, with a hex dump. Free, and runs entirely in your browser — nothing you enter is uploaded, stored or sent to a server.

About Hex and Text Converter

Hexadecimal is how bytes are written down when they have to be read by a person: two characters per byte, no ambiguity, and a form that survives being pasted into a ticket. This converts text to it and back, and shows the dump alongside.

The part that trips people is that text is not bytes until you say which encoding. Everything here is UTF-8, which is what files and networks carry, and it is why the character count and the byte count disagree the moment anything outside ASCII appears — é is one character and two bytes, and an emoji is one character and four.

Decoding is where the honest answer matters. Hex very often carries something that was never text — a key, a hash, a packet, a compressed block — and a decoder that quietly substitutes replacement characters makes a wrong answer look like a right one. When the bytes are not valid UTF-8 this says so and shows the dump instead.

Where it helps

  • Reads hex in whatever shape you have it — spaced, run together, comma separated or 0x-prefixed — without needing it tidied first.
  • Writes it in the four forms people actually need, including the 0x-and-comma form that pastes into source code.
  • Shows a dump with offsets and the printable column, which is how the same bytes look in a debugger.
  • Says plainly when decoded bytes are not valid UTF-8 rather than quietly filling the gaps with replacement characters.
  • Counts characters and bytes separately, which is where most UTF-8 surprises come from.

Limits

  • UTF-8 only. Text encoded as UTF-16 or a legacy code page will decode into something wrong rather than being detected.
  • Meant for text and small byte strings; it is not a file hex editor and everything is held in memory.
  • A hex string with an odd number of digits cannot be bytes and is refused rather than padded.

Frequently asked questions

Why are there more bytes than characters?

Because the text is encoded as UTF-8, where only ASCII is one byte per character. Accented letters take two, most CJK characters take three, and emoji take four. The row counts show both numbers for exactly this reason.

Does the separator matter when decoding?

No. Spaces, commas, newlines and 0x prefixes are all ignored on the way in, so hex copied out of a log, a packet capture or a source file can be pasted as it is.

The decoded text is full of question marks. What went wrong?

Most likely nothing — those bytes were probably never text. Hex commonly carries keys, hashes, compressed data or binary protocol frames. The note says when the bytes are not valid UTF-8, and the dump shows what they actually are.

Related tools

  • Base64 — Encode or decode UTF-8 text and URL-safe Base64
  • Number Base Converter — Binary, octal, decimal and hexadecimal, with the bits explained
  • File Checksum — Verify a download, and work out which algorithm made the checksum
  • Unicode Inspector — Analyse every character: category, script, block and encoding
  • Base32 — Encode or decode Base32 in the RFC 4648, extended hex and Crockford alphabets
  • Base58 — Encode or decode Base58, and verify the Base58Check checksum an address carries

More Encoders & Decoders tools

  • Base64 — Encode or decode UTF-8 text and URL-safe Base64
  • Base32 — Encode or decode Base32 in the RFC 4648, extended hex and Crockford alphabets
  • Base58 — Encode or decode Base58, and verify the Base58Check checksum an address carries
  • URL Encoder — Percent-encode components or whole URLs
  • HTML Entities — Escape and unescape HTML entities
  • JWT — Read, verify and sign JSON Web Tokens
  • Punycode — Convert internationalised domain names to and from their ASCII form
  • Unicode Converter — Escape, unescape and inspect code points
  • Unicode Inspector — Analyse every character: category, script, block and encoding
  • Number Base Converter — Binary, octal, decimal and hexadecimal, with the bits explained
  • Hex and Text Converter — Text to hexadecimal bytes and back, with a dump
  • Gzip Compressor and Decompressor — Compress and expand gzip, zlib and raw deflate