Hex Encoder

Convert text and data to hexadecimal — paste, encode, and copy instantly.

Input Text
Output Hex
Hex output will appear here...
info

About Hex Encoder

Hex Encoder is a free online tool that converts text, binary, decimal, or Base64 data into hexadecimal (base-16) representation. Each byte of your input is expressed as a two-digit hex value using the digits 0-9 and letters A-F. The result is a compact, unambiguous notation used everywhere from network packet dumps and memory debuggers to color codes and cryptographic key material.

The tool accepts four input types: plain UTF-8 text (each character is encoded to its UTF-8 byte sequence), space-separated binary groups (e.g., 01001000 01100101), space-separated decimal byte values (0-255), and standard Base64 strings. Output can be formatted as a plain continuous hex string, 0x-prefixed pairs, space-separated pairs, or colon-separated pairs — matching whatever format your target system or specification requires. You can also switch between lowercase and uppercase hex digits with a single click.

Every conversion runs entirely in your browser with no server calls. Your data — whether it is source code, API keys, binary payloads, or any other sensitive content — never leaves your machine. There are no file-size limits, no account requirements, and no cost.

star

Key Features

check_circle

Four input types in one tool

Switch between Text (UTF-8), Binary (space-separated 8-bit groups), Decimal (byte values 0-255), and Base64 without leaving the page or copying data to a separate converter.

check_circle

Four output formats

Generate plain hex (48656c6c6f), 0x-prefixed (0x48 0x65 0x6c), spaced (48 65 6c), or colon-separated (48:65:6c) notation to match the convention your codebase, protocol, or tool expects.

check_circle

Uppercase and lowercase toggle

Switch hex digits between lowercase (a-f) and uppercase (A-F) instantly. Some systems and style guides require a specific case; this option removes the need for a post-processing step.

check_circle

Accurate UTF-8 byte encoding

Text input is encoded through the browser TextEncoder API, so multi-byte characters such as accented letters, emoji, and CJK scripts are encoded to the correct UTF-8 byte sequence rather than guessed.

check_circle

Client-side and private

Encoding runs in the browser with no network requests. Paste API secrets, tokens, or internal data without risk of it being logged or intercepted on a server.

check_circle

One-click copy and clear

Copy the hex output to the clipboard instantly or clear both panes with a single button — no keyboard shortcuts to memorize.

help

How to Use

01

Enter Data

Type or paste your text, binary, decimal, or Base64 data into the input area.

02

Choose Format

Select input type, output format (plain, 0x prefixed, spaced, colon-separated), and case preference.

03

Encode & Copy

Click "Encode" to convert to hexadecimal, then copy the result.

code_blocks

Example

Plain UTF-8 text is encoded byte-by-byte into hex pairs. "Hello" has five ASCII characters, so the output is five two-digit hex values.

Text input
Hello
Plain hex output
48656c6c6f
lightbulb

Common Use Cases

  • arrow_circle_right

    Inspecting byte sequences in protocols

    When writing or debugging a network protocol, binary file format, or firmware image, you need to see the exact byte values of your strings. Paste the relevant text and check the hex output against the specification without firing up a hex editor or debugger.

  • arrow_circle_right

    Embedding data literals in source code

    Languages like C, Python, and Go let you write byte literals as hex (e.g., \x48\x65\x6c). Paste a string or a Base64-encoded blob and copy the spaced or 0x-prefixed output directly into your array or buffer initializer.

  • arrow_circle_right

    Verifying encoding of non-ASCII text

    UTF-8 encodes characters outside ASCII as multi-byte sequences. Use this tool to confirm that an accented character, emoji, or CJK glyph produces the byte sequence your parser expects, without guessing from a code-point table.

  • arrow_circle_right

    Converting decimal byte arrays to hex

    Cryptographic libraries and packet-analysis tools sometimes output decimal byte lists. Paste the space-separated decimal values (e.g., "72 101 108") and get the equivalent hex notation for use in scripts, documentation, or comparisons.

  • arrow_circle_right

    Cross-checking Base64 payloads at the byte level

    JWT headers, certificate fingerprints, and binary attachments often travel as Base64. Select the Base64 input type, paste the encoded string, and read the underlying hex bytes to verify checksums or spot unexpected byte values.

quiz

Frequently Asked Questions

What is Hex Encoder? expand_more
Hex Encoder is a free online tool that converts data into hexadecimal (base-16) representation. Each byte of input is expressed as a two-character hex value (00-FF). For example, the letter "A" (ASCII 65) becomes "41" in hex. It is commonly used in programming, networking, and data analysis.
What input types are supported? expand_more
The tool supports four input types: Text (plain UTF-8 text), Binary (space-separated 8-bit binary strings like "01001000"), Decimal (space-separated byte values 0-255 like "72 101"), and Base64 (standard Base64-encoded strings like "SGVsbG8="). Select the matching input type from the dropdown before encoding.
What output formats are available? expand_more
You can choose from four output formats: Plain Hex (continuous string like "48656c6c6f"), 0x Prefixed (each byte prefixed like "0x48 0x65"), Spaced Hex (bytes separated by spaces like "48 65 6c"), and Colon Separated (bytes joined by colons like "48:65:6c"). You can also toggle between lowercase and uppercase hex digits.
Is my data secure? expand_more
Yes. All encoding happens entirely in your browser using JavaScript. No data is sent to any server, so your input remains completely private and secure. You can even use the tool offline once the page has loaded.
How does Hex Encoder differ from Hex Decoder? expand_more
Hex Encoder converts human-readable or binary data into hexadecimal — it is the forward direction. Hex Decoder does the reverse: it takes a hex string and gives you back the original text or bytes. Use Hex Encoder when you have raw data and need the hex representation; use Hex Decoder when you already have a hex string and want to read or verify its contents.
How does this differ from Binary Encoder? expand_more
Binary Encoder converts data into base-2 (0s and 1s) notation, where each byte becomes eight bits. Hex Encoder uses base-16 instead, where each byte becomes two hex digits. Hex is more compact — a 64-byte value is 128 hex characters versus 512 binary characters — and is the standard notation in most developer tools, debuggers, and protocol specifications.
How does multi-byte UTF-8 text encode to hex? expand_more
The tool uses the browser TextEncoder API, which converts each character to its UTF-8 byte sequence before forming hex pairs. An ASCII letter like "H" (code point 72) produces one byte, "48" in hex. A two-byte character like "é" (code point 233) produces two bytes: "c3 a9" in spaced hex. This matches what your server, file system, or network stack will actually process.
Can I encode binary files or arbitrary byte arrays? expand_more
Not via direct file upload — the tool works with typed or pasted text input. For arbitrary byte arrays, use the Decimal input type and paste the byte values as space-separated integers (0-255), or encode the file as Base64 first and use the Base64 input type to convert it to hex.