Our Network


Coming Soon


Coming Later

string literal creator

world's simplest unicode tool

This browser-based utility converts Unicode text to a string literal. Anything that you paste or enter in the text area on the left automatically gets converted to a string literal on the right. It supports the most popular Unicode encodings (such as UTF-8, UTF-16, UCS-2, UTF-32, and UCS-4) and it works with emoji characters. You can use code points or bytes in the literal sequences as well as customize their format. You can also change the literal delimiter and create a proper string by wrapping it in double quotes. Created by encoding gurus from team Browserling.

᠎᠎᠎          Tool Options

String Literal Format

Use code points in string literals.
Use bytes in string literals.
Use this symbol to delimit
individual escape codes.
Convert escape codes to uppercase.
Wrap output in double quote marks.

Code Point Format

Choose format for code points.
Set a custom code point format
here.
Valid formats are
%B – binary,
%O – octal,
%D – decimal,
%H – hex,
%U – surrogate pair.
Use \B, \O, \D, \H, \U to write
literal letters B, O, D, H, U.

Byte Format

Choose format for bytes.
Set a custom byte format here.
(See custom code points for format.)
Choose input encoding here.
When using UTF16, UTF32, UCS2,
or UCS4 encodings, add a BOM
indicator before the string literal.

What is a string literal creator?

This utility converts Unicode glyphs to literal strings that you can use in various programming languages and configuration files. It takes the input Unicode data, converts it to binary bytes and code positions, and outputs them as a sequence of escape codes. You can use eight different formats for code positions, such as Java escape codes (\uHHHH), Ruby escape codes (\u{HHHH}), HTML, XML, and XHTML escape codes (&#D; and &#xHH;), and others. If none of these formats are suitable for you, you can define your own format. To do this, select the "custom" code point format and enter your own format. To print binary code positions, use %B notation, octal code positions – %O, decimal – %D, hexadecimal – %H, or hexadecimal surrogate pairs – %U. To write ordinary letters B, O, D, H, U, add a backslash in front of them. For example, \B will write B and \\ will write a slash. There are sixteen different formats for working with bytes, including Perl escape codes (\x{HH}), SQL escape codes (#HH#), and C escape codes (\xHH). You can also set a custom escape format for bytes using the same notation as for code points (except %U). Additionally, for byte escape codes, you can choose the Unicode encoding of your data. We support UTF-8 (default), UCS-2, UTF-16-LE, UTF-16-BE, UCS-4, UTF-32-LE, and UTF32-BE encodings and optionally you can add a Byte Order Mark (BOM). You can also print escape codes in uppercase and change the delimiter that gets placed between escape codes. To make the string literal immediately usable, you can also wrap the output in double quotation marks.


String literal creator examples

Click to try

Java String Literal

In this example, we convert a quote from Albert Einstein to a Java string literal. We use the u-prefix format, which converts each Unicode character to a hexadecimal code point pair and adds the prefix \u in front. We wrap the string literal in double quotes and you can paste it directly in your JavaScript code and it will work.

The only source of knowledge is experience
"\uff34\uff48\uff45\u0020\uff4f\uff4e\uff4c\uff59\u0020\uff53\uff4f\uff55\uff52\uff43\uff45\u0020\uff4f\uff46\u0020\uff4b\uff4e\uff4f\uff57\uff4c\uff45\uff44\uff47\uff45\u0020\uff49\uff53\u0020\uff45\uff58\uff50\uff45\uff52\uff49\uff45\uff4e\uff43\uff45"
Required options
These options will be used automatically if you select this example.
Use code points in string literals.
Use this symbol to delimit
individual escape codes.
Convert escape codes to uppercase.
Wrap output in double quote marks.
Choose format for code points.

Unicode Snail

This example encodes snail art created from various Unicode characters to a literal hex string. It applies UTF8 curly-hex-byte format used in Perl code to every character. This format puts hex bytes in curly brackets and adds a backslash and the hex prefix "x" before each byte. The bytes are printed in uppercase and they are separated by the space symbol.

.----. @ @ / .-"-.`. \v/ | | '\ \ \_/ ) ,-\ `-.' /.' / '---`----'----' hjw
\x{20} \x{20} \x{20} \x{20} \x{2E} \x{2D} \x{2D} \x{2D} \x{2D} \x{2E} \x{20} \x{20} \x{20} \x{40} \x{20} \x{20} \x{20} \x{40} \x{0A} \x{20} \x{20} \x{20} \x{2F} \x{20} \x{2E} \x{2D} \x{22} \x{2D} \x{2E} \x{60} \x{2E} \x{20} \x{20} \x{5C} \x{76} \x{2F} \x{0A} \x{20} \x{20} \x{20} \x{7C} \x{20} \x{7C} \x{20} \x{27} \x{5C} \x{20} \x{5C} \x{20} \x{5C} \x{5F} \x{2F} \x{20} \x{29} \x{0A} \x{20} \x{2C} \x{2D} \x{5C} \x{20} \x{60} \x{2D} \x{2E} \x{27} \x{20} \x{2F} \x{2E} \x{27} \x{20} \x{20} \x{2F} \x{0A} \x{27} \x{2D} \x{2D} \x{2D} \x{60} \x{2D} \x{2D} \x{2D} \x{2D} \x{27} \x{2D} \x{2D} \x{2D} \x{2D} \x{27} \x{20} \x{68} \x{6A} \x{77}
Required options
These options will be used automatically if you select this example.
Use bytes in string literals.
Use this symbol to delimit
individual escape codes.
Convert escape codes to uppercase.
Wrap output in double quote marks.
Choose format for bytes.
Choose input encoding here.

Medical Emojis

In this example, we create our own custom string literal using a custom byte format. We select the "custom" format from the byte format list and enter the format value "#$%H". The first two characters "#$" are the escape prefix and the last two "%H" correspond to a non-padded hexadecimal byte value. We set the escape code separator symbol to a comma to clearly show each byte and wrap the entire sequence in quotes. The input medicine emoticons are encoded as UTF-16 Little Endian bytes with a BOM indicator (the first two bytes).

💊 – pill 💉 – syringe 🧪 – test tube 🧫 – petri dish 🧬 – DNA double-helix
"#$FF, #$FE, #$3D, #$D8, #$8A, #$DC, #$20, #$0, #$13, #$20, #$20, #$0, #$70, #$0, #$69, #$0, #$6C, #$0, #$6C, #$0, #$A, #$0, #$3D, #$D8, #$89, #$DC, #$20, #$0, #$13, #$20, #$20, #$0, #$73, #$0, #$79, #$0, #$72, #$0, #$69, #$0, #$6E, #$0, #$67, #$0, #$65, #$0, #$A, #$0, #$3E, #$D8, #$EA, #$DD, #$20, #$0, #$13, #$20, #$20, #$0, #$74, #$0, #$65, #$0, #$73, #$0, #$74, #$0, #$20, #$0, #$74, #$0, #$75, #$0, #$62, #$0, #$65, #$0, #$A, #$0, #$3E, #$D8, #$EB, #$DD, #$20, #$0, #$13, #$20, #$20, #$0, #$70, #$0, #$65, #$0, #$74, #$0, #$72, #$0, #$69, #$0, #$20, #$0, #$64, #$0, #$69, #$0, #$73, #$0, #$68, #$0, #$A, #$0, #$3E, #$D8, #$EC, #$DD, #$20, #$0, #$13, #$20, #$20, #$0, #$44, #$0, #$4E, #$0, #$41, #$0, #$20, #$0, #$64, #$0, #$6F, #$0, #$75, #$0, #$62, #$0, #$6C, #$0, #$65, #$0, #$2D, #$0, #$68, #$0, #$65, #$0, #$6C, #$0, #$69, #$0, #$78, #$0"
Required options
These options will be used automatically if you select this example.
Use bytes in string literals.
Use this symbol to delimit
individual escape codes.
Convert escape codes to uppercase.
Wrap output in double quote marks.
Choose format for bytes.
Set a custom byte format here.
(See custom code points for format.)
Choose input encoding here.
When using UTF16, UTF32, UCS2,
or UCS4 encodings, add a BOM
indicator before the string literal.

Pro tips Master online unicode tools

You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!

https://onlinetools.com/unicode/convert-unicode-to-string-literal?input=%EF%BC%B4%EF%BD%88%EF%BD%85%20%EF%BD%8F%EF%BD%8E%EF%BD%8C%EF%BD%99%20%EF%BD%93%EF%BD%8F%EF%BD%95%EF%BD%92%EF%BD%83%EF%BD%85%20%EF%BD%8F%EF%BD%86%20%EF%BD%8B%EF%BD%8E%EF%BD%8F%EF%BD%97%EF%BD%8C%EF%BD%85%EF%BD%84%EF%BD%87%EF%BD%85%20%EF%BD%89%EF%BD%93%20%EF%BD%85%EF%BD%98%EF%BD%90%EF%BD%85%EF%BD%92%EF%BD%89%EF%BD%85%EF%BD%8E%EF%BD%83%EF%BD%85&use-code-point=true&code-point-format=u-prefixed-surrogate&uppercase=false&separator=&wrap-in-quotes=true

All Unicode Tools

Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!
Convert Unicode to Code Points

Quickly find code positions of all Unicode values.

Convert Code Points to Unicode

Quickly decode code positions to Unicode values.

Convert Unicode to UTF-8

Quickly encode Unicode values to UTF-8 encoding.

Convert Unicode to UTF-16

Quickly encode Unicode values to UTF-16 encoding.

Convert Unicode to UTF-32

Quickly encode Unicode values to UTF-32 encoding.

Convert Unicode to an Image

Quickly create a picture from Unicode symbols.

Generate Random Unicode

Quickly generate random Unicode text in a given range.

Generate Unicode Range

Quickly generate all Unicode values from the given code point interval.

Extract Unicode Range

Quickly filter Unicode symbols that are within the given code point interval.

Extract Graphemes

Quickly split Unicode data into graphemes.

Sort Graphemes

Quickly sort Unicode glyphs in increasing or decreasing order.

Count Unicode Characters

Quickly find the length of Unicode text.

Increment Unicode Values

Quickly increase Unicode code point values.

Decrement Unicode Values

Quickly decrease Unicode code point values.

Reverse Unicode

Quickly reverse the order of symbols in Unicode text.

Rotate Unicode Text

Quickly rotate Unicode characters to the left and right.

Repeat Unicode

Quickly create multiple copies of Unicode text.

Split Unicode Into Characters

Quickly extract all characters from Unicode text.

Split Unicode Into Fragments

Quickly split Unicode data into pieces.

Chunkify Unicode

Quickly split Unicode text into chunks of constant length.

Join Unicode

Quickly merge Unicode snippets together.

Truncate Unicode

Quickly shorten Unicode text to the given length.

Left-pad Unicode

Quickly left-pad Unicode text with any character.

Right-pad Unicode

Quickly right-pad Unicode text with any character.

Center Unicode

Quickly align Unicode data to the center.

Right-align Unicode

Quickly align Unicode data to the right.

Generate Unicode Numbers

Quickly convert ordinary numbers to fancy Unicode numbers.

Normalize Unicode Numbers

Quickly convert Unicode numbers back to regular numbers.

Generate Unicode Letters

Quickly convert ordinary letters to Unicode letters in various fonts.

Normalize Unicode Letters

Quickly convert Unicode letters back to regular Latin letters.

Generate Unicode Text

Quickly convert ordinary text to fancy Unicode text.

Normalize Unicode Text

Quickly convert fancy Unicode text back to regular text.

Add Combining Characters

Quickly combine input Unicode with diacritical marks.

Remove Combining Characters

Quickly delete diacritical marks from the Unicode text.

Spoof Unicode Text

Quickly spoof regular text using Unicode homoglyphs.

Unspoof Unicode Text

Quickly unspoof homoglyphs in text with regular letters.

Check Spoofed Unicode Text

Quickly check if the given Unicode text is spoofed or not.

Cyclically Shift Unicode

Quickly circularly rearrange Unicode symbols.

Escape Unicode

Quickly convert Unicode data to escape sequences.

Convert Unicode to HTML

Quickly encode Unicode data to HTML entities.

URL-encode Unicode

Quickly URL-escape Unicode symbols.

Convert Unicode to Base64

Quickly encode Unicode values to base64.

Convert Unicode to a Data URL

Quickly encode Unicode values to a data URI.

Convert Unicode to Bytes

Quickly convert Unicode characters to raw bytes.

Convert Unicode to Binary

Quickly convert Unicode data to base-2 (binary).

Convert Unicode to Octal

Quickly convert Unicode data to base-8 (octal).

Convert Unicode to Decimal

Quickly convert Unicode data to base-10 (decimal).

Convert Unicode to Hex

Quickly convert Unicode data to base-16 (hexadecimal).

Convert Unicode to ASCII

Quickly convert Unicode symbols to raw ASCII bytes.

Convert ASCII to Unicode

Quickly convert ASCII bytes to Unicode symbols.

Convert Unicode to a String Literal

Quickly convert Unicode text to a string literal.

Convert Emoji to an Image

Quickly create a picture from Unicode emojis.

Let Zalgo Destroy Unicode

Quickly release Zalgo on your Unicode text.

Remove Zalgo from Unicode

Quickly make Zalgo text readable again.


Coming Soon

These Unicode tools are on the way!
Edit Unicode

View and edit Unicode in a browser-based editor.

Name Unicode Symbols

Spell out the names of Unicode characters in the input text.

URL-decode Unicode

URL-unescape Unicode text.

Convert Binary to Unicode

Convert base-2 data to Unicode encoding.

Convert Octal to Unicode

Convert base-8 data to Unicode encoding.

Convert Decimal to Unicode

Convert base-10 data to Unicode encoding.

Convert Hex to Unicode

Convert base-16 data to Unicode encoding.

Convert Unicode to Any Base

Convert Unicode text to any radix.

Convert Any Base to Unicode

Convert any radix data to Unicode.

Convert Unicode to Latin1

Convert Unicode text to ISO-8859-1 encoding.

Convert Latin1 to Unicode

Convert ISO-859-1 encoded data to Unicode.

Convert Unicode to Latin2

Convert Unicode text to ISO-8859-2 encoding.

Convert Latin2 to Unicode

Convert ISO-8859-2 encoded data to Unicode.

Convert Unicode to Ecoji

Convert Unicode text to Ecoji encoding.

Convert Ecoji to Unicode

Convert Ecoji encoded data to Unicode.

Convert Bytes to Unicode

Convert raw bytes to Unicode.

Check Unicode Version

Check the Unicode version of the given Unicode characters.

Validate Unicode

Check if the given Unicode has valid encoding.

Convert Unicode to Punycode

Encode Unicode text to Punycode encoding.

Convert Punycode to Unicode

Decode Punycode encoding to Unicode.

Decode Base64 to Unicode

Convert base64 data to Unicode text.

Encode Unicode to Data URI

Convert Unicode to a valid data URL.

Decode Data URI to Unicode

Convert a valid data URL to Unicode text.

Convert HTML to Unicode

Decode HTML entities to Unicode data.

Convert UTF8 to Unicode

Decode UTF8 encoding to Unicode.

Convert UTF16 to Unicode

Decode UTF16 encoding to Unicode.

Convert UTF32 to Unicode

Decode UTF32 encoding to Unicode.

Convert Unicode to Uppercase

Convert all Unicode characters to uppercase.

Convert Unicode to Lowercase

Convert all Unicode characters to lowercase.

Print All Unicode Flags

Generate a list of all country flag icons.

Print All Unicode Arrows

Generate a list of all Unicode arrows.

Print All Unicode Animals

Generate a list of all Unicode animals.

Print All Unicode Flowers and Plants

Generate a list of all Unicode flowers and plants.

Print All Unicode Blocks

Generate a list of all Unicode block elements.

Print All Unicode Hieroglyphs

Generate a list of all Egyptian hieroglyphs.

Print All Unicode Currencies

Generate a list of all currency symbols.

Generate a Unicode Rainbow

Use Unicode colors to generate a rainbow.

Generate a Lenny Face

Create a smiley face from Unicode symbols.

Generate Random Emoji

Generate a list of random emojis.

Convert Unicode to Randomcase

Randomize case of all Unicode characters.

Convert Unicode to Lowercase

Convert all Unicode characters to lowercase.

JSON Stringify Unicode

Encode Unicode to JSON.

JSON Parse Unicode

Decode JSON to Unicode.

Shuffle Unicode Symbols

Randomly rearrange the order of input graphemes.

Convert Unicode to Alt Code

Generate Alt codes for Unicode characters.

Convert Alt Code to Unicode

Generate Unicode glyphs from Alt codes.

Analyze Unicode

Print statistics about Unicode data and code points.

Slice Unicode

Extract a part from Unicode data.

Draw a Unicode Wave

Generate waves with Unicode symbols.

Draw a Unicode Sparkline

Generate graphs using Unicode symbols.

Draw a Unicode Box

Wrap a message in a Unicode box.


Subscribe!

Subscribe to our updates. We'll let you know when we release new tools, features, and organize online workshops.

Enter your email here


Feedback. We'd love to hear from you! 👋