EditSafely

Convert a String to Bytes

Encode a string as its sequence of UTF-8 byte values. Runs entirely in your browser, so your data never leaves your device.

0 chars · 0 lines

Output

The result appears here as you type.

Options

How to use Convert a String to Bytes

  1. 1. Paste the string to encode. Enter the text you want converted to its byte representation into the input pane, from a single character to a full sentence.
  2. 2. Set the separator. Choose the character or string, such as a space or comma, that should sit between each byte value in the output list.
  3. 3. Copy the byte sequence. Copy the resulting sequence of UTF-8 byte values and use it wherever you need the raw numeric representation of the text, such as a test fixture.

When to use Convert a String to Bytes

Convert a String to Bytes encodes a string as its sequence of UTF-8 byte values, separated by a character you choose. It shows exactly what bytes a piece of text turns into once it leaves the realm of human-readable characters.

  • Building a test fixture for a parser. You are writing a unit test for byte-level parsing logic and need the exact UTF-8 byte values of a sample input string to hardcode as expected test data.
  • Understanding multi-byte character encoding. You want to see that an emoji or accented character like 'é' takes up more than one byte in UTF-8, and this shows the exact byte sequence for any input.
  • Preparing a payload for a low-level protocol. You are hand-crafting a message for a protocol that expects raw byte values, and need the numeric byte sequence of a text field before assembling the full payload.
  • Debugging an encoding mismatch. Two systems disagree about a string's encoding, and comparing the actual UTF-8 byte values against what one system expects narrows down where the mismatch happens.

Examples

Encode

Input

Hi

Output

72 105

About the Convert a String to Bytes tool

Convert a String to Bytes does its work locally, right in the browser. Encode a string as its sequence of UTF-8 byte values. There is no upload step, no queue and no account, and your data never travels over the network.

It belongs to the String Tools collection on EditSafely, a set of 159 small, focused String utilities that share the same instant, private workspace.

You can shape the output with the Separator setting, and the result refreshes the moment you change it. A worked example further down the page shows exactly what the tool produces for a real input.

Running locally also makes the tool fast and dependable: results appear as you type or drop a file, there is no server outage that can take it down mid-task, and confidential data can be processed without a second thought.

Frequently asked questions

Does Convert a String to Bytes cost anything?

Yes, it is completely free. All 2,658 tools on EditSafely work without an account, a subscription or usage limits.

Is it safe to paste sensitive or confidential data?

No data leaves your device. The whole tool is JavaScript that runs inside your browser tab, so there is no upload, no server-side processing and no log of what you did. If you disconnect from the internet after the page loads, it keeps working.

How much text can I process at once?

There is no fixed limit. Because the work happens on your own device rather than on a shared server, the practical ceiling is your machine's memory, which comfortably handles inputs far larger than typical online tools allow.

Do I need to sign up or install anything?

Nothing to install and no account needed. Open the page in any up-to-date browser, including on a phone or tablet, and the tool is ready.

How do I use the result?

The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.