Hex converter

5 of 2 ratings
Hex converter

Hex converter is a free tool that converts text into hexadecimal byte values and converts valid hexadecimal back into text.

What is hexadecimal and how does it work?

Hexadecimal is a base-16 number system that uses the digits 0 to 9 and the letters A to F. Each hexadecimal digit represents four binary bits, so two hexadecimal digits can represent one byte from 00 to FF.

Hex is easier to read than a long binary sequence while preserving the exact byte value. The letters may be written in upper or lower case without changing their meaning.

Decimal Hexadecimal Binary
0 00 00000000
10 0A 00001010
32 20 00100000
65 41 01000001
255 FF 11111111
Diagram showing text passing through the Hex converter in both directions

How do I convert text to hexadecimal and back?

Use To hex for ordinary text and To text for a sequence of hexadecimal byte pairs. The tool uses PHP's bin2hex and hex2bin functions on the server.

  1. For text conversion, enter the characters in To hex and read the returned Hex value.
  2. For reverse conversion, enter valid hexadecimal in To text. Use two hexadecimal digits for every byte. The decoded text is returned in the Hex result field.
The Hex converter tool on digily.link, showing its input form

As a small worked example, the text Hi contains the ASCII bytes 48 and 69 in hexadecimal, so its output is 4869. Reversing 4869 produces Hi.

Spaces and punctuation are converted like any other byte. Numbers entered as text are treated as digit characters, rather than as decimal values to be recalculated. Accented and non-Latin characters may use several bytes because their hexadecimal representation depends on the character encoding, commonly UTF-8 for web text.

Where is hexadecimal used in practice?

Hexadecimal is used wherever people need a compact, byte-aligned view of binary data. Common examples include:

  • Programming, including byte arrays, memory addresses, debugging output and Unicode code point notation.
  • Networking, where tools such as Wireshark display packet bytes and protocol fields in hex.
  • Electronics, including microcontroller registers, firmware images and hardware addresses.
  • Education, particularly exercises involving binary, decimal, character encodings and computer memory.
  • Radio, where protocol frames, configuration words and received data may be inspected as hexadecimal bytes.

Hexadecimal is also familiar from colour notation such as #336699, although a text-to-hex conversion is not a colour picker. For direct conversions between number bases, a Binary converter or Decimal converter is usually the clearer choice.

Example result produced by the Hex converter tool

Conversion details and common errors

Text conversion works on bytes, not on the visual shape or meaning of a character. PHP's bin2hex function returns two lower-case hexadecimal digits for each input byte. An empty byte string therefore has an empty hexadecimal representation.

Reverse conversion requires valid hexadecimal digits in complete pairs. An odd-length value has half a byte left over, while spaces, punctuation and prefixes such as 0x are not part of a raw byte sequence. Remove such formatting before conversion.

A common manual-conversion mistake is dropping a leading zero. Decimal 10 is one byte written as 0A, not simply A, when it appears in a byte sequence. Losing that zero shifts the grouping of every following pair and can make the whole value invalid.

Very long hexadecimal output may also be less practical to inspect in a browser. This hexadecimal byte converter does not identify file formats, repair corrupted bytes or determine which character encoding an unknown sequence uses.

Frequently asked questions

Is hexadecimal a form of encryption?

No. Hexadecimal is a reversible representation of data and provides no secrecy. Anyone with the hex value can convert it back to the original bytes, so it should not be used to conceal passwords, tokens or personal information.

Does upper-case or lower-case hex make a difference?

No. Values such as 4A and 4a represent the same byte. Letter case may matter to a surrounding system's formatting rules, but it does not change the hexadecimal value itself.

Can hexadecimal contain spaces between bytes?

Human-readable hex dumps often include spaces, line numbers or ASCII columns, but these are presentation aids rather than hexadecimal data. PHP's hex2bin function expects a continuous sequence of byte pairs, so remove separators and labels first.

Will converting binary files produce readable text?

Usually not. Images, compressed archives and executable files contain arbitrary byte values that do not necessarily map to printable characters. A hex editor or file-format analyser is more suitable when structure and byte offsets need to be preserved.

Does the conversion happen in my browser?

No. The input travels to the server over HTTPS, where the conversion is performed, and it is not stored. Avoid submitting secrets as text or hexadecimal input when server-side processing is unsuitable for the data concerned.

Similar Tools

Binary converter

Convert text to binary and vice versa with our binary converter tool for efficient data encoding and decoding.

4,969
39
ASCII converter

Easily convert text to ASCII and back with our ASCII converter tool for efficient data handling.

5,073
59
Decimal converter

Convert text to decimal and back with our decimal converter tool for precise data conversion.

5,016
53

Popular Tools