中文English

unicode ontools converter

Quickly convert Chinese characters, symbols, and emojis to \uXXXX format, runs entirely in browser, no upload required.

Unicode Encoding Guide

What is Unicode Encoding?

Convert characters to \uXXXX (4-digit hexadecimal) or \u{XXXXXX} format, facilitating secure storage and transmission in code, configuration files, and databases.

Common Scenarios

  • Embedding Chinese or emoji in Java, C#, JavaScript source code
  • Preventing garbled characters in JSON configuration files
  • Storing multilingual text in databases

JavaScript Quick Reference

// Encode
function toUnicode(str) {
  return str.split('').map(c => '\\u' + c.charCodeAt(0).toString(16).padStart(4,'0')).join('');
}

Privacy Statement

All computations are performed in the browser, zero upload, zero data collection.

What is the difference between Unicode and UTF-8?

Unicode is a character set that defines a unique number (code point) for each character. UTF-8 is an implementation of Unicode, a variable-length encoding scheme. For example, the Unicode code point for the Chinese character "中" is U+4E2D, and its UTF-8 encoding is E4 B8 AD.

What Unicode formats does the tool support?

This tool supports standard Unicode format (\uXXXX), HTML entity encoding (&#XXXXX;), and U+XXXX format. It also supports batch conversion of mixed formats.