Convert UTF8 to UTF16
Quickly convert UTF8 encoding to UTF16 encoding. Runs entirely in your browser, so your data never leaves your device.
Runs on your device, nothing uploaded
0 chars Β· 0 lines
Output
Quickly convert UTF8 encoding to UTF16 encoding.
Type or paste above to see the result here.
What you paste never leaves this tab
Convert UTF8 to UTF16 is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, the text you paste is sent to a server that can log it, cache it or keep it. Here it is read and transformed inside this tab and nowhere else.
- No upload
- No length limit
- Works offline once loaded
- Nothing stored or logged
How to use Convert UTF8 to UTF16
- 1. Paste the UTF-8 text. Type or paste the text, such as Hi π. The UTF-16 code units appear at once; an emoji becomes a surrogate pair, named in the line under the result (π = D83D DE00).
- 2. Pick an Output. Output chooses code units (0048), big-endian or little-endian bytes (00 48 or 48 00) or \u escapes for source code. For bytes, tick Add a byte order mark to start with FF FE or FE FF, as Windows Notepad does. Case and Separator set how the hex is written.
- 3. Copy the UTF-16 output. Press Copy. The reverse button opens UTF16 to UTF8, which reads code units, both byte orders and a BOM back into text.
When to use Convert UTF8 to UTF16
Convert UTF8 to UTF16 produces the 16-bit code unit representation that Windows APIs, Java and JavaScript strings use internally. It is useful for generating reference values when you need to check that a surrogate pair is being handled correctly somewhere in your stack.
- Building a test case for a Windows API call. You are calling a Win32 function that expects a wide string and want a known-good UTF-16 code unit sequence to hardcode into a test before wiring up the real conversion.
- Verifying surrogate pair handling in your own code. You wrote code that manually walks a UTF-16 string and want to confirm it correctly treats an emoji as two surrogate code units rather than one.
- Comparing JavaScript string length against UTF-16 units. You are explaining why a JavaScript string's length property counts differently than its visible character count, and want to show the actual 16-bit units behind an emoji.
Examples
Encode
Input
Hi
Output
0048 0069
Little-endian bytes with a BOM
Input
Hi
Output
ff fe 48 00 69 00
Emoji as a surrogate pair
Input
π
Output
d83d de00
About the Convert UTF8 to UTF16 tool
Convert UTF8 to UTF16 is a free online tool that works entirely inside your web browser. Quickly convert UTF8 encoding to UTF16 encoding. Because the processing happens on your own device, nothing you enter is uploaded, logged or stored anywhere.
This page is one of 69 UTF-8 utilities on EditSafely. Each one does a single job well, and all of them follow the same rule: your input stays on your machine.
You can shape the output with 4 settings, including Output, Add a byte order mark (BOM), Case and Separator, and the result refreshes the moment you change one. 3 worked examples further down the page show exactly what the tool produces for real inputs.
Because nothing leaves your device, the tool is suitable for sensitive content such as internal documents, credentials or customer data. It also responds instantly, since every step is handled on your own machine rather than by a remote API.
Frequently asked questions
Is Convert UTF8 to UTF16 free to use?
Yes, it is completely free. All 2,943 tools on EditSafely work without an account, a subscription or usage limits.
Is it safe to paste sensitive or confidential data?
Everything happens locally. Your browser downloads the tool's code once, then does all the processing itself; nothing you enter is transmitted, stored or logged. You can even go offline after the page loads and it will still work.
How much text can I process at once?
There is no fixed limit; your device's memory is the ceiling. Up to 10 MB the result updates as you type, after a short pause that grows with the size. Above 10 MB a Run button appears so typing stays smooth, and files open up to 50 MB. A very long result shows its first 2,000 lines on screen, while Copy and Download always include all of it.
Do I need to sign up or install anything?
No. The tool works in any modern browser on desktop, tablet or phone. There is no account to create, no extension to add and no software to install.
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.