Converters

String to Hex Converter

Type any text and get its hexadecimal representation instantly, or paste hex bytes and decode them back to readable text. OpenToolLab's string to hex converter runs entirely in your browser.

100% in-browserNo signupFree forever

Result

What makes this tool different

Encode and decode

Convert text to hexadecimal and hexadecimal back to text in a single tool with instant switching.

Multiple delimiters

Format output with no separator, spaces, 0x prefixes, \x escapes, or percent escapes to match any language.

Case control

Choose lowercase or uppercase hex output to match the conventions of your language or toolchain.

100% in-browser

Encoding happens locally with TextEncoder and the decoded output renders from a byte array — nothing is sent to a server.

About this tool

String to Hex Converter: everything you need to know

Hexadecimal is how computers and developers talk about bytes. Every character in a string is stored as a numeric byte value, and hex is simply that value written in base-16 with digits 0-9 and A-F. Because each byte maps to exactly two hex digits, hex is the most common way to represent text data in low-level code, network protocols, and binary inspection.

OpenToolLab's string to hex converter does the conversion for you in either direction. In Text → Hex mode it takes any UTF-8 string — including emoji and non-Latin scripts — and prints the byte values as hex. In Hex → Text mode it parses a hex byte sequence and decodes it back to readable characters. Both directions run locally in your browser.

The output is fully configurable to match your codebase. Choose no separator for compact strings, spaces for readability, 0x prefixes for C and Python literals, \x escapes for C-style byte strings, or percent escapes for URL encoding. Toggle between lowercase and uppercase to match your language's convention.

Encoding logic uses the standard TextEncoder API and decoding uses TextDecoder over a parsed byte array, so the results are exact and match what you would get from Python's .hex(), JavaScript's Buffer, or any standard library. There are no approximations and no server-side rounding.

Privacy is built into the design. Your text never leaves your browser — encoding and decoding happen locally with no network requests. Open the DevTools Network tab and convert a sensitive string or password hint and you will see zero requests. Nothing is logged, stored, or transmitted.

Because the tool is a static page with no third-party scripts, it loads instantly and works offline. That makes it a dependable companion when you are debugging a protocol, writing a byte parser, or double-checking a hex literal in your code.

OpenToolLab is a completely free string to hex converter with no signup and no premium tier. Whether you are a student learning how text becomes bytes, a developer generating hex strings for an API, or someone decoding a hex dump, this tool gives you the answer instantly — privately and at no cost.

FAQ

String to Hex Converter — frequently asked questions

How to convert a string to hex?

Type or paste your text, then click Convert in the Text → Hex mode. OpenToolLab encodes every character to its UTF-8 byte values and outputs the hexadecimal representation with the delimiter and case you choose.

How to write 'I love you' in hexadecimal?

Using ASCII/UTF-8 bytes, 'I love you' encodes to 49206c6f766520796f75. Each pair of hex digits is one character's byte: 49 = I, 20 = space, 6c = l, and so on.

What is 11111111 in hexadecimal?

The binary value 11111111 equals 255 in decimal, which is FF in hexadecimal. Binary groups of four bits map directly to hex digits: 1111 = F, so 11111111 = FF.

How can I convert text to hexadecimal?

Use a string to hex converter like OpenToolLab. Paste your text, click Convert, and the tool maps each character to its byte value and prints it as hex. It works for ASCII text, emoji, and any UTF-8 string.

How do you say 'hi' in hex?

In hex, 'hi' is 6869 — the byte for 'h' is 0x68 and the byte for 'i' is 0x69. In Python and JavaScript you can write it as 0x68 0x69.

Can you give me an example of a hexadecimal string?

The word 'Hello' in hex is 48656c6c6f. Every character becomes two hex digits: 48 = H, 65 = e, 6c = l, 6c = l, 6f = o.

How to write 42 in hexadecimal?

42 in decimal is 2A in hexadecimal. The decimal number 42 is 2×16 plus 10, and 10 is represented as A in hex, so the result is 0x2A.

How to convert string to hex in C++?

Iterate the string, cast each char to unsigned int, and format with std::hex. For example: std::cout << std::hex << std::uppercase << (int)(unsigned char)c for each character. You can also use a string to hex converter online to check your results.

How to use hex() in Python?

Python's built-in hex() converts an integer to a hex string. For example, hex(255) returns '0xff'. To convert a whole string, encode it to bytes first and format each byte: ''.join(hex(b) for b in 'hi'.encode()) produces '0x68 0x69'.

How to turn hex to string?

Paste your hex bytes into OpenToolLab's Hex → Text mode and click Convert. The tool parses each byte pair and decodes the bytes back to readable text using UTF-8.

How to convert a string into hex in Python?

Use your_string.encode('utf-8').hex(), which returns the hex string directly. For 'hi', that gives '6869'. To decode it back, use bytes.fromhex('6869').decode('utf-8').

What is ASCII A in hex?

The ASCII code for 'A' is 65 in decimal, which is 41 in hex. Similarly, 'a' is 61 hex, '0' is 30 hex, and space is 20 hex.

What is '\n' in hex?

The newline character \n is ASCII 10, which is 0A in hexadecimal. In a hex dump of text files it appears as the byte 0A.