• EasyStackTools191+ Free Tools
    • Color Converter
    • Cron Expression Reader
    • CSV to JSON
    • JSON to CSV
    • YAML to JSON
    • Hex ↔ Text
    • Wei ↔ Gwei ↔ ETH
    • Hex ↔ Decimal
  1. Home
  2. Converters
  3. Hex ↔ Text

Hex ↔ Text

Decode hex to text or encode text to hex (UTF-8). A simple Ethereum log & calldata decoder tool for EVM developers. Fast, client-side processing.

Read the guide

Format: 0x followed by hexadecimal characters (even length)

Understanding Hex and Text Encoding

Hexadecimal encoding is fundamental to Ethereum development. Every piece of data on the blockchain is ultimately stored as hex: calldata, logs, contract storage, and event parameters. Understanding how to convert between hex and human-readable text is essential for debugging and development.

What is Hex Encoding?

Hexadecimal (base-16) uses digits 0-9 and letters a-f to represent data. Each hex pair represents one byte of data.

"H" = 0x48
"e" = 0x65
"l" = 0x6c
"l" = 0x6c
"o" = 0x6f

Why Use Hex in EVM?

  • •Compact: Represents binary data efficiently
  • •Universal: Standard in blockchain and cryptography
  • •Machine-friendly: Easy for computers to process
  • •Predictable: Consistent encoding across platforms

Solidity Example

Common patterns for encoding/decoding in smart contracts:

// Encode text to hex (UTF-8 bytes)
string memory text = "Hello";
bytes memory encoded = bytes(text);
// Produces: 0x48656c6c6f

// Decode hex back to text
bytes memory data = hex"48656c6c6f";
string memory decoded = string(data);
// Produces: "Hello"

// Common with function calls
bytes memory calldata = abi.encodeWithSignature(
  "transfer(address,uint256)",
  recipient,
  amount
);

Hex → Text Use Cases

  • Decoding transaction calldata
  • Reading event log data
  • Extracting text from contract storage
  • Debugging token metadata (name, symbol)
  • Analyzing raw contract interactions

Text → Hex Use Cases

  • Encoding function parameters
  • Creating input data for contract calls
  • Constructing transaction calldata
  • Preparing data for hashing
  • Testing Solidity contract behavior

UTF-8 Standard

This tool uses UTF-8 encoding, the universal standard for encoding text. Most characters (ASCII range) are 1 byte, but special characters may use 2-4 bytes. When decoding hex, UTF-8 ensures proper character representation for all supported languages and symbols.

Frequently Asked Questions

Hex encoding represents binary data as hexadecimal (base-16) strings. Ethereum uses hex for calldata, logs, and storage.

Related Tools

  • Keccak256 Hasher

    Generate keccak256 hash online instantly. Solidity compatible hashing for Ethereum smart contract development. UTF-8 text and hex input modes.

  • Hex ↔ Decimal

    Convert between hexadecimal values and decimal uint256-style integers. Perfect for decoding Ethereum calldata, logs, and on-chain uint256 values.

  • ABI Encoder & Decoder

    Encode function calls into ABI format or decode ABI-encoded data back into human-readable form. Essential for Ethereum smart contract development.

  • Color Converter

    Convert colors between HEX, RGB, HSL, and CMYK formats. Color picker with preview.