Convert text to and from hexadecimal, binary and decimal byte sequences with correct UTF-8 handling, and cross-convert plain numbers between decimal, hex, octal and binary. Useful whenever you are reading a packet capture, a memory dump or a file signature.

How to use it

  • Enter text to see its bytes in hex, binary and decimal, or paste bytes to recover the text.
  • Switch to number mode to convert a single value between bases.
  • Copy any representation directly.

Text is bytes, and the encoding decides which

There is no such thing as plain text in memory, only bytes plus an agreed interpretation. This converter uses UTF-8, the encoding of the modern web. In UTF-8 the ASCII range maps to a single byte, so the letter A is 0x41, but anything beyond it uses two to four bytes. An accented Latin letter takes two, most CJK characters take three, and emoji take four. That is why a five-character string can produce twenty hex bytes, and why counting characters is not the same as counting bytes when validating length limits.

Hex is the usual way to display bytes because two hex digits map exactly to one byte, making the boundaries visually obvious. Binary shows the individual bits, which matters when you are masking flags or reading a protocol header field by field. Decimal byte values appear in older tooling and in some shellcode formats.

Where base conversion actually shows up

File type identification relies on magic bytes at the start of a file: 25 50 44 46 is PDF, 89 50 4E 47 is PNG, 4D 5A is a Windows executable. An attacker renaming a file does not change these, which is why hex inspection beats trusting an extension. Octal survives mainly in Unix file permissions, where 755 encodes three sets of read, write and execute bits. Hex dominates in memory addresses, colour codes and network protocol documentation because it aligns neatly with byte and nibble boundaries.

When reading bytes from a capture, remember that multi-byte integers have an endianness. Network protocols use big-endian, most x86 tooling shows little-endian, and a value that looks nonsensical is often simply byte-reversed. All conversion here happens inside your browser, so sample data from an investigation is never uploaded.

Frequently asked questions

Why does one character produce several bytes?

Because UTF-8 is variable width. Only the ASCII range fits in a single byte; everything else needs two, three or four. If you need a character count use the text length, and if you need a storage or transport limit use the byte count shown here.

My hex will not decode back to text. What went wrong?

Usually the byte sequence is not valid UTF-8, either because it is binary data such as an image fragment rather than text, or because bytes were dropped or reordered. An odd number of hex digits will also fail, since each byte needs exactly two.

Is my data uploaded for conversion?

No. Everything is computed locally in your browser, so nothing you paste leaves the machine.

Related tools: Base64 Encoder / Decoder, Classic Cipher Toolkit, Hash Analyzer.