EditSafely

Generate Random UTF16

Generate random UTF16 characters. Runs entirely in your browser, so your data never leaves your device.

Output

The result appears here as you type.

Options

How to use Generate Random UTF16

  1. 1. Set how many characters to generate. Enter How many characters to control the batch size, each one a random character shown by its UTF-16 code unit in hex, like 2603 or 4e2d.
  2. 2. Choose a separator. Set Separator to a space or newline depending on whether you want the code units on one line or spread across multiple lines.
  3. 3. Copy the generated code units. Copy the hex values and paste them into a test suite for a UTF-16 encoder, a teaching example, or a byte-level comparison against other encodings.

When to use Generate Random UTF16

Generate Random UTF16 produces random characters shown as their UTF-16 code units in hex, useful whenever you need sample data for testing code that reads or writes UTF-16 encoded text at the code unit level.

  • Testing a UTF-16 encoding function. You wrote a function that converts characters to their UTF-16 code unit representation, and want generated random characters to confirm the output hex values match what the function should produce.
  • Comparing UTF-16 against UTF-8 and UTF-32. You are teaching how the same character is represented differently across Unicode encodings, and want side-by-side generated examples in UTF-16, UTF-8, and UTF-32 to show the size difference.
  • Debugging a Windows or Java text encoding issue. You are troubleshooting a bug involving UTF-16 strings, since Java and Windows APIs commonly use this encoding internally, and want sample code unit values to trace through your debugging steps.
  • Fuzz testing a text decoder for surrogate handling. You are checking that a decoder correctly handles UTF-16 surrogate pairs used for characters outside the basic multilingual plane, so you generate a batch of code units to feed through it.

Examples

Ten random UTF-16 characters

Output

2603 4e2d 00e9 ...

About the Generate Random UTF16 tool

Generate Random UTF16 runs as plain JavaScript in your browser tab, with no server behind it. Generate random UTF16 characters. Whatever you put in stays on your device from start to finish.

The tool is part of EditSafely's Random Tools section, 120 single-purpose utilities built around the same idea: open the page, get the result, keep your data to yourself.

You can shape the output with 2 settings, including How many characters and Separator, and the result refreshes the moment you change one. A worked example further down the page shows exactly what the tool produces for a real input.

That local-first design has practical benefits beyond privacy. The tool keeps working on a flaky connection once the page has loaded, results are instant because nothing round-trips to a server, and it is safe to use with confidential material.

Frequently asked questions

Is Generate Random UTF16 free to use?

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

Does the generator send anything to a server?

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 do I get a different result?

Run the generator again. Each run is computed fresh on your device, and any options you change are applied to the next result immediately.

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.