# Hex to String Converter

Convert text to and from hexadecimal strings with flexible spacing, prefix (0x/\x/U+), and case options

> Canonical page: https://elysiatools.com/en/tools/hex-to-string

- **Category:** Format Conversion

- **Keywords:** hex, hexadecimal, string, encode, decode, bytes, ascii, utf-8, hex to string

## Overview

The Hex to String Converter is a versatile utility that allows you to seamlessly encode plain text into hexadecimal format or decode hex strings back into readable text. Supporting UTF-8, ASCII, and Latin-1 encodings, the tool offers customizable formatting options including custom prefixes (like 0x or \x), letter casing, and space separators to match your exact data requirements.

## Inputs

- **Input** (textarea): Enter text or hex string (e.g. 48 65 6c 6c 6f)...
- **Operation** (select)
- **Encoding** (select)
- **Prefix (encode only)** (select)
- **Letter Case (encode only)** (select)
- **Separator (encode only)** (select)

## When to use

- When analyzing raw network packets, binary payloads, or log files containing hexadecimal representations of text.
- When formatting text data into hex arrays for programming languages, microcontrollers, or database queries.
- When decoding obfuscated hex strings back into readable UTF-8, ASCII, or Latin-1 text.

## How it works

- Input your text or hexadecimal string into the input field.
- Select the operation (Text to Hex or Hex to Text) and choose your target encoding (UTF-8, ASCII, or Latin-1).
- Configure formatting preferences such as prefixes (0x, \x, U+), letter case, and separators if you are encoding text.
- The tool instantly processes the input and displays the converted output.

## Use cases

- Debugging embedded systems by converting raw hex sensor outputs into readable ASCII text.
- Formatting payload strings into hex format with '0x' prefixes for smart contract development or assembly code.
- Decoding URL-encoded or hex-escaped characters found in web server logs or database records.

## Frequently asked questions

### Can I decode hex strings that contain prefixes like '0x' or '\x'?

Yes, the decoder automatically handles common prefixes and spaces when converting hex back to text.

### Which character encodings are supported?

The converter supports UTF-8, ASCII, and Latin-1 (ISO 8859-1) encodings.

### How do I format the hex output for C-style arrays?

Set the operation to 'Text to Hex', choose the '\x' or '0x' prefix, and set the separator to space or none.

### Does the tool support uppercase hex characters?

Yes, you can choose between lowercase (a-f) and uppercase (A-F) outputs when encoding text.

### Can I convert non-English characters?

Yes, by selecting the UTF-8 encoding option, you can convert Unicode characters and emojis to and from hex.

## Related tools

- [ASCII85 Converter](https://elysiatools.com/en/tools/ascii85-converter): Encode and decode text to/from ASCII85 format (Adobe version)
- [Base32 Converter](https://elysiatools.com/en/tools/base32-converter): Encode and decode text to/from Base32 format with multiple variants
- [Base45 Converter](https://elysiatools.com/en/tools/base45-converter): Encode and decode text to/from Base45 format (RFC 9285)
- [Base58 Converter](https://elysiatools.com/en/tools/base58-converter): Encode and decode text to/from Base58 format with Bitcoin and Ripple variants
- [Base62 Converter](https://elysiatools.com/en/tools/base62-converter): Encode and decode text to/from Base62 format (0-9, A-Z, a-z)
- [Base64 Converter](https://elysiatools.com/en/tools/base64-converter): Encode and decode data to/from Base64 format with URL-safe options
- [Base91 Converter](https://elysiatools.com/en/tools/base91-converter): Encode and decode text to/from Base91 format (ascii+basE91 algorithm)
- [Braille Converter](https://elysiatools.com/en/tools/braille-converter): Convert text to Braille Unicode characters or decode Braille to text

## Samples

- [Hex/Unicode Encoding Format Samples](https://elysiatools.com/en/samples/text-hex-unicode-formats): Examples of hex (\xXX) and unicode (\uXXXX) escape sequence encoding formats
- [Android String Processing Java Samples](https://elysiatools.com/en/samples/android-string-processing-java): Android Java string processing examples including string split and join, regular expressions, and string replacement
- [Android String Processing Kotlin Samples](https://elysiatools.com/en/samples/android-string-processing-kotlin): Android Kotlin string processing examples including string split and join, regular expressions, and string replacement
- [macOS String Processing Objective-C Samples](https://elysiatools.com/en/samples/macos-string-processing-objectivec): macOS Objective-C string processing examples including NSString, NSMutableString, searching, regex, and encoding

## Related content

- [Binary Encoding, File Forensics, and Integrity Tools](https://elysiatools.com/en/hubs/binary-encoding-file-forensics-integrity): Inspect raw bytes, convert radix and text encodings, identify file signatures, measure entropy, and verify hashes or checksums in one practical binary-data workflow.
- [Base, Radix, and Hex Text Encoding Tools](https://elysiatools.com/en/hubs/base-radix-and-hex-encoding-tools): Encode and decode text and bytes across Base32/45/58/62/64URL/Base85/Z85, arbitrary radix (2–36), and hex, plus URL, HTML-entity, and Unicode escape conversion — for JWTs, blockchain IDs, data URLs, and binary inspection.
- [Text Case, Encoding, and Normalization Conversion Tools](https://elysiatools.com/en/hubs/text-convert): Compare text case conversion, character-width conversion, encoding conversion, quoted-printable handling, and inline text normalization tools in one hub.
- [Text Tools](https://elysiatools.com/en/hubs/text-utility): Explore 33 text tools for utility workflows and compare closely related utilities quickly.
