Hex Encoder & Decoder
Convert text to its hexadecimal byte representation, or decode hex back to text. Useful for debugging encodings, binary data and low-level protocols.
About this tool
Convert text to its hexadecimal byte representation, or decode hex back to text. Useful for debugging encodings, binary data and low-level protocols.
Example
Input: Hi
Output: 48 69
Privacy
This tool runs entirely in your browser. Your data is processed locally and never uploaded to a server.
How to use this tool
- Type or paste the text you want to convert into the input box.
- Choose whether you want to encode text to hex or decode hex back to text.
- Check the result shown by the tool and copy it if you need it elsewhere.
- If decoding, make sure the hex string is valid and formatted the way the tool expects.
Step by step, what happens
- The tool reads your input as either plain text or hexadecimal, depending on the selected direction.
- If encoding, it converts the text into its UTF-8 bytes and shows each byte as hex pairs.
- If decoding, it reads the hex pairs, turns them back into bytes, then interprets those bytes as UTF-8 text.
- Any invalid hex characters, odd-length input, or unsupported byte sequences are surfaced as decode issues so you can fix the input.
Worked example
Here is a simple example where you encode a short greeting and then decode it back.
Input: Hello
- You enter Hello in the text input and choose the encode direction.
- The tool converts each UTF-8 byte into hexadecimal and shows the result.
- If you later paste that hex back into decode mode, it converts back to the original text.
Output: 48 65 6c 6c 6f
Tips and common mistakes
- If decoding fails, check that you only used hex characters 0-9 and a-f or A-F.
- Some tools accept spaces between byte pairs, which makes longer hex strings easier to read.
- UTF-8 text with accents or symbols will produce multiple hex bytes for a single visible character.
- If the decoded text looks wrong, the source data may not actually be UTF-8.
Frequently asked questions
What is hexadecimal?
Hexadecimal (base 16) represents each byte as two characters 0-9 and a-f. It is a compact way to view binary data.
Can I paste hex with or without spaces?
Yes, spaces and 0x prefixes are ignored when decoding.
Is it UTF-8 aware?
Yes, multi-byte characters are encoded and decoded using UTF-8.
More Developer Tools Tools
Explore related calculators in this category
Random Hex Generator
Generate random hexadecimal strings of any length. Cryptographically secure, great for tokens and IDs.
URL Encoder / Decoder
Encode or decode URLs and query parameters (percent-encoding) instantly. Free online URL encoder.
.htaccess Generator
Generate common .htaccess rules, force HTTPS, www redirect, and caching, with checkboxes.
API Key Generator
Generate random, secure API keys and tokens with an optional prefix. Cryptographically secure.
You Might Also Like
Popular tools from other categories
1031 Exchange Calculator - Free Online
Free Calculate tax deferral in a 1031 exchange. Step-by-step solutions and formulas included. Fast, accurate, and free, with formula and example.
4% Rule Calculator
Find the retirement nest egg you need using the 4% safe-withdrawal rule.
70% Rule Calculator
Calculate max offer using the 70% rule for flips.
A1C Calculator - Free Online
Free Convert between A1C percentage and estimated average glucose. Step-by-step solutions and formulas included. Simple, fast, and free.
Can't Find the Right Calculator?
Try our AI Math Solver, type any problem in plain English and get instant step-by-step solutions.